Class PowerMockObjectFactory

java.lang.Object
org.powermock.modules.testng.PowerMockObjectFactory
All Implemented Interfaces:
org.testng.IObjectFactory, org.testng.ITestObjectFactory

public class PowerMockObjectFactory extends Object implements org.testng.IObjectFactory
The PowerMock object factory. If the test class or any public method declared in the test class is annotated with PrepareForTest or SuppressStaticInitializationFor the PowerMock classloader will enable the class for PowerMock testing, otherwise a standard ObjectFactory is used.
  • Field Details

    • powerMockObjectFactory

      private PowerMockClassloaderObjectFactory powerMockObjectFactory
    • defaultObjectFactory

      private org.testng.internal.ObjectFactoryImpl defaultObjectFactory
  • Constructor Details

    • PowerMockObjectFactory

      public PowerMockObjectFactory()
  • Method Details

    • newInstance

      public Object newInstance(Constructor constructor, Object... params)
      Specified by:
      newInstance in interface org.testng.IObjectFactory
    • hasPowerMockAnnotation

      private boolean hasPowerMockAnnotation(Class<?> testClass)
    • anyMethodInClassHasPowerMockAnnotation

      private boolean anyMethodInClassHasPowerMockAnnotation(Class<?> testClass)
    • isClassAnnotatedWithPowerMockAnnotation

      private boolean isClassAnnotatedWithPowerMockAnnotation(Class<?> testClass)