@Override protected PowerMockJUnit47MethodRunner createPowerMockRunner( final Object testInstance, final TestMethod testMethod, RunNotifier notifier, Description description, final boolean extendsFromTestCase ) { return new PowerMockJUnit49MethodRunner( testInstance, testMethod, notifier, description, extendsFromTestCase ); }
protected PowerMockJUnit49MethodRunner( Object testInstance, TestMethod method, RunNotifier notifier, Description description, boolean extendsFromTestCase ) { super( testInstance, method, notifier, description, extendsFromTestCase ); this.description = description; }
/** * Since a JUnit 4.7 rule may potentially deal with "unexpected" * exceptions we cannot handle the exception before the rule has been * completely evaluated. Thus we just store the exception here and * rethrow it after the test method has finished executing. In that way * the rule may get a chance to handle the exception appropriately. */ @Override protected void handleException(TestMethod testMethod, Throwable actualFailure) { if (hasRules) { potentialTestFailure = actualFailure; } else { super.handleException(testMethod, actualFailure); } }
@Override protected PowerMockJUnit44MethodRunner createPowerMockRunner(final Object testInstance, final TestMethod testMethod, RunNotifier notifier, Description description, final boolean extendsFromTestCase) { return new PowerMockJUnit47MethodRunner(testInstance, testMethod, notifier, description, extendsFromTestCase); }
protected PowerMockJUnit47MethodRunner(Object testInstance, TestMethod method, RunNotifier notifier, Description description, boolean extendsFromTestCase) { super(testInstance, method, notifier, description, extendsFromTestCase); }