Package org.jboss.classloading.spi.helpers

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


      super(name);
   }
  
   public void testConstructors() throws Exception
   {
      NameAndVersionSupport test = new NameAndVersionSupport();
      assertNotNull(test.getName());
      assertEquals(Version.DEFAULT_VERSION, test.getVersion());

      test = new NameAndVersionSupport("test");
      assertEquals("test", test.getName());
      assertEquals(Version.DEFAULT_VERSION, test.getVersion());

      test = new NameAndVersionSupport("test", "version");
      assertEquals("test", test.getName());
      assertEquals("version", test.getVersion());
     
      try
      {
         fail("Should not be here for: " + new NameAndVersionSupport(null));
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
     
      try
      {
         fail("Should not be here for: " + new NameAndVersionSupport(null, "version"));
      }
      catch (Throwable t)
      {
         checkDeepThrowable(IllegalArgumentException.class, t);
      }
View Full Code Here


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

      }
   }
  
   public void testSetVersion() throws Exception
   {
      NameAndVersionSupport test = new NameAndVersionSupport();
      assertNotNull(test.getName());
      assertEquals(Version.DEFAULT_VERSION, test.getVersion());
      test.setVersion("version");
      assertNotNull(test.getName());
      assertEquals("version", test.getVersion());
      test.setVersion(null);
      assertNotNull(test.getName());
      assertEquals(Version.DEFAULT_VERSION, test.getVersion());
   }
View Full Code Here

      testEquals("a", "1.0.0", "a", "2.0.0", false);
   }
  
   public void testSerialization() throws Exception
   {
      NameAndVersionSupport test = new NameAndVersionSupport("a", Version.DEFAULT_VERSION);
      NameAndVersionSupport other = serializeDeserialize(test, NameAndVersionSupport.class);
      assertEquals(test, other);
   }
View Full Code Here

      assertEquals(test, other);
   }
  
   protected void testEquals(String name1, Object version1, String name2, Object version2, boolean result)
   {
      NameAndVersionSupport test1 = new NameAndVersionSupport(name1, version1);
      NameAndVersionSupport test2 = new NameAndVersionSupport(name2, version2);
      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.NameAndVersionSupport

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.