Examples of ModuleCapability


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

  
   public void testCreateModuleNoVersion() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      Capability test = factory.createModule("test");
      assertEquals(new ModuleCapability("test"), test);
   }
View Full Code Here

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

  
   public void testCreateModuleVersioned() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      Capability test = factory.createModule("test", "1.0.0");
      assertEquals(new ModuleCapability("test", "1.0.0"), test);
   }
View Full Code Here

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

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

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

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

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

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

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

      }
   }
  
   public void testSetVersion() throws Exception
   {
      ModuleCapability test = new ModuleCapability();
      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

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

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

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

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

Examples of org.jboss.deployers.structure.spi.classloading.ModuleCapability

   {
      if (obj == this)
         return true;
      if (obj == null || obj instanceof ModuleCapability == false)
         return false;
      ModuleCapability other = (ModuleCapability) obj;
      if (getName().equals(other.getName()) == false)
         return false;
      return getVersion().equals(other.getVersion());
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.classloading.ModuleCapability

/*     */   {
/*  99 */     if (obj == this)
/* 100 */       return true;
/* 101 */     if ((obj == null) || (!(obj instanceof ModuleCapability)))
/* 102 */       return false;
/* 103 */     ModuleCapability other = (ModuleCapability)obj;
/* 104 */     if (!getName().equals(other.getName()))
/* 105 */       return false;
/* 106 */     return getVersion().equals(other.getVersion());
/*     */   }
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.