File tree 2 files changed +16
-15
lines changed
src/main/java/org/junit/runners
2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1
1
package org .junit .runners ;
2
2
3
+ import java .lang .annotation .Annotation ;
3
4
import java .lang .annotation .ElementType ;
4
5
import java .lang .annotation .Inherited ;
5
6
import java .lang .annotation .Retention ;
@@ -267,6 +268,21 @@ public Parameterized(Class<?> klass) throws Throwable {
267
268
super (klass , RunnersFactory .createRunnersForClass (klass ));
268
269
}
269
270
271
+ @ Override
272
+ protected void collectInitializationErrors (List <Throwable > errors ) {
273
+ super .collectInitializationErrors (errors );
274
+ validatePublicStaticVoidMethods (Parameterized .BeforeParam .class , errors );
275
+ validatePublicStaticVoidMethods (Parameterized .AfterParam .class , errors );
276
+ }
277
+
278
+ private void validatePublicStaticVoidMethods (Class <? extends Annotation > annotation ,
279
+ List <Throwable > errors ) {
280
+ final List <FrameworkMethod > methods = getTestClass ().getAnnotatedMethods (annotation );
281
+ for (FrameworkMethod eachTestMethod : methods ) {
282
+ eachTestMethod .validatePublicVoid (true , errors );
283
+ }
284
+ }
285
+
270
286
private static class RunnersFactory {
271
287
private static final ParametersRunnerFactory DEFAULT_FACTORY = new BlockJUnit4ClassRunnerWithParametersFactory ();
272
288
Original file line number Diff line number Diff line change @@ -96,21 +96,6 @@ protected String testName(FrameworkMethod method) {
96
96
return method .getName () + getName ();
97
97
}
98
98
99
- @ Override
100
- protected void collectInitializationErrors (List <Throwable > errors ) {
101
- super .collectInitializationErrors (errors );
102
- validatePublicStaticVoidMethods (Parameterized .BeforeParam .class , errors );
103
- validatePublicStaticVoidMethods (Parameterized .AfterParam .class , errors );
104
- }
105
-
106
- private void validatePublicStaticVoidMethods (Class <? extends Annotation > annotation ,
107
- List <Throwable > errors ) {
108
- final List <FrameworkMethod > methods = getTestClass ().getAnnotatedMethods (annotation );
109
- for (FrameworkMethod eachTestMethod : methods ) {
110
- eachTestMethod .validatePublicVoid (true , errors );
111
- }
112
- }
113
-
114
99
@ Override
115
100
protected void validateConstructor (List <Throwable > errors ) {
116
101
validateOnlyOneConstructor (errors );
You can’t perform that action at this time.
0 commit comments