public static void assertXpathValuesNotEqual ( String controlXpath , Document controlDocument , String testXpath , Document testDocument ) throws XpathException { XpathEngine xpath = XMLUnit . newXpathEngine ( ) ; String control = xpath . evaluate ( controlXpath , controlDocument ) ; String test = xpath . evaluate ( testXpath , testDocument ) ; if ( control != null ) { if ( control . equals ( test ) ) { fail ( "Expected test value NOT to be equal to control but both were " + test ) ; } } else if ( test == null ) { fail ( "Expected test value NOT to be equal to control but both were empty" ) ; } }
Assert that the evaluation of two Xpaths in two documents are NOT equal