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.MethodValidatorA customMethodValidatorthat 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 extendingTestCase. This is actually a workaround for JUnit 4.4 when the test case extends from theTestCaseclass.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCLASS_UNDER_TEST_FIELDprivate static java.lang.StringERRORS_FIELDprivate static java.lang.StringTEST_CLASS_FIELD
-
Constructor Summary
Constructors Constructor Description PowerMockJUnit4MethodValidator(org.junit.internal.runners.TestClass testClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)voidvalidateInstanceMethods()private voidvalidateTestMethods(java.lang.Class<? extends java.lang.annotation.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 extendsTestCaseand has methods that starts with test which are not annotated.
-
-
-
Method Detail
-
validateInstanceMethods
public void validateInstanceMethods()
- Overrides:
validateInstanceMethodsin classorg.junit.internal.runners.MethodValidator
-
getTestMethods
private java.util.List<java.lang.reflect.Method> getTestMethods(org.junit.internal.runners.TestClass testClass, java.lang.Class<?> classUnderTest)
-
validateTestMethods
private void validateTestMethods(java.lang.Class<? extends java.lang.annotation.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 extendsTestCaseand has methods that starts with test which are not annotated.
-
getTestMethodsWithNoAnnotation
private java.util.List<java.lang.reflect.Method> getTestMethodsWithNoAnnotation(java.lang.Class<?> testClass)
-
-