package jsx3.xml;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Unit test for simple App.
 */
public class CdfDocumentTest
{
    /**
     * Rigorous Test :-)
     */
    @Test
    public void testApp()
    {
        CdfDocument document = new CdfDocument("root");

        Record record = new Record("US").setAttribute("index", "1");
        document.appendRecord(record);

        String xml = document.toXml();

        assertTrue(xml.startsWith("<data jsxid=\"jsxroot\">"));
        assertTrue(xml.contains("<record jsxid=\"US\" index=\"1\"/>"));
        assertTrue(xml.contains("</data>"));
    }
}

package jsx3.xml;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Unit test for simple App.
 */
public class CdfDocumentTest
{
    /**
     * Rigorous Test :-)
     */
    @Test
    public void testApp()
    {
        CdfDocument document = new CdfDocument("root");

        Record record = new Record("US").setAttribute("index", "1");
        document.appendRecord(record);

        String xml = document.toXml();

        assertEquals(xml, "");
    }
}
/*
<data jsxid="jsxroot">
<record index="1" jsxid="US" jsxtext="United States"/>
<record index="2" jsxid="UK" jsxtext="United Kingdom"/>
<record index="3" jsxid="AG" jsxtext="Afghanistan"/>
<record index="4" jsxid="AL" jsxtext="Albania"/>
<record index="5" jsxid="AR" jsxtext="Algeria"/>
<record index="6" jsxid="AS" jsxtext="American Samoa"/>
<record index="7" jsxid="AD" jsxtext="Andorra"/>
<record index="8" jsxid="AO" jsxtext="Angola"/>
<record index="9" jsxid="AU" jsxtext="Anguilla"/>
</data>
*/

--- 
+++ 
@@ -22,19 +22,8 @@
 
         String xml = document.toXml();
 
-        assertEquals(xml, "");
+        assertTrue(xml.startsWith("<data jsxid=\"jsxroot\">"));
+        assertTrue(xml.contains("<record jsxid=\"US\" index=\"1\"/>"));
+        assertTrue(xml.contains("</data>"));
     }
 }
-/*
-<data jsxid="jsxroot">
-<record index="1" jsxid="US" jsxtext="United States"/>
-<record index="2" jsxid="UK" jsxtext="United Kingdom"/>
-<record index="3" jsxid="AG" jsxtext="Afghanistan"/>
-<record index="4" jsxid="AL" jsxtext="Albania"/>
-<record index="5" jsxid="AR" jsxtext="Algeria"/>
-<record index="6" jsxid="AS" jsxtext="American Samoa"/>
-<record index="7" jsxid="AD" jsxtext="Andorra"/>
-<record index="8" jsxid="AO" jsxtext="Angola"/>
-<record index="9" jsxid="AU" jsxtext="Anguilla"/>
-</data>
-*/
Fix to the GI CDF test, so now all tests from SVN pass

git-svn-id: b371d604c7577be4609d70acd88b8a3995ce0a58@2259 3a8262b2-faa5-11dc-8610-ff947880b6b2
