Package org.one.stone.soup.core.data

Examples of org.one.stone.soup.core.data.EntityTree


    public void parserReadsCDATA()
    {
            String nonXmlData = " >some \" \n line2 \n line3 [text] in here '< ";
            String xmlData="<xml><cdata><![CDATA["+nonXmlData+"]]></cdata></xml>";
           
            EntityTree doc = null;
            try{
                    doc = XmlHelper.parseElement( xmlData );
            }
            catch(XmlParseException pex)
            {
                    fail(pex.getMessage());
            }
           
            String result = doc.getChild("cdata").getValue();
           
            assertEquals("Failed to parse CDATA",nonXmlData,result);
    }
View Full Code Here


    public void parserWritesCDATA()
    {
            String nonXmlData = " >some \" \n line2 \n line3 [text] in here '< ";
            String xmlData="<xml><cdata><![CDATA["+nonXmlData+"]]></cdata></xml>";         

            EntityTree doc = null;
            try{
                    doc = XmlHelper.parseElement( xmlData );
            }
            catch(XmlParseException pex)
            {
View Full Code Here

                    "<!ENTITY global_taskdefs SYSTEM \"file:global_taskdefs.xml\">"+
                    "<!ENTITY global_targets SYSTEM \"file:global_targets.xml\">"+
                    "<!ENTITY properties SYSTEM \"file:properties.xml\">"+
                    "]><doc><data><![CDATA[text]]></data></doc>";
           
            EntityTree doc = null;
            try{
                    doc = XmlHelper.parseElement( xmlData );
            }
            catch(XmlParseException pex)
            {
View Full Code Here

    {
            String xmlData="<!DOCTYPE project ["+
                    "<!ENTITY global_properties TEST \"file:global_properties.xml\">"+
                    "]><doc><data><![CDATA[text]]></data></doc>";
           
            EntityTree doc = null;
            try{
                    doc = XmlHelper.parseElement( xmlData );
            }
            catch(XmlParseException pex)
            {
View Full Code Here

//    @Test
    public void parserReadsENTITY()
    {
            String xmlData="<!ENTITY name \"the name\"><doc><data><![CDATA[text]]></data></doc>";
           
            EntityTree doc = null;
            try{
                    doc = XmlHelper.parseElement( xmlData );
            }
            catch(XmlParseException pex)
            {
View Full Code Here

    @Test
    public void canParseElementAttribute()
    {
            String data="<name attrib=\"value\"/>";
           
            EntityTree result = null;
            try{
                    result = XmlHelper.parseElement( data );
            }
            catch(XmlParseException xe)
            {
View Full Code Here

    public void canParseElementAttributeWithSpaceAroundEquals()
    {
            String data="<name attrib = \"value\"/>";
            String expectedResult="<name attrib=\"value\"/>";
           
            EntityTree result = null;
            try{
                    result = XmlHelper.parseElement( data );
            }
            catch(XmlParseException xe)
            {
View Full Code Here

    public void canParseElementAttributeAfterLineBreak()
    {
            String data="<name \nattrib=\"value\"/>";
            String expectedResult="<name attrib=\"value\"/>";
           
            EntityTree result = null;
            try{
                    result = XmlHelper.parseElement( data );
            }
            catch(XmlParseException xe)
            {
View Full Code Here

   
    @Test
    public void testCanParseCDATA() {
      String data = "<data>\n<pageName><![CDATA[OpenForum/JarManager/Mailer]]></pageName></data>";
     
        EntityTree result = null;
        try{
                result = XmlHelper.parseElement( data );
                assertEquals("OpenForum/JarManager/Mailer",result.getChild("data").getChild("pageName").getValue());
        }
        catch(XmlParseException xe)
        {
                fail(xe.getMessage());
        }
View Full Code Here

   
    return data.toString();
  }
 
  public static EntityTree toTree(String json) throws IOException {
    EntityTree temp = new EntityTree("temp");
    parseEntity(temp.getRoot(), json);
   
    EntityTree result = new EntityTree( temp.getRoot().getChildren().get(0) );
   
    return result;
  }
View Full Code Here

TOP

Related Classes of org.one.stone.soup.core.data.EntityTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.