Examples of ModuleRequirement


Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      }
   }
  
   public void testSetName() throws Exception
   {
      ModuleRequirement test = new ModuleRequirement();
      assertNotNull(test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
      test.setName("name");
      assertEquals("name", test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
     
      test = new ModuleRequirement();
      try
      {
         test.setName(null);
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      }
   }
  
   public void testSetVersionRange() throws Exception
   {
      ModuleRequirement test = new ModuleRequirement();
      assertNotNull(test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      test.setVersionRange(range);
      assertNotNull(test.getName());
      assertEquals(range, test.getVersionRange());
      test.setVersionRange(null);
      assertNotNull(test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      testEquals("a", range1, "a", range2, false);
   }
  
   public void testSerialization() throws Exception
   {
      ModuleRequirement test = new ModuleRequirement("a", VersionRange.ALL_VERSIONS);
      ModuleRequirement other = serializeDeserialize(test, ModuleRequirement.class);
      assertEquals(test, other);
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      assertEquals(test, other);
   }
  
   protected void testEquals(String name1, VersionRange range1, String name2, VersionRange range2, boolean result)
   {
      ModuleRequirement test1 = new ModuleRequirement(name1, range1);
      ModuleRequirement test2 = new ModuleRequirement(name2, range2);
      if (result)
      {
         assertTrue("Expected " + test1 + ".equals(" + test2 + ") to be true", test1.equals(test2));
         assertTrue("Expected " + test2 + ".equals(" + test1 + ") to be true", test2.equals(test1));
      }
      else
      {
         assertFalse("Expected " + test1 + ".equals(" + test2 + ") to be false", test1.equals(test2));
         assertFalse("Expected " + test2 + ".equals(" + test1 + ") to be false", test2.equals(test1));
      }
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

  
   protected void testIsConsistentOther(String name1, String low1, String high1, String name2, String low2, String high2, boolean result)
   {
      VersionRange range1 = new VersionRange(low1, true, high1, true);
      VersionRange range2 = new VersionRange(low2, true, high2, true);
      ModuleRequirement test1 = new ModuleRequirement(name1, range1);
      TestRequirement test2 = new TestRequirement(name2, range2);
      testIsConsistent(test1, test2, result);
      testIsConsistent(test1, test2, result);
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      testIsConsistent(test1, test2, result);
   }
  
   protected void testIsConsistent(String name1, VersionRange range1, String name2, VersionRange range2, boolean result)
   {
      ModuleRequirement test1 = new ModuleRequirement(name1, range1);
      ModuleRequirement test2 = new ModuleRequirement(name2, range2);
      testIsConsistent(test1, test2, result);
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      {
         for (Requirement requirement : requirements)
         {
            if (requirement instanceof ModuleRequirement)
            {
               ModuleRequirement mr = (ModuleRequirement)requirement;
               if (mr.getName().equals(module))
                  return mr;
            }
         }
      }
      return null;
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      {
         for (Requirement requirement : requirements)
         {
            if (requirement instanceof ModuleRequirement)
            {
               ModuleRequirement mr = (ModuleRequirement)requirement;
               if (mr.getName().equals(module))
                  return mr;
            }
         }
      }
      return null;
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

      for (Module module : modules)
      {
         List<Capability> capabilities = module.getCapabilitiesRaw();
         if (capabilities != null && capabilities.isEmpty() == false)
         {
            ModuleRequirement requirement = new ModuleRequirement(name, range);
            for (Capability capability : capabilities)
            {
               if (capability.resolves(module, requirement))
               {
                  result.add(module);
View Full Code Here

Examples of org.jboss.classloading.plugins.metadata.ModuleRequirement

            for (RequirementDependencyItem dependencyItem : requirementDependencyItems)
            {
               Requirement requirement = dependencyItem.getRequirement();
               if (requirement instanceof ModuleRequirement && dependencyItem.isResolved())
               {
                  ModuleRequirement moduleRequirement = (ModuleRequirement)requirement;
                  if (name == null || name.equals(moduleRequirement.getName()))
                  {
                     if (range.isConsistent(moduleRequirement.getVersionRange()))
                     {
                        Module other = module.resolveModule(dependencyItem, true);
                        ImportModule importModule = new ImportModule(other);
                        result.add(importModule);
                     }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.