Class JUnitClassloaderRunner.SeparateClassLoaderInvokeMethod

  • Enclosing class:
    JUnitClassloaderRunner

    private class JUnitClassloaderRunner.SeparateClassLoaderInvokeMethod
    extends org.junit.internal.runners.statements.InvokeMethod
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean dumpHeapOnError
      Automatically generate a heap dump of classloader could not be garbage collected?
      private boolean expectedLeak
      Is the test method expeced to leak?
      private boolean haltBeforeError
      Should the thread pause for a couple of seconds before throwing the test failed error? Set this to true to allow some time to aquire a heap dump to track down leaks.
      private java.lang.String[] ignoredPackages
      Packages to be ignored by RedefiningClassLoader.
      private java.lang.reflect.Method originalMethod
      The method to run for triggering potential leak, or verify non-leak
      private java.lang.Class<? extends java.lang.Runnable> preventorClass
      Class that can be used to remove the leak
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void evaluate()  
      private void performErrorActions​(java.lang.String testName)
      Call only if there is a leak
      • Methods inherited from class java.lang.Object

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

      • originalMethod

        private final java.lang.reflect.Method originalMethod
        The method to run for triggering potential leak, or verify non-leak
      • expectedLeak

        private final boolean expectedLeak
        Is the test method expeced to leak?
      • haltBeforeError

        private final boolean haltBeforeError
        Should the thread pause for a couple of seconds before throwing the test failed error? Set this to true to allow some time to aquire a heap dump to track down leaks.
      • dumpHeapOnError

        private final boolean dumpHeapOnError
        Automatically generate a heap dump of classloader could not be garbage collected?
      • preventorClass

        private java.lang.Class<? extends java.lang.Runnable> preventorClass
        Class that can be used to remove the leak
      • ignoredPackages

        private final java.lang.String[] ignoredPackages
        Packages to be ignored by RedefiningClassLoader. If null, will use defaults.
    • Constructor Detail

      • SeparateClassLoaderInvokeMethod

        private SeparateClassLoaderInvokeMethod​(org.junit.runners.model.FrameworkMethod testMethod,
                                                java.lang.Object target)
      • SeparateClassLoaderInvokeMethod

        private SeparateClassLoaderInvokeMethod​(org.junit.runners.model.FrameworkMethod testMethod,
                                                java.lang.Object target,
                                                java.lang.Class<? extends java.lang.Runnable> preventorClass,
                                                PackagesLoadedOutsideClassLoader packagesLoadedOutsideClassLoader)
    • Method Detail

      • evaluate

        public void evaluate()
                      throws java.lang.Throwable
        Overrides:
        evaluate in class org.junit.internal.runners.statements.InvokeMethod
        Throws:
        java.lang.Throwable
      • performErrorActions

        private void performErrorActions​(java.lang.String testName)
                                  throws java.lang.InterruptedException
        Call only if there is a leak
        Throws:
        java.lang.InterruptedException