Package org.jboss.classloader.spi

Examples of org.jboss.classloader.spi.ClassLoaderSystem


      }
   }

   public void testDefaultDomain() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      assertTrue(system.isRegistered(ClassLoaderSystem.DEFAULT_DOMAIN_NAME));
      ClassLoaderDomain domain = system.getDefaultDomain();
      assertNotNull(domain);
      assertEquals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME, domain.getName());
      assertTrue(system.isRegistered(ClassLoaderSystem.DEFAULT_DOMAIN_NAME));
      assertTrue(system.isDomainRegistered(domain));
   }
View Full Code Here


      assertTrue(system.isDomainRegistered(domain));
   }
  
   public void testRegisterDomain() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();

      assertFalse(system.isRegistered("mock"));
      MockClassLoaderDomain domain = new MockClassLoaderDomain("mock");
      assertFalse(system.isDomainRegistered(domain));
     
      system.registerDomain(domain);
      assertTrue(system.isRegistered("mock"));
      assertTrue(system.isDomainRegistered(domain));
   }
View Full Code Here

      assertTrue(system.isDomainRegistered(domain));
   }
  
   public void testRegisterDomains() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();

      assertFalse(system.isRegistered("a"));
      MockClassLoaderDomain a = new MockClassLoaderDomain("a");
      assertFalse(system.isDomainRegistered(a));

      assertFalse(system.isRegistered("b"));
      MockClassLoaderDomain b = new MockClassLoaderDomain("b");
      assertFalse(system.isDomainRegistered(a));
     
      system.registerDomain(a);
      system.registerDomain(b);
     
      assertTrue(system.isRegistered("a"));
      assertTrue(system.isDomainRegistered(a));
      assertTrue(system.isRegistered("b"));
      assertTrue(system.isDomainRegistered(b));
   }
View Full Code Here

      assertTrue(system.isDomainRegistered(b));
   }
  
   public void testRegisterNullDomain() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
     
      try
      {
         system.registerDomain(null);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here

      }
   }
  
   public void testRegisterDefaultDomain() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();

      MockClassLoaderDomain domain = new MockClassLoaderDomain(ClassLoaderSystem.DEFAULT_DOMAIN_NAME);
      try
      {
         system.registerDomain(domain);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
View Full Code Here

      }
   }
  
   public void testRegisterDuplicateDomain() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();

      assertFalse(system.isRegistered("a"));
      MockClassLoaderDomain a = new MockClassLoaderDomain("a");
      assertFalse(system.isDomainRegistered(a));
     
      system.registerDomain(a);
     
      assertTrue(system.isRegistered("a"));
      assertTrue(system.isDomainRegistered(a));
     
      try
      {
         system.registerDomain(a);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
View Full Code Here

      super(name);
   }

   public void testInterruptThread() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPaths(Support.class);
      final ClassLoader cl = system.registerClassLoaderPolicy(policy);

      // Set our interrupted flag
      getLog().debug("Setting interrupt flag");
      Thread.currentThread().interrupt();
      try
View Full Code Here

      }
   }
  
   public void testLoadingArrayClass() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPaths(Support.class);
      ClassLoader cl = system.registerClassLoaderPolicy(policy);

      assertLoadClass("[Ljava.lang.String;", cl, null);
      assertLoadClass("[L" + Support.class.getName() + ";", cl);
      assertLoadClass("[[L" + Support.class.getName() + ";", cl);
   }
View Full Code Here

      }
   }
  
   public void testRegisterDuplicateDomainName() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();

      assertFalse(system.isRegistered("a"));
      MockClassLoaderDomain a = new MockClassLoaderDomain("a");
      assertFalse(system.isDomainRegistered(a));

      MockClassLoaderDomain b = new MockClassLoaderDomain("a");
     
      system.registerDomain(a);
     
      assertTrue(system.isRegistered("a"));
      assertTrue(system.isDomainRegistered(a));
     
      try
      {
         system.registerDomain(b);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
View Full Code Here

      super(name);
   }
  
   public void testHierarchyBefore() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
      ClassLoaderDomain child = system.createAndRegisterDomain("child", ParentPolicy.BEFORE, parent);
     
      MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
      parentPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
      ClassLoader parentClassLoader = system.registerClassLoaderPolicy(parent, parentPolicy);
     
      MockClassLoaderPolicy childPolicy = createMockClassLoaderPolicy();
      childPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
      ClassLoader classLoader = system.registerClassLoaderPolicy(child, childPolicy);
     
      assertLoadClass(MockLoader.class, classLoader, parentClassLoader);
   }
View Full Code Here

TOP

Related Classes of org.jboss.classloader.spi.ClassLoaderSystem

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.