@Test public void testStdErrStream() throws IOException { Stream out = Stream.newStream(); WritableBufferedByteChannel channel = newBufferedChannel( out ); LegacyMasterProcessChannelEncoder encoder = new LegacyMasterProcessChannelEncoder( channel ); encoder.stdErr( "msg", false ); channel.close(); String expected = ":maven-surefire-event:\u000e:std-err-stream:" + (char) 10 + ":normal-run:\u0005:UTF-8:\u0000\u0000\u0000\u0003:msg:"; assertThat( new String( out.toByteArray(), UTF_8 ) ) .isEqualTo( expected ); }
@Override public void stdErr( String msg, boolean newLine ) { ForkedProcessEventType event = newLine ? BOOTERCODE_STDERR_NEW_LINE : BOOTERCODE_STDERR; setOutErr( event, msg ); }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void stdErr( String msg, boolean newLine ) { ForkedProcessEventType event = newLine ? BOOTERCODE_STDERR_NEW_LINE : BOOTERCODE_STDERR; setOutErr( event, msg ); } }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void stdErr( String msg, boolean newLine ) { ForkedProcessEventType event = newLine ? BOOTERCODE_STDERR_NEW_LINE : BOOTERCODE_STDERR; setOutErr( event, msg ); } LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out ); protected  LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out, @Nonnull RunMode runMode ); }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void stdErr( String msg, boolean newLine ) { ForkedProcessEventType event = newLine ? BOOTERCODE_STDERR_NEW_LINE : BOOTERCODE_STDERR; setOutErr( event, msg ); } LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out ); protected  LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out, @Nonnull RunMode runMode ); @Override MasterProcessChannelEncoder asRerunMode(); @Override MasterProcessChannelEncoder asNormalMode(); @Override boolean checkError(); @Override void onJvmExit(); @Override void sendSystemProperties( Map<String, String> sysProps ); @Override void testSetStarting( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSetCompleted( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testStarting( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSucceeded( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testFailed( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSkipped( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testError( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testAssumptionFailure( ReportEntry reportEntry, boolean trimStackTraces ); @Override void stdOut( String msg, boolean newLine ); @Override void stdErr( String msg, boolean newLine ); @Override void consoleInfoLog( String message ); @Override void consoleErrorLog( String message ); @Override void consoleErrorLog( Throwable t ); @Override void consoleErrorLog( String message, Throwable t ); @Override void consoleErrorLog( StackTraceWriter stackTraceWriter, boolean trimStackTraces ); @Override void consoleDebugLog( String message ); @Override void consoleWarningLog( String message ); @Override void bye(); @Override void stopOnNextTest(); @Override void acquireNextTest(); @Override void sendExitError( StackTraceWriter stackTraceWriter, boolean trimStackTraces ); }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void stdErr( String msg, boolean newLine ) { ForkedProcessEventType event = newLine ? BOOTERCODE_STDERR_NEW_LINE : BOOTERCODE_STDERR; setOutErr( event, msg ); } LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out ); protected  LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out, @Nonnull RunMode runMode ); @Override MasterProcessChannelEncoder asRerunMode(); @Override MasterProcessChannelEncoder asNormalMode(); @Override boolean checkError(); @Override void onJvmExit(); @Override void sendSystemProperties( Map<String, String> sysProps ); @Override void testSetStarting( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSetCompleted( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testStarting( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSucceeded( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testFailed( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testSkipped( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testError( ReportEntry reportEntry, boolean trimStackTraces ); @Override void testAssumptionFailure( ReportEntry reportEntry, boolean trimStackTraces ); @Override void stdOut( String msg, boolean newLine ); @Override void stdErr( String msg, boolean newLine ); @Override void consoleInfoLog( String message ); @Override void consoleErrorLog( String message ); @Override void consoleErrorLog( Throwable t ); @Override void consoleErrorLog( String message, Throwable t ); @Override void consoleErrorLog( StackTraceWriter stackTraceWriter, boolean trimStackTraces ); @Override void consoleDebugLog( String message ); @Override void consoleWarningLog( String message ); @Override void bye(); @Override void stopOnNextTest(); @Override void acquireNextTest(); @Override void sendExitError( StackTraceWriter stackTraceWriter, boolean trimStackTraces );  }