@Test public void testConsoleErrorLog1() throws IOException { Stream out = Stream.newStream(); LegacyMasterProcessChannelEncoder encoder = new LegacyMasterProcessChannelEncoder( newBufferedChannel( out ) ); Exception e = new Exception( "msg" ); encoder.consoleErrorLog( e ); String stackTrace = ConsoleLoggerUtils.toString( e ); ByteArrayOutputStream expectedFrame = new ByteArrayOutputStream(); expectedFrame.write( ":maven-surefire-event:\u0011:console-error-log:\u0005:UTF-8:".getBytes( UTF_8 ) ); expectedFrame.write( 0 ); expectedFrame.write( 0 ); expectedFrame.write( 0 ); expectedFrame.write( 3 ); expectedFrame.write( ':' ); expectedFrame.write( "msg".getBytes( UTF_8 ) ); expectedFrame.write( ':' ); expectedFrame.write( 0 ); expectedFrame.write( 0 ); expectedFrame.write( 0 ); expectedFrame.write( 1 ); expectedFrame.write( ':' ); expectedFrame.write( 0 ); expectedFrame.write( ':' ); byte[] stackTraceBytes = stackTrace.getBytes( UTF_8 ); int[] stackTraceLength = toBytes( stackTraceBytes.length ); expectedFrame.write( stackTraceLength[0] ); expectedFrame.write( stackTraceLength[1] ); expectedFrame.write( stackTraceLength[2] ); expectedFrame.write( stackTraceLength[3] ); expectedFrame.write( ':' ); expectedFrame.write( stackTraceBytes ); expectedFrame.write( ':' ); assertThat( out.toByteArray() ) .isEqualTo( expectedFrame.toByteArray() ); }
@Override public void consoleErrorLog( String message ) { consoleErrorLog( message, null ); }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void consoleErrorLog( String message ) { consoleErrorLog( message, null ); } }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void consoleErrorLog( String message ) { consoleErrorLog( message, null ); } LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out ); protected  LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out, @Nonnull RunMode runMode ); }
LegacyMasterProcessChannelEncoder implements MasterProcessChannelEncoder { @Override public void consoleErrorLog( String message ) { consoleErrorLog( message, null ); } 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 consoleErrorLog( String message ) { consoleErrorLog( message, null ); } 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 );  }