Search in sources :

Example 1 with DiffBuilder

use of org.xmlunit.builder.DiffBuilder in project irontest by zheng-wang.

the class PlaceholderDifferenceEvaluatorTest method hasIgnorePlaceholder_Exception_ExclusivelyOccupy.

@Test
public void hasIgnorePlaceholder_Exception_ExclusivelyOccupy() throws Exception {
    String control = "<elem1><elem11> #{irontest.ignore}abc</elem11></elem1>";
    String test = "<elem1><elem11>abc</elem11></elem1>";
    DiffBuilder diffBuilder = DiffBuilder.compare(control).withTest(test).withDifferenceEvaluator(new PlaceholderDifferenceEvaluator());
    try {
        diffBuilder.build();
        fail();
    } catch (XMLUnitException e) {
        assertEquals("#{irontest.ignore} must exclusively occupy the text node.", e.getCause().getMessage());
    }
}
Also used : DiffBuilder(org.xmlunit.builder.DiffBuilder) XMLUnitException(org.xmlunit.XMLUnitException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 XMLUnitException (org.xmlunit.XMLUnitException)1 DiffBuilder (org.xmlunit.builder.DiffBuilder)1