Class ClassLoaderTestSupport

  • All Implemented Interfaces:
    TestSupport

    public class ClassLoaderTestSupport
    extends java.lang.Object
    implements TestSupport
    ClassLoader TestSupport.
    Author:
    Daniel Sagenschneider
    • 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 new ClassLoader.
        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 new ClassLoader.
        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 interface TestSupport
        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 this ClassLoader will be different to the current ClassLoader. This is to allow testing multiple ClassLoader environments (such as Eclipse plug-ins).

        Returns:
        New ClassLoader.