Search in sources :

Example 1 with PowerMockRunner

use of org.powermock.modules.junit4.PowerMockRunner in project powermock by powermock.

the class GitHub352Test method testCountShouldBe3WhenRunWithPowerMockRunner.

@Test
public void testCountShouldBe3WhenRunWithPowerMockRunner() {
    JUnitCore jUnitCore = new JUnitCore();
    Request request = new Request() {

        @Override
        public Runner getRunner() {
            try {
                return new PowerMockRunner(MyTest.class);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    };
    Result result = jUnitCore.run(request);
    int testCount = result.getRunCount();
    assertThat(testCount).describedAs("Test count not match to expected.", 3).isEqualTo(3);
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Request(org.junit.runner.Request) PowerMockRunner(org.powermock.modules.junit4.PowerMockRunner) Result(org.junit.runner.Result) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 JUnitCore (org.junit.runner.JUnitCore)1 Request (org.junit.runner.Request)1 Result (org.junit.runner.Result)1 PowerMockRunner (org.powermock.modules.junit4.PowerMockRunner)1