Package com.thoughtworks.acceptance.objects

Examples of com.thoughtworks.acceptance.objects.SampleLists


        x.anInt = 42;
        x.aStr = "X";
        x.innerObj = new YString("Y");
        final X emptyX = new X();
        emptyX.innerObj = new Y();
        final SampleLists lists = new SampleLists();
        lists.good = new LinkedList();
        lists.good.add("XStream");
        lists.bad = new TreeSet();
        lists.bad.add(new X());
        final Map targets = new OrderRetainingMap();
View Full Code Here


    public void testCanUsePersistenceCollectionAsConverter() throws IOException {
        xstream.alias("lists", SampleLists.class);
        xstream.alias("software", Software.class);
        xstream.registerLocalConverter(SampleLists.class, "good", new PersistenceArrayListConverter());
       
        SampleLists lists = new SampleLists();
        lists.good.add("Guilherme");
        lists.good.add(new Integer(1970));
        lists.good.add(new Software("Codehaus", "XStream"));

        String expected = "" +
                "<lists>\n" +
                "  <good>" + dir.getPath() + "</good>\n" +
                "  <bad class=\"list\"/>\n" +
                "</lists>";

        // assumes 'lists' is serialized first
        SampleLists serialized = (SampleLists)assertBothWays(lists, expected);
       
        // compare original list and list written in separate XML file
        assertEquals(lists.good, serialized.good);
       
        // retrieve value from external file
View Full Code Here

import java.util.Vector;

public class CollectionsTest extends AbstractAcceptanceTest {

    public void testListsCanContainCustomObjects() {
        SampleLists lists = new SampleLists();
        lists.good.add(new Software("apache", "geronimo"));
        lists.good.add(new Software("caucho", "resin"));
        lists.good.add(new Hardware("risc", "strong-arm"));
        lists.bad.add(new Software("apache", "jserv"));
View Full Code Here

        assertBothWays(lists, expected);
    }

    public void testListsCanContainBasicObjects() {
        SampleLists lists = new SampleLists();
        lists.good.add("hello");
        lists.good.add(new Integer(3));
        lists.good.add(Boolean.TRUE);

        xstream.alias("lists", SampleLists.class);
View Full Code Here

TOP

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

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.