@SuppressForbidden("legitimate sysstreams.") public class SlaveMainSafe { public static void main(String[] args) {
@SuppressForbidden("Legitimate use of syserr.") private void flushStreams() { System.out.flush(); System.err.flush(); } };
@SuppressForbidden("legitimate sysstreams.") public class SlaveMainSafe { public static void main(String[] args) {
@SuppressForbidden("legitimate sysstreams.") @Override protected void before() { System.out.flush(); System.err.flush(); } }
@SuppressForbidden("legitimate sysstreams.") @Override protected void before() { System.out.flush(); System.err.flush(); } }
@SuppressForbidden("Legitimate use of syserr.") private void flushStreams() { System.out.flush(); System.err.flush(); } };
@SuppressForbidden("legitimate sysstreams.") public class DumpStreamsFromEventStream { public static void main(String[] args) throws Exception {
@SuppressForbidden("legitimate sysstreams.") public class DumpStreamsFromEventStream { public static void main(String[] args) throws Exception {
@SuppressForbidden("Legitimate use of syserr.") public void run() { try { rmDir(globalTempDir); } catch (IOException e) { // Not much else to do but to log and quit. System.err.println("Could not delete temporary folder: " + globalTempDir.toAbsolutePath() + ". Cause: "); e.printStackTrace(System.err); } } });
@SuppressForbidden("Legitimate use of syserr.") public void run() { try { rmDir(globalTempDir); } catch (IOException e) { // Not much else to do but to log and quit. System.err.println("Could not delete temporary folder: " + globalTempDir.toAbsolutePath() + ". Cause: "); e.printStackTrace(System.err); } } });
@SuppressForbidden("legitimate sysstreams.") private static void redirectStreams(final Serializer serializer, final boolean flushFrequently) { final PrintStream origSysOut = System.out;
@SuppressForbidden("legitimate sysstreams.") private static void redirectStreams(final Serializer serializer, final boolean flushFrequently) { final PrintStream origSysOut = System.out;
@SuppressForbidden("Permitted sysout.") @Override protected void before() throws Throwable { // Make sure -ea matches -Dtests.asserts. boolean assertsEnabled = targetClass.desiredAssertionStatus(); if (assertsEnabled != TEST_ASSERTS_ENABLED) { String msg = "Assertion state mismatch on " + targetClass.getSimpleName() + ": "; if (assertsEnabled) { msg += "-ea was specified"; } else { msg += "-ea was not specified"; } msg += " but -Dtests.asserts=" + TEST_ASSERTS_ENABLED; System.err.println(msg); throw new Exception(msg); } } }
@SuppressForbidden("Permitted sysout.") @Override protected void before() throws Throwable { // Make sure -ea matches -Dtests.asserts. boolean assertsEnabled = targetClass.desiredAssertionStatus(); if (assertsEnabled != TEST_ASSERTS_ENABLED) { String msg = "Assertion state mismatch on " + targetClass.getSimpleName() + ": "; if (assertsEnabled) { msg += "-ea was specified"; } else { msg += "-ea was not specified"; } msg += " but -Dtests.asserts=" + TEST_ASSERTS_ENABLED; System.err.println(msg); throw new Exception(msg); } } }
@SuppressForbidden("legitimate PrintStream with default charset.") @Override public Void run() { System.setOut(new PrintStream(new BufferedOutputStream(new ChunkedStream() { @Override public void write(byte[] b, int off, int len) throws IOException { if (multiplexStdStreams) { origSysOut.write(b, off, len); } serializer.serialize(new AppendStdOutEvent(b, off, len)); if (flushFrequently) serializer.flush(); } }))); System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() { @Override public void write(byte[] b, int off, int len) throws IOException { if (multiplexStdStreams) { origSysErr.write(b, off, len); } serializer.serialize(new AppendStdErrEvent(b, off, len)); if (flushFrequently) serializer.flush(); } }))); return null; } });
@SuppressForbidden("legitimate PrintStream with default charset.") @Override public Void run() { System.setOut(new PrintStream(new BufferedOutputStream(new ChunkedStream() { @Override public void write(byte[] b, int off, int len) throws IOException { if (multiplexStdStreams) { origSysOut.write(b, off, len); } serializer.serialize(new AppendStdOutEvent(b, off, len)); if (flushFrequently) serializer.flush(); } }))); System.setErr(new PrintStream(new BufferedOutputStream(new ChunkedStream() { @Override public void write(byte[] b, int off, int len) throws IOException { if (multiplexStdStreams) { origSysErr.write(b, off, len); } serializer.serialize(new AppendStdErrEvent(b, off, len)); if (flushFrequently) serializer.flush(); } }))); return null; } });
@SuppressForbidden("legitimate sysstreams.") public static void warn(String message, Throwable t) { PrintStream w = (warnings == null ? System.err : warnings);
@SuppressForbidden("legitimate sysstreams.") public static void warn(String message, Throwable t) { PrintStream w = (warnings == null ? System.err : warnings);
@SuppressForbidden("legitimate sysstreams.") public void setOuter(JUnit4 task) { this.seed = task.getSeed();
@SuppressForbidden("legitimate sysstreams.") public void setOuter(JUnit4 task) { this.seed = task.getSeed();