public static void initXmlUnit() { XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setNormalize(true); }
@Override public boolean matchesSafely(Source source) { String test = convertToString(source); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); try { return new Diff(control, test).identical(); } catch (SAXException e) { return false; } catch (IOException e) { return false; } }
@Override public void setUp() throws Exception { super.setUp(); XMLUnit.setIgnoreComments( true ); XMLUnit.setIgnoreWhitespace( true ); XMLUnit.setIgnoreAttributeOrder( true ); XMLUnit.setNormalizeWhitespace( true ); XMLUnit.setNormalize( true ); }
private boolean isdifferent(Document testDoc, Document controlDoc) { boolean isdifferent = false; XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreComments(true); XMLUnit.setNormalize(true); Diff myDiff = new Diff(controlDoc, testDoc); DetailedDiff myComparisonController = new DetailedDiff(myDiff); DifferenceEngine engine = new DifferenceEngine(myComparisonController); XmlDifferenceListener listener = new XmlDifferenceListener(); ElementNameAndAttributeQualifier myElementQualifier = new ElementNameAndAttributeQualifier(); try { //debug engine.compare(controlDoc.getDocumentElement(), testDoc.getDocumentElement(), listener, myElementQualifier); } catch (NullPointerException ne) { LOG.error(ne); } isdifferent =listener.called(); return isdifferent; } }
@Before public void setUp() throws Exception { XMLUnit.setIgnoreComments( true ); XMLUnit.setIgnoreWhitespace( true ); XMLUnit.setIgnoreAttributeOrder( true ); XMLUnit.setNormalizeWhitespace( true ); XMLUnit.setNormalize( true ); }
XMLUnit.setNormalize(true);
@Before public void setUp() throws Exception { XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setNormalize(true); }
@Override public void setUp() throws Exception { super.setUp(); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setNormalize(true); }
@Override @Before public void setUp() throws Exception { XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setNormalize(true); XStreamXML.SORT_MAPS = true; // allows us to test results easier }
@Before public void setUp() throws Exception { XMLUnit.setIgnoreComments( true ); XMLUnit.setIgnoreWhitespace( true ); XMLUnit.setIgnoreAttributeOrder( true ); XMLUnit.setNormalizeWhitespace( true ); XMLUnit.setNormalize( true ); }
@Before public void before() throws Exception { tempReg.addNamedTemplate("tempReg", TemplateCompiler.compileTemplate(getClass().getResourceAsStream(dataformat + ".mvt"), (Map<String, Class<? extends Node>>)null)); TemplateRuntime.execute(tempReg.getNamedTemplate("tempReg"), null, tempReg); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setNormalize(true); if (!StringUtils.isEmpty(copyToDataFormat)) { writer = new PrintWriter(new BufferedWriter(new FileWriter(copyToDataFormat + ".mvt", true))); } }
@BeforeClass public static void beforeClass() { XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); Map<String,String> namespaces = new HashMap<>(); namespaces.put("rapi", "http://marklogic.com/rest-api"); namespaces.put("prop", "http://marklogic.com/xdmp/property"); namespaces.put("xs", "http://www.w3.org/2001/XMLSchema"); namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance"); namespaces.put("search", "http://marklogic.com/appservices/search"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(namespaces); xpather = XMLUnit.newXpathEngine(); xpather.setNamespaceContext(namespaceContext); }
@Before public void before() throws Exception { tempReg.addNamedTemplate( "tempReg", TemplateCompiler.compileTemplate( getClass().getResourceAsStream( dataformat + ".mvt" ), (Map<String, Class<? extends Node>>) null ) ); TemplateRuntime.execute( tempReg.getNamedTemplate( "tempReg" ), null, tempReg ); XMLUnit.setIgnoreComments( true ); XMLUnit.setIgnoreWhitespace( true ); XMLUnit.setIgnoreAttributeOrder( true ); XMLUnit.setNormalizeWhitespace( true ); XMLUnit.setNormalize( true ); if ( !StringUtils.isEmpty( copyToDataFormat ) ) { writer = new PrintWriter( new BufferedWriter( new FileWriter( copyToDataFormat + ".mvt", true ) ) ); } }
@BeforeClass public static void beforeClass() { Common.connect(); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); Map<String,String> namespaces = new HashMap<>(); namespaces.put("rapi", "http://marklogic.com/rest-api"); namespaces.put("prop", "http://marklogic.com/xdmp/property"); namespaces.put("xs", "http://www.w3.org/2001/XMLSchema"); namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(namespaces); xpather = XMLUnit.newXpathEngine(); xpather.setNamespaceContext(namespaceContext); } @AfterClass
@BeforeClass public static void beforeClass() throws IOException { Common.connectAdmin(); resourceServices = Common.testFileToString(XQUERY_FILE); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); Map<String,String> namespaces = new HashMap<>(); namespaces.put("rapi", "http://marklogic.com/rest-api"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(namespaces); xpather = XMLUnit.newXpathEngine(); xpather.setNamespaceContext(namespaceContext); } @AfterClass
@BeforeClass public static void beforeClass() throws IOException { Common.connect(); Common.connectAdmin(); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); Map<String,String> namespaces = new HashMap<>(); namespaces.put("xsl", "http://www.w3.org/1999/XSL/Transform"); namespaces.put("rapi", "http://marklogic.com/rest-api"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(namespaces); xpather = XMLUnit.newXpathEngine(); xpather.setNamespaceContext(namespaceContext); xqueryTransform = Common.testFileToString(XQUERY_FILE, "UTF-8"); xslTransform = Common.testFileToString(XSLT_FILE, "UTF-8"); } @AfterClass
XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
XMLUnit.setNormalize(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);