public class PowerMockJUnit44RunnerDelegateImpl
extends org.junit.runner.Runner
implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable, org.powermock.modules.junit4.common.internal.PowerMockJUnitRunnerDelegate
A JUnit4 test runner that only runs a specified set of test methods in a test class.
Many parts of this class are essentially a rip off from
JUnit4ClassRunner
used in JUnit 4.4. It does however not extend this
class because we cannot let it perform the stuff it does in its constructor.
Another thing that different is that if an exception is thrown in the test we
add a tip to error message asking the user if they've not forgot to add a
class to test. Yet another difference is that this runner notifies the
PowerMock listeners of certain events.
JUnit4ClassRunner
Modifier and Type | Class and Description |
---|---|
protected class |
PowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunner |
Constructor and Description |
---|
PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass) |
PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass,
java.lang.String[] methodsToRun) |
PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass,
java.lang.String[] methodsToRun,
org.powermock.core.spi.PowerMockTestListener[] listeners) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.annotation.Annotation[] |
classAnnotations() |
protected PowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunner |
createPowerMockRunner(java.lang.Object testInstance,
org.junit.internal.runners.TestMethod testMethod,
org.junit.runner.notification.RunNotifier notifier,
org.junit.runner.Description description,
boolean extendsFromTestCase) |
protected java.lang.Object |
createTest() |
void |
filter(org.junit.runner.manipulation.Filter filter) |
org.junit.runner.Description |
getDescription() |
protected java.lang.String |
getName() |
java.lang.Class<?> |
getTestClass() |
int |
getTestCount() |
protected java.util.List<java.lang.reflect.Method> |
getTestMethods(java.lang.Class<?> klass,
java.lang.String[] methodsToRun) |
protected org.junit.internal.runners.TestClass |
getTestWrappedClass() |
protected void |
invokeTestMethod(java.lang.reflect.Method method,
org.junit.runner.notification.RunNotifier notifier) |
protected org.junit.runner.Description |
methodDescription(java.lang.reflect.Method method) |
void |
run(org.junit.runner.notification.RunNotifier notifier) |
protected void |
runMethods(org.junit.runner.notification.RunNotifier notifier) |
void |
sort(org.junit.runner.manipulation.Sorter sorter) |
protected java.lang.annotation.Annotation[] |
testAnnotations(java.lang.reflect.Method method) |
protected java.lang.String |
testName(java.lang.reflect.Method method) |
protected void |
validate() |
protected org.junit.internal.runners.TestMethod |
wrapMethod(java.lang.reflect.Method method) |
public PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass, java.lang.String[] methodsToRun, org.powermock.core.spi.PowerMockTestListener[] listeners) throws org.junit.internal.runners.InitializationError
org.junit.internal.runners.InitializationError
public PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass, java.lang.String[] methodsToRun) throws org.junit.internal.runners.InitializationError
org.junit.internal.runners.InitializationError
public PowerMockJUnit44RunnerDelegateImpl(java.lang.Class<?> klass) throws org.junit.internal.runners.InitializationError
org.junit.internal.runners.InitializationError
protected final java.util.List<java.lang.reflect.Method> getTestMethods(java.lang.Class<?> klass, java.lang.String[] methodsToRun)
protected final void validate() throws org.junit.internal.runners.InitializationError
org.junit.internal.runners.InitializationError
public void run(org.junit.runner.notification.RunNotifier notifier)
run
in interface org.powermock.modules.junit4.common.internal.PowerMockJUnitRunnerDelegate
run
in class org.junit.runner.Runner
protected void runMethods(org.junit.runner.notification.RunNotifier notifier)
public org.junit.runner.Description getDescription()
getDescription
in interface org.junit.runner.Describable
getDescription
in interface org.powermock.modules.junit4.common.internal.PowerMockJUnitRunnerDelegate
getDescription
in class org.junit.runner.Runner
protected java.lang.annotation.Annotation[] classAnnotations()
protected java.lang.String getName()
protected java.lang.Object createTest() throws java.lang.Exception
java.lang.Exception
protected void invokeTestMethod(java.lang.reflect.Method method, org.junit.runner.notification.RunNotifier notifier)
protected PowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunner createPowerMockRunner(java.lang.Object testInstance, org.junit.internal.runners.TestMethod testMethod, org.junit.runner.notification.RunNotifier notifier, org.junit.runner.Description description, boolean extendsFromTestCase)
protected org.junit.internal.runners.TestMethod wrapMethod(java.lang.reflect.Method method)
protected java.lang.String testName(java.lang.reflect.Method method)
protected org.junit.runner.Description methodDescription(java.lang.reflect.Method method)
protected java.lang.annotation.Annotation[] testAnnotations(java.lang.reflect.Method method)
public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException
filter
in interface org.junit.runner.manipulation.Filterable
org.junit.runner.manipulation.NoTestsRemainException
public void sort(org.junit.runner.manipulation.Sorter sorter)
sort
in interface org.junit.runner.manipulation.Sortable
protected org.junit.internal.runners.TestClass getTestWrappedClass()
public int getTestCount()
getTestCount
in interface org.powermock.modules.junit4.common.internal.PowerMockJUnitRunnerDelegate
public java.lang.Class<?> getTestClass()
getTestClass
in interface org.powermock.modules.junit4.common.internal.PowerMockJUnitRunnerDelegate