/** * Adds other output streams which should accept server output data. * @param outputStreams is a list of additional {@link OutputStream} * that are ready to accept server output */ public void addOutPutStreams(List<OutputStream> outputStreams) { checkNotNull(outputStreams, "outputStreams parameter is NULL!"); for (OutputStream stream : outputStreams) { addOutPutStream(stream); } }
addOutPutStream(new OutputStream() { StringBuilder lineBuilder = new StringBuilder();
@Test public void checkAbilityToChangeOutputStream() throws Exception { testLogFile = new File("test"); testLogFile.createNewFile(); stream = new FileOutputStream(testLogFile); service = buildDefaultService(); service.addOutPutStream(stream); service.start(); assertThat(testLogFile.length(), greaterThan(0L)); }
@Test public void checkAbilityToChangeOutputStreamAfterTheServiceIsStarted() throws Exception { testLogFile = new File("test"); testLogFile.createNewFile(); stream = new FileOutputStream(testLogFile); service = buildDefaultService(); service.start(); service.addOutPutStream(stream); service.isRunning(); assertThat(testLogFile.length(), greaterThan(0L)); }
/** * Adds other output streams which should accept server output data. * @param outputStreams is a list of additional {@link OutputStream} * that are ready to accept server output */ public void addOutPutStreams(List<OutputStream> outputStreams) { checkNotNull(outputStreams, "outputStreams parameter is NULL!"); for (OutputStream stream : outputStreams) { addOutPutStream(stream); } }
addOutPutStream(new OutputStream() { StringBuilder lineBuilder = new StringBuilder();