Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
// require(groupId:'xmlunit', artifactId:'xmlunit', version:'1.01beta2')
import groovy.xml.StreamingMarkupBuilder
import org.custommonkey.xmlunit.*

def xml = new StreamingMarkupBuilder().bind{
  records() {
    car(name:'HSV Maloo', make:'Holden', year:2006) {
      country('Australia')
      record(type:'speed', 'Production Pickup Truck with speed of 271kph')
    }
    car(name:'P50', make:'Peel', year:1962) {
      country('Isle of Man')
      record(type:'size', 'Smallest Street-Legal Car at 99cm wide and 59 kg in weight')
    }
    car(name:'Royale', make:'Bugatti', year:1931) {
      country('France')
      record(type:'price', 'Most Valuable Car at $15 million')
    }   } }

XMLUnit.setIgnoreWhitespace(true)ignoreWhitespace = true
def xmlDiff = new Diff(xml.toString(), XmlExamples.CAR_RECORDS)
assert xmlDiff.similar()

...