Class PowerMockJUnit4MethodValidator
java.lang.Object
org.junit.internal.runners.MethodValidator
org.powermock.modules.junit4.internal.impl.testcaseworkaround.PowerMockJUnit4MethodValidator
public class PowerMockJUnit4MethodValidator
extends org.junit.internal.runners.MethodValidator
A custom
MethodValidator
that makes sure that test methods not
annotated by the Test annotation works in JUnit 4.4 with the custom
JUnit-runner when the test class is extending TestCase
. This is
actually a workaround for JUnit 4.4 when the test case extends from the
TestCase
class.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPowerMockJUnit4MethodValidator
(org.junit.internal.runners.TestClass testClass) -
Method Summary
Modifier and TypeMethodDescriptiongetTestMethods
(org.junit.internal.runners.TestClass testClass, Class<?> classUnderTest) getTestMethodsWithNoAnnotation
(Class<?> testClass) void
private void
validateTestMethods
(Class<? extends Annotation> annotation, boolean isStatic) This is a rip-off of theMethodValidator.validateInstanceMethods()
with the exception that this method also searches for test methods if the class extendsTestCase
and has methods that starts with test which are not annotated.Methods inherited from class org.junit.internal.runners.MethodValidator
assertValid, validateMethodsForDefaultRunner, validateNoArgConstructor, validateStaticMethods
-
Field Details
-
TEST_CLASS_FIELD
-
CLASS_UNDER_TEST_FIELD
-
ERRORS_FIELD
-
-
Constructor Details
-
PowerMockJUnit4MethodValidator
public PowerMockJUnit4MethodValidator(org.junit.internal.runners.TestClass testClass)
-
-
Method Details
-
validateInstanceMethods
public void validateInstanceMethods()- Overrides:
validateInstanceMethods
in classorg.junit.internal.runners.MethodValidator
-
getTestMethods
-
validateTestMethods
This is a rip-off of theMethodValidator.validateInstanceMethods()
with the exception that this method also searches for test methods if the class extendsTestCase
and has methods that starts with test which are not annotated. -
getTestMethodsWithNoAnnotation
-