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
ClassLoaderTestSupport.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLASS_LOADER_EXTRA_CLASS_NAMEClassname of the extra class for the newClassLoader.static java.lang.StringCLASS_LOADER_EXTRA_PACKAGE_NAMEPackagename 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.ClassLoadercreateNewClassLoader()Creates a newClassLoaderfrom current process's java class path.voidinit(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
Packagename 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
Classname 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.ExceptionDescription copied from interface:TestSupportIntialise.- Specified by:
initin interfaceTestSupport- Parameters:
context-ExtensionContext.- Throws:
java.lang.Exception- If fails to init.
-
createNewClassLoader
public java.lang.ClassLoader createNewClassLoader()
Creates a new
ClassLoaderfrom current process's java class path.Classinstances loaded via thisClassLoaderwill be different to the currentClassLoader. This is to allow testing multipleClassLoaderenvironments (such as Eclipse plug-ins).- Returns:
- New
ClassLoader.
-
-