1
1
package test .listeners .issue2916 ;
2
2
3
- import java .util .ArrayList ;
4
3
import java .util .List ;
5
4
import org .testng .IDataProviderListener ;
6
5
import org .testng .IDataProviderMethod ;
10
9
11
10
public class DataProviderListenerHolder {
12
11
13
- public static List <String > LOGS = new ArrayList <>();
14
12
private static final String PREFIX = DataProviderListenerHolder .class .getName () + "$" ;
15
13
16
14
public static final String [] EXPECTED_LOGS =
@@ -48,7 +46,7 @@ public abstract static class KungFuWarrior implements IDataProviderListener {
48
46
@ Override
49
47
public void beforeDataProviderExecution (
50
48
IDataProviderMethod dataProviderMethod , ITestNGMethod method , ITestContext iTestContext ) {
51
- LOGS . add (
49
+ LogContainer . instance . log (
52
50
getClass ().getSimpleName ()
53
51
+ ".beforeDataProviderExecution_"
54
52
+ dataProviderMethod .getMethod ().getName ());
@@ -57,15 +55,15 @@ public void beforeDataProviderExecution(
57
55
@ Override
58
56
public void afterDataProviderExecution (
59
57
IDataProviderMethod dataProviderMethod , ITestNGMethod method , ITestContext iTestContext ) {
60
- LOGS . add (
58
+ LogContainer . instance . log (
61
59
getClass ().getSimpleName ()
62
60
+ ".afterDataProviderExecution_"
63
61
+ dataProviderMethod .getMethod ().getName ());
64
62
}
65
63
66
64
@ Override
67
65
public void onDataProviderFailure (ITestNGMethod method , ITestContext ctx , RuntimeException t ) {
68
- LOGS . add (
66
+ LogContainer . instance . log (
69
67
getClass ().getSimpleName ()
70
68
+ ".onDataProviderFailure_"
71
69
+ method .getDataProviderMethod ().getMethod ().getName ());
0 commit comments