For some reason the following script when executed, prints the output not only in the log but also in an information pop-up dialogue box. Can someone explain to me why this occurs and how I can prevent it from happening?
import groovy.io.FileType;
import org.custommonkey.xmlunit.*;
def file1 = "somepath/file1.xml"
def file2 = "somepath/file2.xml"
def xml1 = new FileReader(file1)
def xml2= new FileReader(file2)
XMLUnit.setIgnoreWhitespace(true)
XMLUnit.setIgnoreComments(true)
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true)
XMLUnit.setNormalizeWhitespace(true)
DetailedDiff myDiff = new DetailedDiff(new Diff(xml1, xml2));
List allDifferences = myDiff.getAllDifferences();
allDifferences.each { difference ->
log.info (difference)
}
EDIT: Through experimentation, I figured out that the following line:
List allDifferences = myDiff.getAllDifferences();
is the reason why the dialogue pops up. I am guessing that the getAllDifferenes() method is causing the dialogue pop up to occur.
I would still like some help to determine a viable alternative since I am trying to compare two xml files and print the differences in a file.