@@ -65,7 +65,7 @@ public class Parameters {
65
65
+--------------+--------------+---------+--------+----------+-------------+
66
66
| Annotation | ITestContext | XmlTest | Method | Object[] | ITestResult |
67
67
+--------------+--------------+---------+--------+----------+-------------+
68
- | BeforeSuite | Yes | Yes | No | No | No |
68
+ | BeforeSuite | No | No | No | No | No |
69
69
+--------------+--------------+---------+--------+----------+-------------+
70
70
| BeforeTest | Yes | Yes | No | No | No |
71
71
+--------------+--------------+---------+--------+----------+-------------+
@@ -75,7 +75,7 @@ public class Parameters {
75
75
+--------------+--------------+---------+--------+----------+-------------+
76
76
| BeforeMethod | Yes | Yes | Yes | Yes | Yes |
77
77
+--------------+--------------+---------+--------+----------+-------------+
78
- | AfterSuite | Yes | Yes | No | No | No |
78
+ | AfterSuite | No | No | No | No | No |
79
79
+--------------+--------------+---------+--------+----------+-------------+
80
80
| AfterTest | Yes | Yes | No | No | No |
81
81
+--------------+--------------+---------+--------+----------+-------------+
@@ -96,8 +96,8 @@ public class Parameters {
96
96
List <Class <?>> beforeAfterMethod =
97
97
Arrays .asList (
98
98
ITestContext .class , XmlTest .class , Method .class , Object [].class , ITestResult .class );
99
- mapping .put (BeforeSuite .class .getSimpleName (), ctxTest );
100
- mapping .put (AfterSuite .class .getSimpleName (), ctxTest );
99
+ mapping .put (BeforeSuite .class .getSimpleName (), Collections . emptyList () );
100
+ mapping .put (AfterSuite .class .getSimpleName (), Collections . emptyList () );
101
101
102
102
mapping .put (BeforeTest .class .getSimpleName (), ctxTest );
103
103
mapping .put (AfterTest .class .getSimpleName (), ctxTest );
@@ -417,13 +417,22 @@ private static void checkParameterTypes(
417
417
}
418
418
String errPrefix ;
419
419
if (mapping .containsKey (methodAnnotation )) {
420
- errPrefix =
421
- "Can inject only one of "
422
- + prettyFormat (mapping .get (methodAnnotation ))
423
- + " into a "
424
- + annotation
425
- + " annotated "
426
- + methodName ;
420
+ boolean nativeInjectionUnsupported = mapping .get (methodAnnotation ).isEmpty ();
421
+ if (nativeInjectionUnsupported ) {
422
+ errPrefix =
423
+ "Native Injection is NOT supported for @"
424
+ + methodAnnotation
425
+ + " annotated "
426
+ + methodName ;
427
+ } else {
428
+ errPrefix =
429
+ "Can inject only one of "
430
+ + prettyFormat (mapping .get (methodAnnotation ))
431
+ + " into a "
432
+ + annotation
433
+ + " annotated "
434
+ + methodName ;
435
+ }
427
436
} else {
428
437
errPrefix =
429
438
"Cannot inject "
0 commit comments