public class PowerMockJUnit4MethodValidator
extends org.junit.internal.runners.MethodValidator
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.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CLASS_UNDER_TEST_FIELD |
private static java.lang.String |
ERRORS_FIELD |
private static java.lang.String |
TEST_CLASS_FIELD |
Constructor and Description |
---|
PowerMockJUnit4MethodValidator(org.junit.internal.runners.TestClass testClass) |
Modifier and Type | Method and Description |
---|---|
private java.util.List<java.lang.reflect.Method> |
getTestMethods(org.junit.internal.runners.TestClass testClass,
java.lang.Class<?> classUnderTest) |
private java.util.List<java.lang.reflect.Method> |
getTestMethodsWithNoAnnotation(java.lang.Class<?> testClass) |
void |
validateInstanceMethods() |
private void |
validateTestMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
boolean isStatic)
This is a rip-off of the
MethodValidator.validateInstanceMethods() with the exception that
this method also searches for test methods if the class extends
TestCase and has methods that starts with test which are not
annotated. |
private static final java.lang.String TEST_CLASS_FIELD
private static final java.lang.String CLASS_UNDER_TEST_FIELD
private static final java.lang.String ERRORS_FIELD
public PowerMockJUnit4MethodValidator(org.junit.internal.runners.TestClass testClass)
public void validateInstanceMethods()
validateInstanceMethods
in class org.junit.internal.runners.MethodValidator
private java.util.List<java.lang.reflect.Method> getTestMethods(org.junit.internal.runners.TestClass testClass, java.lang.Class<?> classUnderTest)
private void validateTestMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, boolean isStatic)
MethodValidator.validateInstanceMethods()
with the exception that
this method also searches for test methods if the class extends
TestCase
and has methods that starts with test which are not
annotated.private java.util.List<java.lang.reflect.Method> getTestMethodsWithNoAnnotation(java.lang.Class<?> testClass)