1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.booter;
20
21 import javax.annotation.Nonnull;
22
23 import java.io.File;
24
25 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
26 import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
27 import org.apache.maven.surefire.api.booter.DumpErrorSingleton;
28 import org.apache.maven.surefire.api.fork.ForkNodeArguments;
29
30
31
32
33 public final class ForkedNodeArg implements ForkNodeArguments {
34 private final int forkChannelId;
35 private final ConsoleLogger logger;
36 private final boolean isDebug;
37
38 public ForkedNodeArg(int forkChannelId, boolean isDebug) {
39 this.forkChannelId = forkChannelId;
40 logger = new NullConsoleLogger();
41 this.isDebug = isDebug;
42 }
43
44 @Nonnull
45 @Override
46 public String getSessionId() {
47 throw new UnsupportedOperationException();
48 }
49
50 @Override
51 public int getForkChannelId() {
52 return forkChannelId;
53 }
54
55 @Override
56 @Nonnull
57 public File dumpStreamText(@Nonnull String text) {
58 return DumpErrorSingleton.getSingleton().dumpStreamText(text);
59 }
60
61 @Nonnull
62 @Override
63 public File dumpStreamException(@Nonnull Throwable t) {
64 return DumpErrorSingleton.getSingleton().dumpStreamException(t, t.getLocalizedMessage());
65 }
66
67 @Override
68 public void logWarningAtEnd(@Nonnull String text) {
69
70 }
71
72 @Nonnull
73 @Override
74 public ConsoleLogger getConsoleLogger() {
75 return logger;
76 }
77
78 @Nonnull
79 @Override
80 public Object getConsoleLock() {
81 return logger;
82 }
83
84 @Override
85 public File getEventStreamBinaryFile() {
86 throw new UnsupportedOperationException();
87 }
88
89 @Override
90 public File getCommandStreamBinaryFile() {
91 return isDebug ? DumpErrorSingleton.getSingleton().getCommandStreamBinaryFile() : null;
92 }
93 }