Class PowerMockJUnit44RunnerDelegateImpl
- java.lang.Object
-
- org.junit.runner.Runner
-
- org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
-
- All Implemented Interfaces:
org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Sortable,PowerMockJUnitRunnerDelegate
- Direct Known Subclasses:
PowerMockJUnit47RunnerDelegateImpl
public class PowerMockJUnit44RunnerDelegateImpl extends org.junit.runner.Runner implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable, 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 fromJUnit4ClassRunnerused 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.- See Also:
JUnit4ClassRunner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunner
-
Constructor Summary
Constructors Constructor Description PowerMockJUnit44RunnerDelegateImpl(Class<?> klass)PowerMockJUnit44RunnerDelegateImpl(Class<?> klass, String[] methodsToRun)PowerMockJUnit44RunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Annotation[]classAnnotations()protected PowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunnercreatePowerMockRunner(Object testInstance, org.junit.internal.runners.TestMethod testMethod, org.junit.runner.notification.RunNotifier notifier, org.junit.runner.Description description, boolean extendsFromTestCase)protected ObjectcreateTest()voidfilter(org.junit.runner.manipulation.Filter filter)org.junit.runner.DescriptiongetDescription()protected StringgetName()Class<?>getTestClass()intgetTestCount()protected List<Method>getTestMethods(Class<?> klass, String[] methodsToRun)protected org.junit.internal.runners.TestClassgetTestWrappedClass()protected voidinvokeTestMethod(Method method, org.junit.runner.notification.RunNotifier notifier)protected org.junit.runner.DescriptionmethodDescription(Method method)voidrun(org.junit.runner.notification.RunNotifier notifier)protected voidrunMethods(org.junit.runner.notification.RunNotifier notifier)voidsort(org.junit.runner.manipulation.Sorter sorter)protected Annotation[]testAnnotations(Method method)protected StringtestName(Method method)protected voidvalidate()protected org.junit.internal.runners.TestMethodwrapMethod(Method method)
-
-
-
Constructor Detail
-
PowerMockJUnit44RunnerDelegateImpl
public PowerMockJUnit44RunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners) throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError
-
PowerMockJUnit44RunnerDelegateImpl
public PowerMockJUnit44RunnerDelegateImpl(Class<?> klass, String[] methodsToRun) throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError
-
PowerMockJUnit44RunnerDelegateImpl
public PowerMockJUnit44RunnerDelegateImpl(Class<?> klass) throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError
-
-
Method Detail
-
validate
protected final void validate() throws org.junit.internal.runners.InitializationError- Throws:
org.junit.internal.runners.InitializationError
-
run
public void run(org.junit.runner.notification.RunNotifier notifier)
- Specified by:
runin interfacePowerMockJUnitRunnerDelegate- Specified by:
runin classorg.junit.runner.Runner
-
runMethods
protected void runMethods(org.junit.runner.notification.RunNotifier notifier)
-
getDescription
public org.junit.runner.Description getDescription()
- Specified by:
getDescriptionin interfaceorg.junit.runner.Describable- Specified by:
getDescriptionin interfacePowerMockJUnitRunnerDelegate- Specified by:
getDescriptionin classorg.junit.runner.Runner
-
classAnnotations
protected Annotation[] classAnnotations()
-
getName
protected String getName()
-
invokeTestMethod
protected void invokeTestMethod(Method method, org.junit.runner.notification.RunNotifier notifier)
-
createPowerMockRunner
protected PowerMockJUnit44RunnerDelegateImpl.PowerMockJUnit44MethodRunner createPowerMockRunner(Object testInstance, org.junit.internal.runners.TestMethod testMethod, org.junit.runner.notification.RunNotifier notifier, org.junit.runner.Description description, boolean extendsFromTestCase)
-
wrapMethod
protected org.junit.internal.runners.TestMethod wrapMethod(Method method)
-
methodDescription
protected org.junit.runner.Description methodDescription(Method method)
-
testAnnotations
protected Annotation[] testAnnotations(Method method)
-
filter
public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException- Specified by:
filterin interfaceorg.junit.runner.manipulation.Filterable- Throws:
org.junit.runner.manipulation.NoTestsRemainException
-
sort
public void sort(org.junit.runner.manipulation.Sorter sorter)
- Specified by:
sortin interfaceorg.junit.runner.manipulation.Sortable
-
getTestWrappedClass
protected org.junit.internal.runners.TestClass getTestWrappedClass()
-
getTestCount
public int getTestCount()
- Specified by:
getTestCountin interfacePowerMockJUnitRunnerDelegate
-
getTestClass
public Class<?> getTestClass()
- Specified by:
getTestClassin interfacePowerMockJUnitRunnerDelegate
-
-