Package net.officefloor.frame.test
Class ClassLoaderTestSupport
java.lang.Object
net.officefloor.frame.test.ClassLoaderTestSupport
- All Implemented Interfaces:
TestSupport
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClassname of the extra class for the newClassLoader.static final StringPackagename of the extra class for the newClassLoader. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ClassLoaderTestSupport(FileTestSupport fileTestSupport) Initialise. -
Method Summary
Modifier and TypeMethodDescriptionCreates a newClassLoaderfrom current process's java class path.voidinit(org.junit.jupiter.api.extension.ExtensionContext context) Intialise.
-
Field Details
-
CLASS_LOADER_EXTRA_PACKAGE_NAME
Packagename of the extra class for the newClassLoader.- See Also:
-
CLASS_LOADER_EXTRA_CLASS_NAME
Classname of the extra class for the newClassLoader.- See Also:
-
-
Constructor Details
-
ClassLoaderTestSupport
Initialise.- Parameters:
fileTestSupport-FileTestSupport.
-
ClassLoaderTestSupport
public ClassLoaderTestSupport()Default constructor.
-
-
Method Details
-
init
Description copied from interface:TestSupportIntialise.- Specified by:
initin interfaceTestSupport- Parameters:
context-ExtensionContext.- Throws:
Exception- If fails to init.
-
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.
-