// Path: src/test/org/diffxml/diffxml/TestDocHelper.java
// public final class TestDocHelper {
// 
//     /**
//      * Private constructor.
//      */
//     private TestDocHelper() {
//         //SHouldn't be called
//     }
//     
//     /**
//      * Create an XML Document from a string of XML.
//      * 
//      * Calls fail if any exception is thrown.
//      * 
//      * @param xml The XML to turn into a document.
//      * @return A DOM document representing the string.
//      */
//     public static Document createDocument(final String xml) {
//         
//         Document ret = null;
//         DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
//         DOMOps.initParser(fac);
//                 
//         try {
//             ByteArrayInputStream is = new ByteArrayInputStream(
//                     xml.getBytes("utf-8"));
//             ret = fac.newDocumentBuilder().parse(is);
//         } catch (UnsupportedEncodingException e) {
//             fail("No utf-8 encoder!");
//         } catch (ParserConfigurationException e) {
//             fail("Error configuring parser: " + e.getMessage());
//         } catch (IOException e) {
//             fail("Caught IOException: " + e.getMessage());
//         } catch (SAXException e) {
//             fail("Caught SAXexception: " + e.getMessage());
//         }
//         
//         return ret;
// 
//     }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.diffxml.diffxml.TestDocHelper;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
/*
diffxml and patchxml - diff and patch for XML files

Copyright 2013 Adrian Mouat

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/
package org.diffxml.diffxml.fmes;



/**
 * Class to test matching algorithm.
 * 
 * TODO: Add more tests for similar docs and other node types.
 * 
 * @author Adrian Mouat
 *
 */
public class MatchTest {

    /** Test Doc 1a. */
    private static Document mTestDoc1a;
    
    /** Test Doc 1b. */
    private static Document mTestDoc1b;

    /** Test Doc 2a. */
    private static Document mTestDoc2a;

    /** Test Doc 2b. */
    private static Document mTestDoc2b;

    /** Test Doc 3a. */
    private static Document mTestDoc3a;

    /** Test Doc 3b. */
    private static Document mTestDoc3b;
    
    /** Test Doc 4a. */
    private static Document mTestDoc4a;
    
    /**
     * Set up documents before test.
     */
    @BeforeClass
    public static void setUpBeforeClass() {
        
// Path: src/test/org/diffxml/diffxml/TestDocHelper.java
// public final class TestDocHelper {
// 
//     /**
//      * Private constructor.
//      */
//     private TestDocHelper() {
//         //SHouldn't be called
//     }
//     
//     /**
//      * Create an XML Document from a string of XML.
//      * 
//      * Calls fail if any exception is thrown.
//      * 
//      * @param xml The XML to turn into a document.
//      * @return A DOM document representing the string.
//      */
//     public static Document createDocument(final String xml) {
//         
//         Document ret = null;
//         DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
//         DOMOps.initParser(fac);
//                 
//         try {
//             ByteArrayInputStream is = new ByteArrayInputStream(
//                     xml.getBytes("utf-8"));
//             ret = fac.newDocumentBuilder().parse(is);
//         } catch (UnsupportedEncodingException e) {
//             fail("No utf-8 encoder!");
//         } catch (ParserConfigurationException e) {
//             fail("Error configuring parser: " + e.getMessage());
//         } catch (IOException e) {
//             fail("Caught IOException: " + e.getMessage());
//         } catch (SAXException e) {
//             fail("Caught SAXexception: " + e.getMessage());
//         }
//         
//         return ret;
// 
//     }
// }


// Path: src/test/org/diffxml/diffxml/fmes/MatchTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.diffxml.diffxml.TestDocHelper;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

/*
diffxml and patchxml - diff and patch for XML files

Copyright 2013 Adrian Mouat

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/
package org.diffxml.diffxml.fmes;



/**
 * Class to test matching algorithm.
 * 
 * TODO: Add more tests for similar docs and other node types.
 * 
 * @author Adrian Mouat
 *
 */
public class MatchTest {

    /** Test Doc 1a. */
    private static Document mTestDoc1a;
    
    /** Test Doc 1b. */
    private static Document mTestDoc1b;

    /** Test Doc 2a. */
    private static Document mTestDoc2a;

    /** Test Doc 2b. */
    private static Document mTestDoc2b;

    /** Test Doc 3a. */
    private static Document mTestDoc3a;

    /** Test Doc 3b. */
    private static Document mTestDoc3b;
    
    /** Test Doc 4a. */
    private static Document mTestDoc4a;
    
    /**
     * Set up documents before test.
     */
    @BeforeClass
    public static void setUpBeforeClass() {
        
        mTestDoc1a = TestDocHelper.createDocument("<a><b><c/></b></a>");