Package org.powermock.modules.testng
Class PowerMockTestCase
- java.lang.Object
-
- org.powermock.modules.testng.PowerMockTestCase
-
public class PowerMockTestCase extends Object
A PowerMock base class that may be used as a base class for all TestNG test cases that uses PowerMock.
-
-
Constructor Summary
Constructors Constructor Description PowerMockTestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterPowerMockTestClass()protected voidafterPowerMockTestMethod()Must be executed after each test method.protected voidbeforePowerMockTestClass()protected voidbeforePowerMockTestMethod()Must be executed before each test method.org.testng.IObjectFactorycreate(org.testng.ITestContext context)
-
-
-
Method Detail
-
beforePowerMockTestClass
@BeforeClass protected void beforePowerMockTestClass() throws Exception- Throws:
Exception
-
afterPowerMockTestClass
@AfterClass protected void afterPowerMockTestClass() throws Exception- Throws:
Exception
-
beforePowerMockTestMethod
@BeforeMethod protected void beforePowerMockTestMethod() throws ExceptionMust be executed before each test method. This method does the following:- Injects all mock fields (if they haven't been injected already)
- Throws:
Exception- If something unexpected goes wrong.
-
afterPowerMockTestMethod
@AfterMethod protected void afterPowerMockTestMethod() throws ExceptionMust 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.IObjectFactory create(org.testng.ITestContext context)
- Returns:
- The PowerMock object factory.
-
-