org.netbeans.modules.nbjunit/1 1.29

org.netbeans.junit.diff
Class LineDiff

java.lang.Object
  extended byorg.netbeans.junit.diff.LineDiff
All Implemented Interfaces:
Diff

public class LineDiff
extends Object
implements Diff

Slow diff with better user-friendly output format. Compares whole lines. Built on "Weighted matching in graphs".


Constructor Summary
LineDiff()
          Creates a new instance of LineDiff
LineDiff(boolean ignoreCase)
           
LineDiff(boolean ignoreCase, boolean ignoreEmptyLines)
           
 
Method Summary
protected  boolean compareLines(String l1, String l2)
           
 boolean diff(File firstFile, File secondFile, File diffFile)
           
 boolean diff(String first, String second, String diff)
           
 String formatOutput(boolean positive, int lineIndex, String line)
           
 boolean getIgnoreCase()
           
static void main(String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineDiff

public LineDiff()
Creates a new instance of LineDiff


LineDiff

public LineDiff(boolean ignoreCase)

LineDiff

public LineDiff(boolean ignoreCase,
                boolean ignoreEmptyLines)
Method Detail

getIgnoreCase

public boolean getIgnoreCase()

compareLines

protected boolean compareLines(String l1,
                               String l2)
Parameters:
l1 - first line to compare
l2 - second line to compare
Returns:
true if lines equal

diff

public boolean diff(String first,
                    String second,
                    String diff)
             throws IOException
Specified by:
diff in interface Diff
Parameters:
first - first file to compare
second - second file to compare
diff - difference file, caller can pass null value, when results are not needed.
Returns:
true iff files differ
Throws:
IOException

diff

public boolean diff(File firstFile,
                    File secondFile,
                    File diffFile)
             throws IOException
Specified by:
diff in interface Diff
Parameters:
firstFile - first file to compare -- ref
secondFile - second file to compare -- golden
diffFile - difference file, caller can pass null value, when results are not needed.
Returns:
true iff files differ
Throws:
IOException

formatOutput

public String formatOutput(boolean positive,
                           int lineIndex,
                           String line)

main

public static void main(String[] argv)

org.netbeans.modules.nbjunit/1 1.29

Built on May 12 2006.  |  Portions Copyright 1997-2006 Sun Microsystems, Inc. All rights reserved.