Package org.jboss.test.classloader.system.support

Examples of org.jboss.test.classloader.system.support.MockClassLoaderSystem


      assertEmpty(domain.removed);
   }
  
   public void testRegisterClassLoaderConstructDomainWithParentDomain() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      ClassLoader cl1 = createAndRegisterMockClassLoader(system, "test", ParentPolicy.AFTER, ClassLoaderSystem.DEFAULT_DOMAIN_NAME, "mock");
      MockClassLoaderDomain domain = (MockClassLoaderDomain) system.getDomain("test");
      MockClassLoaderDomain parent = (MockClassLoaderDomain) system.getDomain(ClassLoaderSystem.DEFAULT_DOMAIN_NAME);
      assertEquals(ParentPolicy.AFTER, domain.getParentPolicy());
      assertEquals(parent, domain.getParent());
     
      List<ClassLoader> expected = new ArrayList<ClassLoader>();
      expected.add(cl1);
View Full Code Here


      assertEmpty(domain.removed);
   }
  
   public void testRegisterClassLoaderConstructDomainWithParentDomainAlreadyExists() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderDomain domain = new MockClassLoaderDomain("test");
      system.registerDomain(domain);
      ClassLoader cl1 = createAndRegisterMockClassLoader(system, "test", ParentPolicy.AFTER, ClassLoaderSystem.DEFAULT_DOMAIN_NAME, "mock");
     
      List<ClassLoader> expected = new ArrayList<ClassLoader>();
      expected.add(cl1);
     
View Full Code Here

      assertEmpty(domain.removed);
   }
  
   public void testRegisterClassLoaderConstructDomainWithParentPolicyAlreadyExists() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderDomain domain = new MockClassLoaderDomain("test");
      system.registerDomain(domain);
      ClassLoader cl1 = createAndRegisterMockClassLoader(system, "test", ParentPolicy.AFTER, "mock");
     
      List<ClassLoader> expected = new ArrayList<ClassLoader>();
      expected.add(cl1);
     
View Full Code Here

      assertEmpty(domain.removed);
   }
  
   public void testRegisterClassLoaderConstructDomainAlreadyExists() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderDomain domain = new MockClassLoaderDomain("test");
      system.registerDomain(domain);
      ClassLoader cl1 = createAndRegisterMockClassLoader(system, "test", "mock");
     
      List<ClassLoader> expected = new ArrayList<ClassLoader>();
      expected.add(cl1);
     
View Full Code Here

      assertEmpty(domain.removed);
   }

   public void testRegisterNullClassLoaderPolicyDefaultDomain()
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      try
      {
         system.registerClassLoaderPolicy(null);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here

      }
   }

   public void testRegisterNullClassLoaderPolicyExplicitDomain()
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderDomain domain = new MockClassLoaderDomain();
      system.registerDomain(domain);
      try
      {
         system.registerClassLoaderPolicy(domain, null);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here

      }
   }

   public void testRegisterClassLoaderPolicyNullDomain()
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      try
      {
         system.registerClassLoaderPolicy((ClassLoaderDomain) null, policy);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here

      }
   }

   public void testRegisterClassLoaderPolicyWithNotRegisteredDomain()
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      MockClassLoaderDomain domain = new MockClassLoaderDomain();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      try
      {
         system.registerClassLoaderPolicy(domain, policy);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
View Full Code Here

      assertTrue("Should be the same instance", instance == instance2);
   }
  
   public void testClassLoaderPolicyShutdownFromClassLoaderSystemShutdown() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      SimpleMockClassLoaderPolicy policy = new SimpleMockClassLoaderPolicy();
      MockClassLoaderDomain domain = system.createAndRegisterDomain("mock");
      system.registerClassLoaderPolicy(domain, policy);

      assertFalse(policy.shutdown);
      system.shutdown();
      assertTrue("Policy should be shutdown", policy.shutdown);
   }
View Full Code Here

      assertTrue("Policy should be shutdown", policy.shutdown);
   }
  
   public void testClassLoaderPolicyShutdownFromClassLoaderDomainUnregister() throws Exception
   {
      MockClassLoaderSystem system = createMockClassLoaderSystem();
      SimpleMockClassLoaderPolicy policy = new SimpleMockClassLoaderPolicy();
      MockClassLoaderDomain domain = system.createAndRegisterDomain("mock");
      system.registerClassLoaderPolicy(domain, policy);

      assertFalse(policy.shutdown);
      system.unregisterDomain(domain);
      assertTrue("Policy should be shutdown", policy.shutdown);
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.classloader.system.support.MockClassLoaderSystem

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.