1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.api.report;
20
21
22
23
24
25
26 public final class TestOutputReportEntry implements OutputReportEntry {
27 private final String log;
28 private final boolean isStdOut;
29 private final boolean newLine;
30 private final RunMode runMode;
31 private final Long testRunId;
32
33
34
35
36
37
38
39
40
41
42 public TestOutputReportEntry(String log, boolean isStdOut, boolean newLine, RunMode runMode, Long testRunId) {
43 this.log = log;
44 this.isStdOut = isStdOut;
45 this.newLine = newLine;
46 this.runMode = runMode;
47 this.testRunId = testRunId;
48 }
49
50
51
52
53
54
55
56
57 private TestOutputReportEntry(String log, boolean isStdOut, boolean newLine) {
58 this(log, isStdOut, newLine, null, null);
59 }
60
61 public TestOutputReportEntry(OutputReportEntry reportEntry, RunMode runMode, Long testRunId) {
62 log = reportEntry.getLog();
63 isStdOut = reportEntry.isStdOut();
64 newLine = reportEntry.isNewLine();
65 this.runMode = runMode;
66 this.testRunId = testRunId;
67 }
68
69 @Override
70 public String getLog() {
71 return log;
72 }
73
74 @Override
75 public boolean isStdOut() {
76 return isStdOut;
77 }
78
79 @Override
80 public boolean isNewLine() {
81 return newLine;
82 }
83
84 public RunMode getRunMode() {
85 return runMode;
86 }
87
88 public Long getTestRunId() {
89 return testRunId;
90 }
91
92 public static OutputReportEntry stdOut(String log) {
93 return new TestOutputReportEntry(log, true, false);
94 }
95
96 public static TestOutputReportEntry stdOutln(String log) {
97 return new TestOutputReportEntry(log, true, true);
98 }
99
100 public static TestOutputReportEntry stdErr(String log) {
101 return new TestOutputReportEntry(log, false, false);
102 }
103
104 public static TestOutputReportEntry stdErrln(String log) {
105 return new TestOutputReportEntry(log, false, true);
106 }
107 }