All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cedarsoft.XmlUnitTest Maven / Gradle / Ivy

package com.cedarsoft;

import org.custommonkey.xmlunit.XMLAssert;
import org.testng.annotations.*;
import org.xml.sax.SAXException;

import java.io.IOException;

/**
 *
 */
public class XmlUnitTest {
  @Test
  public void testIt() throws IOException, SAXException {
    XMLAssert.assertXMLEqual( "\n" +
      "\n" +
      "  Canon Raw\n" +
      "  cr2\n" +
      "",
                              "\n" +
                                "\n" +
                                "  Canon Raw\n" +
                                "  cr2\n" +
                                ""
    );
    AssertUtils.assertXMLEqual( "\n" +
      "\n" +
      "  Canon Raw\n" +
      "  cr2\n" +
      "",
                                "\n" +
                                  "\n" +
                                  "  Canon Raw\n" +
                                  "  cr2\n" +
                                  ""
    );
  }

  @Test
  public void testProblem() throws IOException, SAXException {
    AssertUtils.setIgnoreWhitespace( true );
    XMLAssert.assertXMLEqual( "Canon Rawcr2",
                              "\n" +
                                "\n" +
                                "  Canon Raw\n" +
                                "  cr2\n" +
                                "" );
    AssertUtils.assertXMLEqual( "Canon Rawcr2",
                                "\n" +
                                  "\n" +
                                  "  Canon Raw\n" +
                                  "  cr2\n" +
                                  "" );
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy