Class DiffBuilder

java.lang.Object
org.xmlunit.builder.DiffBuilder
All Implemented Interfaces:
DifferenceEngineConfigurer<DiffBuilder>

public class DiffBuilder extends Object implements DifferenceEngineConfigurer<DiffBuilder>
DiffBuilder to create a Diff instance.

Valid inputs for control and test are all Objects supported by Input.from(Object).

Example Usage:

 String controlXml = "<a><b>Test Value</b></a>";
 String testXml = "<a>\n <b>\n  Test Value\n </b>\n</a>";
 Diff myDiff = DiffBuilder.compare(Input.fromString(controlXml)).withTest(Input.fromString(testXml))
     .checkForSimilar()
     .ignoreWhitespace()
     .build();
 assertFalse("XML similar " + myDiff.toString(), myDiff.hasDifferences());