CollectorOutputProcessor implements OutputProcessor<byte[], byte[]> { @Override public byte[] processStdErr(InputStream stdErrInputStream) throws ProcessException { return _collect(stdErrInputStream); }  @Override byte[] processStdErr(InputStream stdErrInputStream); @Override byte[] processStdOut(InputStream stdOutInputStream); static final OutputProcessor<byte[], byte[]> INSTANCE; }
@Test public void testCollectSuccess() throws ProcessException { CollectorOutputProcessor collectorOutputProcessor = new CollectorOutputProcessor(); Random random = new Random(); byte[] stdErrData = new byte[1024]; random.nextBytes(stdErrData); Assert.assertArrayEquals( stdErrData, collectorOutputProcessor.processStdErr( new UnsyncByteArrayInputStream(stdErrData))); byte[] stdOutData = new byte[1024]; random.nextBytes(stdOutData); Assert.assertArrayEquals( stdOutData, collectorOutputProcessor.processStdErr( new UnsyncByteArrayInputStream(stdOutData))); }