1 package org.apache.maven.surefire.report;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 public class ThreadLocalRunListener implements RunListener
27 {
28 private final InheritableThreadLocal target = new InheritableThreadLocal();
29
30 private final ReporterFactory reporterFactory;
31
32
33 public RunListener getTarget()
34 {
35 Object o = target.get();
36 if (o == null){
37 o = reporterFactory.createReporter();
38 target.set(o);
39 }
40 return (RunListener) o;
41 }
42
43 public ThreadLocalRunListener(ReporterFactory reporterFactory)
44 {
45 this.reporterFactory = reporterFactory;
46 }
47
48 public void testSetStarting( ReportEntry report )
49 {
50 getTarget().testSetStarting( report );
51 }
52
53 public void testSetCompleted( ReportEntry report )
54 {
55 getTarget().testSetCompleted( report );
56 }
57
58 public void testStarting( ReportEntry report )
59 {
60 getTarget().testStarting( report );
61 }
62
63 public void testSucceeded( ReportEntry report )
64 {
65 getTarget().testSucceeded( report );
66 }
67
68 public void testAssumptionFailure( ReportEntry report )
69 {
70 getTarget().testAssumptionFailure( report );
71 }
72
73 public void testError( ReportEntry report )
74 {
75 getTarget().testError( report );
76 }
77
78 public void testFailed( ReportEntry report )
79 {
80 getTarget().testFailed( report );
81 }
82
83 public void testSkipped( ReportEntry report )
84 {
85 getTarget().testSkipped( report );
86 }
87
88 }