Class TestClassInstanceFactory

java.lang.Object
org.powermock.modules.testng.internal.TestClassInstanceFactory

class TestClassInstanceFactory extends Object
  • Field Details

    • constructor

      private final Constructor constructor
    • testClass

      private final Class<?> testClass
    • params

      private final Object[] params
    • mockLoader

      private final ClassLoader mockLoader
  • Constructor Details

  • Method Details

    • create

      Object create()
    • initializeMockPolicy

      private void initializeMockPolicy()
    • createTestClass

      private Class<?> createTestClass(Class<?> actualTestClass) throws Exception
      We proxy the test class in order to be able to clear state after each test method invocation. It would be much better to be able to register a testng listener programmtically but I cannot find a way to do so.
      Throws:
      Exception
    • createProxyTestClass

      private Class<?> createProxyTestClass(Class<?> testClassLoadedByMockedClassLoader) throws Exception
      Throws:
      Exception
    • setInvocationHandler

      private void setInvocationHandler(Object testInstance) throws Exception
      Throws:
      Exception
    • extendsPowerMockTestCase

      private boolean extendsPowerMockTestCase(Class<?> actualTestClass)