org.jboss.classloader.test.support
Class IsolatedClassLoaderTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jboss.test.AbstractTestCase
              extended by org.jboss.test.AbstractTestCaseWithSetup
                  extended by org.jboss.classloader.test.support.IsolatedClassLoaderTest
All Implemented Interfaces:
junit.framework.Test

public abstract class IsolatedClassLoaderTest
extends org.jboss.test.AbstractTestCaseWithSetup

IsolatedClassLoaderTest.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Constructor Summary
IsolatedClassLoaderTest(String name)
          Create a new IsolatedClassLoaderTest.
 
Method Summary
protected static ClassLoader createClassLoader(String name, boolean importAll, String... packages)
          Create a classloader It exports everything
protected static ClassLoader createClassLoader(String name, String... packages)
          Create a classloader It exports everything It imports everything
static ClassLoaderSystem getClassLoaderSystem()
          Get the classloader system, this will be configured with a domain called TEST that includes the test case's classloader
static org.jboss.test.AbstractTestDelegate getDelegate(Class<?> clazz)
          Get the delegate
protected  void setUp()
           
static junit.framework.Test suite(Class<?> clazz)
          Create a test with just test's package visible and the default parent packages It imports nothing
static junit.framework.Test suite(Class<?> clazz, boolean importAll)
          Create a test with just test's package visible and the default parent packages It exports everything
static junit.framework.Test suite(Class<?> clazz, boolean importAll, Class<?>... packages)
          Create a test with test's package visible and the packages of the classes listed It exports everything
static junit.framework.Test suite(Class<?> clazz, Class<?>... packages)
          Create a test with test's package visible and the packages of the classes listed with the default parent packages It exports everything It imports nothing
protected static void unregisterClassLoader(ClassLoader classLoader)
          Unregister a classloader
 
Methods inherited from class org.jboss.test.AbstractTestCaseWithSetup
enableTrace, getDelegate, getLog, resumeSecurity, suite, suspendSecurity, tearDown
 
Methods inherited from class org.jboss.test.AbstractTestCase
assertEmpty, assertEmpty, assertEmpty, assertEquals, assertEquals, assertEquals, assertEquals, assertInstanceOf, assertInstanceOf, checkDeepThrowable, checkDeepThrowableRethrow, checkThrowable, checkThrowableRethrow, configureLogging, deserialize, failure, findResource, getResource, serialize, serializeDeserialize
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsolatedClassLoaderTest

public IsolatedClassLoaderTest(String name)
Create a new IsolatedClassLoaderTest.

Parameters:
name - the test name
Method Detail

getDelegate

public static org.jboss.test.AbstractTestDelegate getDelegate(Class<?> clazz)
Get the delegate

Parameters:
clazz - the test class
Returns:
the delegate

suite

public static junit.framework.Test suite(Class<?> clazz)
Create a test with just test's package visible and the default parent packages It imports nothing

Parameters:
clazz - the test class
Returns:
the test

suite

public static junit.framework.Test suite(Class<?> clazz,
                                         boolean importAll)
Create a test with just test's package visible and the default parent packages It exports everything

Parameters:
clazz - the test class
importAll - whether to import all
Returns:
the test

suite

public static junit.framework.Test suite(Class<?> clazz,
                                         Class<?>... packages)
Create a test with test's package visible and the packages of the classes listed with the default parent packages It exports everything It imports nothing

Parameters:
clazz - the test class
packages - the classes in packages that should also be included
Returns:
the test

suite

public static junit.framework.Test suite(Class<?> clazz,
                                         boolean importAll,
                                         Class<?>... packages)
Create a test with test's package visible and the packages of the classes listed It exports everything

Parameters:
clazz - the test class
importAll - whether to import all
packages - the classes in packages that should also be included
Returns:
the test

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class org.jboss.test.AbstractTestCaseWithSetup
Throws:
Exception

getClassLoaderSystem

public static ClassLoaderSystem getClassLoaderSystem()
Get the classloader system, this will be configured with a domain called TEST that includes the test case's classloader

Returns:
the classloader

createClassLoader

protected static ClassLoader createClassLoader(String name,
                                               String... packages)
                                        throws Exception
Create a classloader It exports everything It imports everything

Parameters:
name - the name
packages - the packages
Returns:
the classloader
Throws:
Exception - for any error

createClassLoader

protected static ClassLoader createClassLoader(String name,
                                               boolean importAll,
                                               String... packages)
                                        throws Exception
Create a classloader It exports everything

Parameters:
name - the name
importAll - whether to import all
packages - the packages
Returns:
the classloader
Throws:
Exception - for any error

unregisterClassLoader

protected static void unregisterClassLoader(ClassLoader classLoader)
                                     throws Exception
Unregister a classloader

Parameters:
classLoader - the classloader
Throws:
Exception - for any error


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.