1 package org.apache.maven.surefire.api.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
27 public final class TestOutputReportEntry implements OutputReportEntry
28 {
29 private final String log;
30 private final boolean isStdOut;
31 private final boolean newLine;
32 private final RunMode runMode;
33 private final Long testRunId;
34
35
36
37
38
39
40
41
42
43
44 public TestOutputReportEntry( String log, boolean isStdOut, boolean newLine, RunMode runMode, Long testRunId )
45 {
46 this.log = log;
47 this.isStdOut = isStdOut;
48 this.newLine = newLine;
49 this.runMode = runMode;
50 this.testRunId = testRunId;
51 }
52
53
54
55
56
57
58
59
60 private TestOutputReportEntry( String log, boolean isStdOut, boolean newLine )
61 {
62 this( log, isStdOut, newLine, null, null );
63 }
64
65 public TestOutputReportEntry( OutputReportEntry reportEntry, RunMode runMode, Long testRunId )
66 {
67 log = reportEntry.getLog();
68 isStdOut = reportEntry.isStdOut();
69 newLine = reportEntry.isNewLine();
70 this.runMode = runMode;
71 this.testRunId = testRunId;
72 }
73
74 @Override
75 public String getLog()
76 {
77 return log;
78 }
79
80 @Override
81 public boolean isStdOut()
82 {
83 return isStdOut;
84 }
85
86 @Override
87 public boolean isNewLine()
88 {
89 return newLine;
90 }
91
92 public RunMode getRunMode()
93 {
94 return runMode;
95 }
96
97 public Long getTestRunId()
98 {
99 return testRunId;
100 }
101
102 public static OutputReportEntry stdOut( String log )
103 {
104 return new TestOutputReportEntry( log, true, false );
105 }
106
107 public static TestOutputReportEntry stdOutln( String log )
108 {
109 return new TestOutputReportEntry( log, true, true );
110 }
111
112 public static TestOutputReportEntry stdErr( String log )
113 {
114 return new TestOutputReportEntry( log, false, false );
115 }
116
117 public static TestOutputReportEntry stdErrln( String log )
118 {
119 return new TestOutputReportEntry( log, false, true );
120 }
121 }