Class PowerMockTestCase
java.lang.Object
org.powermock.modules.testng.PowerMockTestCase
A PowerMock base class that may be used as a base class for all TestNG
test cases that uses PowerMock.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidMust be executed after each test method.protected voidprotected voidMust be executed before each test method.private voidorg.testng.ITestObjectFactorycreate(org.testng.ITestContext context) private voidprivate boolean
-
Field Details
-
annotationEnabler
-
previousCl
-
-
Constructor Details
-
PowerMockTestCase
public PowerMockTestCase()
-
-
Method Details
-
beforePowerMockTestClass
-
afterPowerMockTestClass
-
beforePowerMockTestMethod
-
afterPowerMockTestMethod
Must be executed after each test method. This method does the following:- Clear all injection fields (those annotated with a Mock annotation)
- Clears the PowerMock MockRepository
- Throws:
Exception- if something unexpected goes wrong.
-
create
public org.testng.ITestObjectFactory create(org.testng.ITestContext context) - Parameters:
context- the test context.- Returns:
- The PowerMock object factory.
-
clearMockFields
-
injectMocks
-
isLoadedByPowerMockClassloader
private boolean isLoadedByPowerMockClassloader()
-