Package org.jboss.classloading.spi.version

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


   }
  
   public void testCreateReExportPackageVersioned() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      Requirement test = factory.createReExportPackage("test", range);
      PackageRequirement expected = new PackageRequirement("test", range);
      expected.setReExport(true);
      assertEquals(expected, test);
   }
View Full Code Here


   }
  
   public void testCreateReExportPackageVersionedOptional() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      Requirement test = factory.createReExportPackage("test", range, true);
      PackageRequirement expected = new PackageRequirement("test", range);
      expected.setOptional(true);
      expected.setReExport(true);
      assertEquals(expected, test);
View Full Code Here

   }
  
   public void testCreateUsesPackageVersioned() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      Requirement test = factory.createUsesPackage("test", range);
      UsesPackageRequirement expected = new UsesPackageRequirement("test", range);
      assertEquals(expected, test);
   }
View Full Code Here

   }
  
   public void testCreateUsesPackageVersionedOptional() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      VersionRange range = new VersionRange("1.0.0", "2.0.0");
      Requirement test = factory.createUsesPackage("test", range, true);
      UsesPackageRequirement expected = new UsesPackageRequirement("test", range);
      expected.setReExport(true);
      assertEquals(expected, test);
   }
View Full Code Here

      RequirementsMetaData metadata = new RequirementsMetaData();
      assertNull(metadata.getRequirements());
     
      List<Requirement> list = new ArrayList<Requirement>();
      list.add(factory.createRequireModule("module", new VersionRange("1.0.0")));
      list.add(factory.createRequirePackage("package", new VersionRange("1.0.0")));
      metadata.setRequirements(list);
     
      assertEquals(list, metadata.getRequirements());
   }
View Full Code Here

      RequirementsMetaData metadata = new RequirementsMetaData();
      assertNull(metadata.getRequirements());
     
      List<Requirement> list = new ArrayList<Requirement>();
      Requirement Requirement = factory.createRequireModule("module", new VersionRange("1.0.0"));
      metadata.addRequirement(Requirement);
      list.add(Requirement);
      assertEquals(list, metadata.getRequirements());

      Requirement = factory.createRequirePackage("module", new VersionRange("1.0.0"));
      metadata.addRequirement(Requirement);
      list.add(Requirement);
      assertEquals(list, metadata.getRequirements());
   }
View Full Code Here

      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();

      RequirementsMetaData metadata = new RequirementsMetaData();
      assertNull(metadata.getRequirements());

      Requirement module = factory.createRequireModule("module", new VersionRange("1.0.0"));
      Requirement pkge = factory.createRequirePackage("module", new VersionRange("1.0.0"));

      List<Requirement> list = new ArrayList<Requirement>();
      list.add(module);
      list.add(pkge);
      metadata.setRequirements(list);
View Full Code Here

   public void testSerialization() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();

      RequirementsMetaData test = new RequirementsMetaData();
      test.addRequirement(factory.createRequireModule("module", new VersionRange("1.0.0")));
      test.addRequirement(factory.createRequirePackage("package", new VersionRange("1.0.0")));
      RequirementsMetaData other = serializeDeserialize(test, RequirementsMetaData.class);
      assertEquals(test.getRequirements(), other.getRequirements());
   }
View Full Code Here

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

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

   public void testSetVersionRange() throws Exception
   {
      PackageRequirement test = new PackageRequirement();
      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

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.