protected void setUp() throws Exception { XMLUnit.setIgnoreWhitespace(true); }
protected void setUp() throws Exception { XMLUnit.setIgnoreWhitespace(true); }
public void setUp() throws Exception { super.setUp(); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreComments(true); setErrorMessage(null); }
public static void assertXmlEquals(String expected, String actual) throws Exception { XMLUnit.setIgnoreWhitespace(true); Diff diff = new Diff(expected, actual); Assert.assertTrue(diff.toString(), diff.similar()); } }
@Test public void generate() throws Exception { GeneratedResource resource = resourceFactory.generateResource(extensionModel).get(); assertThat(resource.getPath(), equalTo(RESOURCE_NAME)); XMLUnit.setIgnoreWhitespace(true); String expected = IOUtils.toString(currentThread().getContextClassLoader().getResource(RESOURCE_NAME).openStream()); XMLUnit.compareXML(expected, new String(resource.getContent())); } }
private void compareXML(String expected, String actual) throws Exception { setNormalizeWhitespace(true); setIgnoreWhitespace(true); setIgnoreComments(true); setIgnoreAttributeOrder(false); Diff diff = XMLUnit.compareXML(expected, actual); if (!(diff.similar() && diff.identical())) { System.out.println(actual); DetailedDiff detDiff = new DetailedDiff(diff); @SuppressWarnings("rawtypes") List differences = detDiff.getAllDifferences(); StringBuilder diffLines = new StringBuilder(); for (Object object : differences) { Difference difference = (Difference) object; diffLines.append(difference.toString() + '\n'); } throw new IllegalArgumentException("Actual XML differs from expected: \n" + diffLines.toString()); } } }
/** * Receives to {@link String} representation of two XML files and verify that they are semantically equivalent * * @param expected the reference content * @param actual the actual content * @throws Exception if comparison fails */ public static void compareXML(String expected, String actual) throws Exception { XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreAttributeOrder(false); Diff diff = XMLUnit.compareXML(expected, actual); if (!(diff.similar() && diff.identical())) { System.out.println(actual); DetailedDiff detDiff = new DetailedDiff(diff); @SuppressWarnings("rawtypes") List differences = detDiff.getAllDifferences(); StringBuilder diffLines = new StringBuilder(); for (Object object : differences) { Difference difference = (Difference) object; diffLines.append(difference.toString() + '\n'); } throw new IllegalArgumentException("Actual XML differs from expected: \n" + diffLines.toString()); } }
@Override protected void setUp() throws Exception { out = new ByteArrayOutputStream(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); builder = factory.newDocumentBuilder(); Map<String, String> nsMap = new HashMap<String, String>(); nsMap.put(NS_FCFG_PREFIX, NS_FCFG); NamespaceContext ctx = new SimpleNamespaceContext(nsMap); XMLUnit.setXpathNamespaceContext(ctx); XMLUnit.setIgnoreWhitespace(false); }
public static void initXmlUnit() { XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setNormalize(true); }
private void configureXmlUnit() { XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setCompareUnmatched(false); XMLUnit.setIgnoreAttributeOrder(true); }
private void configureXmlUnit() { XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setNormalizeWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setCompareUnmatched(false); XMLUnit.setIgnoreAttributeOrder(true); }
@BeforeAll public static void setupHub() { XMLUnit.setIgnoreWhitespace(true); new Installer().setupProject(); }
public void setUp() throws Exception { super.setUp(); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreComments(true); setErrorMessage(null); }
@Override public void setUp() throws Exception { super.setUp(); XMLUnit.setIgnoreComments( true ); XMLUnit.setIgnoreWhitespace( true ); XMLUnit.setIgnoreAttributeOrder( true ); XMLUnit.setNormalizeWhitespace( 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 ); }
@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 { XMLUnit.setIgnoreWhitespace(true); server = new HttpServer(port.getNumber(), buildInInterceptor(), buildOutInterceptor(), createServiceInstance());; client = new TestSoapClient(getDefaultConfiguration(server.getDefaultAddress()) .enableMtom(isMtom()) .withVersion(soapVersion) .withDispatcher(dispatcher) .withSecurities(getSecurityStrategies()) .build()); }