Package org.javalite.activejdbc.test_models

Examples of org.javalite.activejdbc.test_models.Person.toXml()


    @Test
    public void shouldGenerateSimpleXml(){
        deleteAndPopulateTable("people");
        Person p  = Person.findById(1);
        String xml = p.toXml(true, true);
        a(XPathHelper.selectText("//name", xml)).shouldEqual("John");
        a(XPathHelper.selectText("//last_name", xml)).shouldEqual("Smith");
    }

    @Test
View Full Code Here


    @Test
    public void shouldInjectCustomContentIntoXML(){
        deleteAndPopulateTable("people");
        Person p  = Person.findById(1);
        String xml = p.toXml(true, true);
        a(XPathHelper.selectText("/person/test", xml)).shouldEqual("test content");
    }

    @Test
    public void shouldEscapeSpecialCharsInXMLContent(){
View Full Code Here

    }

    @Test
    public void shouldEscapeSpecialCharsInXMLContent(){
        Person p = Person.create("name", "John", "last_name", "Smith & Wesson");
        String xml = p.toXml(true, true);
        a(XPathHelper.selectText("/person/last_name", xml)).shouldEqual("Smith & Wesson");
        the(xml).shouldContain("<last_name>Smith &amp; Wesson</last_name>");
    }

    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.