com.canoo.webtest.extension
Class VerifyContentTextDiff

java.lang.Object
  extended by com.canoo.webtest.extension.VerifyContentTextDiff
All Implemented Interfaces:
VerifyContentDiff
Direct Known Subclasses:
VerifyContentRegexPerLineDiff

public class VerifyContentTextDiff
extends Object
implements VerifyContentDiff

Produces a unified diff like output (should be like unified diff, but not sure).

Author:
Marc Guillemot

Field Summary
protected  String[] tabActual
           
protected  String[] tabReference
           
 
Constructor Summary
VerifyContentTextDiff()
           
 
Method Summary
 String compare(com.gargoylesoftware.htmlunit.WebResponse reference, com.gargoylesoftware.htmlunit.WebResponse actual, String referenceLabel, String actualLabel)
          Produce the diff of the content of 2 WebResponse.
protected  void preProcess()
          Called before comparision starts
protected  void reset()
          Resets the state to allow new computation
protected  boolean sameContent(int posA, int posB)
          Indicates if 2 content lines are identical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabReference

protected String[] tabReference

tabActual

protected String[] tabActual
Constructor Detail

VerifyContentTextDiff

public VerifyContentTextDiff()
Method Detail

compare

public String compare(com.gargoylesoftware.htmlunit.WebResponse reference,
                      com.gargoylesoftware.htmlunit.WebResponse actual,
                      String referenceLabel,
                      String actualLabel)
Produce the diff of the content of 2 WebResponse.

Specified by:
compare in interface VerifyContentDiff
Parameters:
reference - the reference content
actual - the actual content
referenceLabel - the label to display in diff message for the reference content
actualLabel - the label to display in diff message for the actual content
Returns:
null if content is identical, information allowing to understand the differences otherwise

reset

protected void reset()
Resets the state to allow new computation


preProcess

protected void preProcess()
Called before comparision starts


sameContent

protected boolean sameContent(int posA,
                              int posB)
Indicates if 2 content lines are identical

Parameters:
posA - the line in the first content
posB - the line in the 2nd content
Returns:
true if lines are identical

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.