Package com.thoughtworks.acceptance.objects

Examples of com.thoughtworks.acceptance.objects.Software


    }

    public void testMaintainsBackwardsCompatabilityWithXStream1_1_0FieldFormat() {
        ObjectWithNamedFields outer = new ObjectWithNamedFields();
        outer.name = "Joe";
        outer.someSoftware = new Software("tw", "xs");
        outer.nothing = null;

        ObjectWithNamedFields inner = new ObjectWithNamedFields();
        inner.name = "Thing";
View Full Code Here


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"));

        xstream.alias("lists", SampleLists.class);
        xstream.alias("software", Software.class);
        xstream.alias("hardware", Hardware.class);
View Full Code Here

        String expectedXml = "" +
                "<Software>\n" +
                "  <vendor>ms</vendor>\n" +
                "  <name>word</name>\n" +
                "</Software>";
        assertEquals(expectedXml, xstream.toXML(new Software("ms", "word")));
    }
View Full Code Here

        String expected = "" +
                "<com.thoughtworks.acceptance.objects.Software>\n" +
                "  <vendor>ms</vendor>\n" +
                "  <name>word</name>\n" +
                "</com.thoughtworks.acceptance.objects.Software>";
        assertEquals(expected, xstream.toXML(new Software("ms", "word")));
    }
View Full Code Here

            }
           
        };
        xstream.alias("software", Software.class);

        Software out = (Software) xstream.fromXML(expectedXml);
        assertEquals("Joe", out.vendor);
        assertEquals("XStream", out.name);
    }
View Full Code Here

        final List reference = Arrays.asList(new String[]{"A", "B", "C", "D"});
        final WithNamedList[] namedLists = new WithNamedList[5];
        for (int i = 0; i < namedLists.length; ++i) {
            namedLists[i] = new WithNamedList("Name " + (i + 1));
            namedLists[i].things.add(new Software("walnes", "XStream 1." + i));
            namedLists[i].things.add(reference);
            namedLists[i].things.add(new RuntimeException("JUnit " + i)); // a Serializable
        }

        final Map exceptions = new HashMap();
View Full Code Here

    }

    public void testWithout() {
        SampleMaps sample = new SampleMaps();
        sample.good = new OrderRetainingMap();
        sample.good.put("Windows", new Software("Microsoft", "Windows"));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));

        String expected = "" +
                "<sample>\n" +
                "  <good>\n" +
                "    <entry>\n" +
View Full Code Here

    }

    public void testWithMap() {
        SampleMaps sample = new SampleMaps();
        sample.good = new OrderRetainingMap();
        sample.good.put("Windows", new Software("Microsoft", "Windows"));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));

        String expected = "" +
                "<sample>\n" +
                "  <software>\n" +
                "    <vendor>Microsoft</vendor>\n" +
View Full Code Here

   
    public void testInheritsImplicitMapFromSuperclass() {
        xstream.alias("MEGA-sample", MegaSampleMaps.class);

        SampleMaps sample = new MegaSampleMaps(); // subclass
        sample.good.put("Windows", new Software("Microsoft", "Windows"));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));

        String expected = "" +
                "<MEGA-sample>\n" +
                "  <software>\n" +
                "    <vendor>Microsoft</vendor>\n" +
View Full Code Here

    public void testSupportsInheritedAndDirectDeclaredImplicitMapAtOnce() {
        xstream.alias("MEGA-sample", MegaSampleMaps.class);

        MegaSampleMaps sample = new MegaSampleMaps(); // subclass
        sample.good.put("Windows", new Software("Microsoft", "Windows"));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));
        sample.other.put("i386", new Hardware("i386", "Intel"));
       
        String expected = "" +
                "<MEGA-sample>\n" +
                "  <software>\n" +
View Full Code Here

TOP

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

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.