Class TestRunnerDecorator

java.lang.Object
mockit.integration.TestRunnerDecorator
Direct Known Subclasses:
JMockitExtension, TestNGRunnerDecorator

public class TestRunnerDecorator extends Object
Base class for "test runner decorators", which provide integration between JMockit and specific test runners from JUnit and TestNG.
  • Field Details

    • shouldPrepareForNextTest

      protected volatile boolean shouldPrepareForNextTest
      A "volatile boolean" is as good as a java.util.concurrent.atomic.AtomicBoolean here, since we only need the basic get/set operations.
  • Constructor Details

    • TestRunnerDecorator

      protected TestRunnerDecorator()
  • Method Details

    • updateTestClassState

      protected static void updateTestClassState(@Nullable Object target, @NonNull Class<?> testClass)
    • cleanUpMocksFromPreviousTestClass

      public static void cleanUpMocksFromPreviousTestClass()
    • cleanUpMocksFromPreviousTest

      protected static void cleanUpMocksFromPreviousTest()
    • cleanUpAllMocks

      public static void cleanUpAllMocks()
    • clearFieldTypeRedefinitions

      protected static void clearFieldTypeRedefinitions()
    • prepareForNextTest

      protected static void prepareForNextTest()
    • discardTestLevelMockedTypes

      protected static void discardTestLevelMockedTypes()
    • handleMockFieldsForWholeTestClass

      protected static void handleMockFieldsForWholeTestClass(@NonNull Object target)
    • createInstancesForTestedFieldsFromBaseClasses

      protected static void createInstancesForTestedFieldsFromBaseClasses(@NonNull Object testClassInstance)
    • createInstancesForTestedFieldsBeforeSetup

      protected static void createInstancesForTestedFieldsBeforeSetup(@NonNull Object testClassInstance)
    • createInstancesForTestedFields

      protected static void createInstancesForTestedFields(@NonNull Object testClassInstance)
    • createInstancesForAnnotatedParameters

      @Nullable protected static Object[] createInstancesForAnnotatedParameters(@NonNull Object testClassInstance, @NonNull Method testMethod, @Nullable Object[] parameterValues)
    • concludeTestMethodExecution

      protected static void concludeTestMethodExecution(@NonNull SavePoint savePoint, @Nullable Throwable thrownByTest, boolean thrownAsExpected) throws Throwable
      Throws:
      Throwable
    • clearTestedObjectsIfAny

      protected static void clearTestedObjectsIfAny()
    • clearTestedObjectsCreatedDuringSetup

      protected static void clearTestedObjectsCreatedDuringSetup()