@Override public void runTest() throws IOException { ByteArrayOutputStream goodBytes = new ByteArrayOutputStream(); ByteArrayOutputStream badBytes = new ByteArrayOutputStream(); PrintStream oldOut = System.out; PrintStream oldErr = System.err; try (PrintStream out = new PrintStream(goodBytes); PrintStream err = new PrintStream(badBytes); ) { System.setOut(out); System.setErr(err); NTriple.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131", "-E","-b",base,fileName},this,null); } finally { System.setErr(oldErr); System.setOut(oldOut); } InputStream good = new ByteArrayInputStream(goodBytes.toByteArray()); InputStream bad = new ByteArrayInputStream(badBytes.toByteArray()); compare(good,goodTriples); compare(bad,badTriples); }
@Override public void runTest() throws IOException { ByteArrayOutputStream goodBytes = new ByteArrayOutputStream(); ByteArrayOutputStream badBytes = new ByteArrayOutputStream(); PrintStream oldOut = System.out; PrintStream oldErr = System.err; try (PrintStream out = new PrintStream(goodBytes); PrintStream err = new PrintStream(badBytes); ) { System.setOut(out); System.setErr(err); NTriple.mainEh(new String[]{"-e","102,136,105,103,108,107,116,106,004,131", "-E","-b",base,fileName},this,null); } finally { System.setErr(oldErr); System.setOut(oldOut); } InputStream good = new ByteArrayInputStream(goodBytes.toByteArray()); InputStream bad = new ByteArrayInputStream(badBytes.toByteArray()); compare(good,goodTriples); compare(bad,badTriples); }