Package org.jboss.classloading.spi.helpers

Examples of org.jboss.classloading.spi.helpers.NameAndVersionRangeSupport


      super(name);
   }
  
   public void testConstructors() throws Exception
   {
      NameAndVersionRangeSupport test = new NameAndVersionRangeSupport();
      assertNotNull(test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());

      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
      {
         fail("Should not be here for: " + new NameAndVersionRangeSupport(null));
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         fail("Should not be here for: " + new NameAndVersionRangeSupport(null, range));
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
View Full Code Here


      }
   }
  
   public void testSetName() throws Exception
   {
      NameAndVersionRangeSupport test = new NameAndVersionRangeSupport();
      assertNotNull(test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
      test.setName("name");
      assertEquals("name", test.getName());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
     
      test = new NameAndVersionRangeSupport();
      try
      {
         test.setName(null);
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
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());
      assertEquals(VersionRange.ALL_VERSIONS, test.getVersionRange());
   }
View Full Code Here

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

      assertEquals(test, other);
   }
  
   protected void testEquals(String name1, VersionRange range1, String name2, VersionRange range2, boolean result)
   {
      NameAndVersionRangeSupport test1 = new NameAndVersionRangeSupport(name1, range1);
      NameAndVersionRangeSupport test2 = new NameAndVersionRangeSupport(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

TOP

Related Classes of org.jboss.classloading.spi.helpers.NameAndVersionRangeSupport

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.