Package com.thoughtworks.acceptance.objects

Examples of com.thoughtworks.acceptance.objects.SomethingExternalizable


    }

    public void testCanMarshalExternalizable() {
        xstream.alias("ext", SomethingExternalizable.class);
       
        SomethingExternalizable in = new SomethingExternalizable("Joe", "Walnes");
        String expected = normalizeExpectation(""
            + "{'ext': [\n"
            + "  3,\n"
            + "  'JoeWalnes',\n"
            + "  {},\n"
View Full Code Here


    public void testCanMarshalEmbeddedExternalizable() {
        xstream.alias("owner", OwnerOfExternalizable.class);
       
        OwnerOfExternalizable in = new OwnerOfExternalizable();
        in.target = new SomethingExternalizable("Joe", "Walnes");
        String expected = normalizeExpectation(""
            + "{'owner': {\n"
            + "  'target': [\n"
            + "    3,\n"
            + "    'JoeWalnes',\n"
View Full Code Here

public class ExternalizableTest extends AbstractAcceptanceTest {

    public void testExternalizable() {
        xstream.alias("something", SomethingExternalizable.class);
       
        SomethingExternalizable in = new SomethingExternalizable("Joe", "Walnes");

        String expected = ""
                + "<something>\n"
                + "  <int>3</int>\n"
                + "  <string>JoeWalnes</string>\n"
View Full Code Here

    public void testExternalizableAsFieldOfAnotherObject() {
        xstream.alias("something", SomethingExternalizable.class);
        xstream.alias("owner", OwnerOfExternalizable.class);

        OwnerOfExternalizable in = new OwnerOfExternalizable();
        in.target = new SomethingExternalizable("Joe", "Walnes");

        String expected = ""
                + "<owner>\n"
                + "  <target>\n"
                + "    <int>3</int>\n"
View Full Code Here

    public void todoTestCanMarshalEmbeddedExternalizable() {
        xstream.alias("owner", OwnerOfExternalizable.class);
       
        OwnerOfExternalizable in = new OwnerOfExternalizable();
        in.target = new SomethingExternalizable("Joe", "Walnes");
        String json = xstream.toXML(in);
        // already wrong, Jettison reorders elements ...
        assertEquals("{'owner':{'target':{'int':3,'string':['JoeWalnes','XStream'],'null':''}}}".replace('\'', '"'), json);
        OwnerOfExternalizable owner = (OwnerOfExternalizable)xstream.fromXML(json);
        assertEquals(json, xstream.toXML(owner));
View Full Code Here

TOP

Related Classes of com.thoughtworks.acceptance.objects.SomethingExternalizable

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.