Package net.officefloor.frame.test
Class ClassLoaderTestSupport
- java.lang.Object
-
- net.officefloor.frame.test.ClassLoaderTestSupport
-
- All Implemented Interfaces:
TestSupport
public class ClassLoaderTestSupport extends java.lang.Object implements TestSupport
ClassLoader
TestSupport
.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLASS_LOADER_EXTRA_CLASS_NAME
Class
name of the extra class for the newClassLoader
.static java.lang.String
CLASS_LOADER_EXTRA_PACKAGE_NAME
Package
name of the extra class for the newClassLoader
.
-
Constructor Summary
Constructors Constructor Description ClassLoaderTestSupport()
ClassLoaderTestSupport(FileTestSupport fileTestSupport)
Initialise.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoader
createNewClassLoader()
Creates a newClassLoader
from current process's java class path.void
init(org.junit.jupiter.api.extension.ExtensionContext context)
Intialise.
-
-
-
Field Detail
-
CLASS_LOADER_EXTRA_PACKAGE_NAME
public static final java.lang.String CLASS_LOADER_EXTRA_PACKAGE_NAME
Package
name of the extra class for the newClassLoader
.- See Also:
- Constant Field Values
-
CLASS_LOADER_EXTRA_CLASS_NAME
public static final java.lang.String CLASS_LOADER_EXTRA_CLASS_NAME
Class
name of the extra class for the newClassLoader
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClassLoaderTestSupport
public ClassLoaderTestSupport(FileTestSupport fileTestSupport)
Initialise.- Parameters:
fileTestSupport
-FileTestSupport
.
-
ClassLoaderTestSupport
public ClassLoaderTestSupport()
-
-
Method Detail
-
init
public void init(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
Description copied from interface:TestSupport
Intialise.- Specified by:
init
in interfaceTestSupport
- Parameters:
context
-ExtensionContext
.- Throws:
java.lang.Exception
- If fails to init.
-
createNewClassLoader
public java.lang.ClassLoader createNewClassLoader()
Creates a new
ClassLoader
from current process's java class path.Class
instances loaded via thisClassLoader
will be different to the currentClassLoader
. This is to allow testing multipleClassLoader
environments (such as Eclipse plug-ins).- Returns:
- New
ClassLoader
.
-
-