Package org.jboss.classloader.test.support

Examples of org.jboss.classloader.test.support.MockClassLoaderPolicy


   }
  
   public void testGetResourcesWithDotFromDelegateNotFound() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");
      policy.setPackageNames(new String[] { "com.acme.p1" } );

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(policy)));
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResourcesFail("testResource.xml", classLoader);
View Full Code Here


   }
  
   public void testGetResourcesUsingAllImports() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");
      policy.setPackageNames(new String[] { "com.acme.p1" } );

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setImportAll(true);
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResources("com/acme/p1/testResource", classLoader, "a/");
View Full Code Here

   }
  
   public void testGetResourcesFromDefaultPackageUsingAllImports() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("");
      policy.setPackageNames(new String[] { "" } );

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setImportAll(true);
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResources("testResource", classLoader, "a/");
View Full Code Here

   }
  
   public void testGetResourcesNotFound() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");
      policy.setPackageNames(new String[] { "com.acme.p1" } );

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResourcesFail("com/acme/p1/testResource", classLoader);
View Full Code Here

  
   public void testGetResourcesFromParentBefore() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent");
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");
      policy.setPackageNames(new String[] { "com.acme.p1" } );
      system.registerClassLoaderPolicy(parent, policy);

      ClassLoaderDomain child = system.createAndRegisterDomain("child", ParentPolicy.BEFORE, parent);
      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setPrefix("b/");
      policy2.setPath("com/acme/p1");
      ClassLoader classLoader = system.registerClassLoaderPolicy(child, policy2);
     
      assertGetResources("com/acme/p1/testResource", classLoader, "a/", "b/");
   }
View Full Code Here

  
   public void testGetResourcesFromParentAfter() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent");
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");
      policy.setPackageNames(new String[] { "com.acme.p1" } );
      system.registerClassLoaderPolicy(parent, policy);

      ClassLoaderDomain child = system.createAndRegisterDomain("child", ParentPolicy.AFTER, parent);
      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setPrefix("b/");
      policy2.setPath("com/acme/p1");
      ClassLoader classLoader = system.registerClassLoaderPolicy(child, policy2);
     
      assertGetResources("com/acme/p1/testResource", classLoader, "a/", "b/");
   }
View Full Code Here

  
   public void testGetResourcesFromDefaultPackageFromParent() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent");
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("");
      policy.setPackageNames(new String[] { "" } );
      system.registerClassLoaderPolicy(parent, policy);

      ClassLoaderDomain child = system.createAndRegisterDomain("child", ParentPolicy.BEFORE, parent);
      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setPrefix("b/");
      policy2.setPath("");
      ClassLoader classLoader = system.registerClassLoaderPolicy(child, policy2);
     
      assertGetResources("testResource", classLoader, "a/", "b/");
   }
View Full Code Here

   public void testNoParentLoadsFromJBossClassLoadersClassLoader() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", ParentPolicy.BEFORE, null);
     
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
     
      assertLoadClass(Object.class, classLoader, null, true);
      assertPackage(ClassLoaderDomain.class, classLoader);
      assertLoadClass(ClassLoaderDomain.class, classLoader, null, true);
View Full Code Here

   public void testBefore() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", ParentPolicy.BEFORE, null);
     
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPathsAndPackageNames(ClassLoaderDomain.class);
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
     
      assertLoadClass(Object.class, classLoader, null, true);
      assertLoadClass(ClassLoaderDomain.class, classLoader, null, true);
      assertPackage(ClassLoaderDomain.class, classLoader);
View Full Code Here

   public void testBeforeButJavaOnly() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", ParentPolicy.BEFORE_BUT_JAVA_ONLY, null);
     
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPathsAndPackageNames(ClassLoaderDomain.class);
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
     
      assertLoadClass(Object.class, classLoader, null, true);
      assertLoadClass(ClassLoaderDomain.class, classLoader);
      assertPackage(ClassLoaderDomain.class, classLoader, policy);
View Full Code Here

TOP

Related Classes of org.jboss.classloader.test.support.MockClassLoaderPolicy

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.