Class SeparateClassloaderTestRunner

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

    public class SeparateClassloaderTestRunner
    extends org.junit.runners.BlockJUnit4ClassRunner
    This class is used when it's required to load jgit classes in separate classloader for each test class. It can be needed to isolate static field initialization between separate tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      SeparateClassloaderTestRunner​(java.lang.Class<?> klass)
      Creates a SeparateClassloaderTestRunner to run klass.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.Class<?> loadNewClass​(java.lang.Class<?> klass)  
      • Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

        collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
      • Methods inherited from class org.junit.runners.ParentRunner

        childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
      • Methods inherited from class org.junit.runner.Runner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SeparateClassloaderTestRunner

        public SeparateClassloaderTestRunner​(java.lang.Class<?> klass)
                                      throws org.junit.runners.model.InitializationError
        Creates a SeparateClassloaderTestRunner to run klass.
        Parameters:
        klass - test class to run.
        Throws:
        org.junit.runners.model.InitializationError - if the test class is malformed or can't be found.
    • Method Detail

      • loadNewClass

        private static java.lang.Class<?> loadNewClass​(java.lang.Class<?> klass)
                                                throws org.junit.runners.model.InitializationError
        Throws:
        org.junit.runners.model.InitializationError