Package org.jboss.classloading.spi.version

Examples of org.jboss.classloading.spi.version.VersionRange


            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA1);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("b"));
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  ClassLoader clC1 = assertClassLoader(contextC1);
View Full Code Here


            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA1);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("b"));
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("2.0.0", "3.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  assertNoClassLoader(contextC1);
               }
               finally
               {
                  uninstall(contextC1);
               }
               assertNoClassLoader(contextC1);

               c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("b"));
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               contextC1 = install(c1);
               try
               {
                  ClassLoader clC1 = assertClassLoader(contextC1);
View Full Code Here

      test = new NameAndVersionRangeSupport("test");
      assertEquals("test", test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());

      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      test = new NameAndVersionRangeSupport("test", range);
      assertEquals("test", test.getName());
      assertEquals(range, test.getVersionRange());
     
      try
View Full Code Here

   public void testSetVersionRange() throws Exception
   {
      NameAndVersionRangeSupport test = new NameAndVersionRangeSupport();
      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());
View Full Code Here

     
   public void testEquals() throws Exception
   {
      testEquals("a", VersionRange.ALL_VERSIONS, "a", VersionRange.ALL_VERSIONS, true);
      testEquals("a", VersionRange.ALL_VERSIONS, "a", null, true);
      VersionRange range1 = new VersionRange("1.0.0", true, "1.0.0", true);
      testEquals("b", range1, "b", range1, true);
     
      testEquals("a", VersionRange.ALL_VERSIONS, "b", VersionRange.ALL_VERSIONS, false);
      testEquals("a", range1, "a", VersionRange.ALL_VERSIONS, false);
      VersionRange range2 = new VersionRange("1.0.0", true, "2.0.0", true);
      testEquals("a", range1, "a", range2, false);
   }
View Full Code Here

      test = new ModuleRequirement("test");
      assertEquals("test", test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());

      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      test = new ModuleRequirement("test", range);
      assertEquals("test", test.getName());
      assertEquals(range, test.getVersionRange());
     
      try
View Full Code Here

   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());
View Full Code Here

  
   public void testEquals() throws Exception
   {
      testEquals("a", VersionRange.ALL_VERSIONS, "a", VersionRange.ALL_VERSIONS, true);
      testEquals("a", VersionRange.ALL_VERSIONS, "a", null, true);
      VersionRange range1 = new VersionRange("1.0.0", true, "1.0.0", true);
      testEquals("b", range1, "b", range1, true);
     
      testEquals("a", VersionRange.ALL_VERSIONS, "b", VersionRange.ALL_VERSIONS, false);
      testEquals("a", range1, "a", VersionRange.ALL_VERSIONS, false);
      VersionRange range2 = new VersionRange("1.0.0", true, "2.0.0", true);
      testEquals("a", range1, "a", range2, false);
   }
View Full Code Here

      }
   }
  
   protected void testIsConsistent(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);
      testIsConsistent(name1, range1, name2, range2, result);
      testIsConsistent(name2, range2, name1, range1, result);
   }
View Full Code Here

      testIsConsistent(name2, range2, name1, range1, result);
   }
  
   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

TOP

Related Classes of org.jboss.classloading.spi.version.VersionRange

Copyright © 2018 www.massapicom. 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.