DiffProducer { public void doUnifiedDiff(final OutputStream output) throws IOException { doDiff(output, QDiffUniGenerator.TYPE); } DiffProducer(final InputStream left, final InputStream right, final String encoding);  DiffProducer(final InputStream left, final InputStream right, final String encoding, final Map generatorProperties); void doNormalDiff(final OutputStream output); void doUnifiedDiff(final OutputStream output);  }
@Test public void testDoUnifiedDiffNoGutter() throws Exception { final String leftString = "[.ShellClassInfo]" + NL + "IconIndex=-238" + NL + "[DeleteOnCopy]" + NL + "Owner=Jesper" + NL + "Owner=Patrik&Jesper" + NL + "Personalized=14" + NL + "PersonalizedName=Mina videoklipp" + NL; final String rightString = "[.ShellClassInfo]" + NL + "IconIndex=-2388" + NL + "[DeleteOnCopy]" + NL + "Owner=Jesper" + NL + "Owner=Patrik&Jesper" + NL + "Personalized=14" + NL + "PersonalizedName=Mina videoklipp" + NL + "OneMore=true" + NL + "OneMore=1" + NL + "OneMore=2" + NL + "OneMore=3" + NL + NL; final String result = "@@ -2 +2 @@" + NL + "-IconIndex=-238" + NL + "+IconIndex=-2388" + NL + "@@ -8 +8,5 @@" + NL + "+OneMore=true" + NL + "+OneMore=1" + NL + "+OneMore=2" + NL + "+OneMore=3" + NL + "+" + NL; final InputStream left = IOUtils.toInputStream(leftString); final InputStream right = IOUtils.toInputStream(rightString); final Map props = new HashMap(); props.put(QDiffGeneratorFactory.GUTTER_PROPERTY, 0); final DiffProducer diffProducer = new DiffProducer(left, right, null, props); final OutputStream output = new ByteArrayOutputStream(); diffProducer.doUnifiedDiff(output); assertEquals(result, output.toString()); }