Package com.thoughtworks.acceptance.objects

Examples of com.thoughtworks.acceptance.objects.Hardware


        assertBothWaysNormalized(map, expected, "map", "entry", "string[1]");
    }

    public void testMapCanContainCustomObjects() {
        Map map = new HashMap();
        map.put(new Software("microsoft", "windows"), new Hardware("x86", "p4"));

        xstream.alias("software", Software.class);
        xstream.alias("hardware", Hardware.class);

        String expected = "" +
View Full Code Here


            "    <arch>x86</arch>\n" +
            "    <name>p4</name>\n" +
            "  </v>\n" +
            "</java.util.Collections_-SingletonMap>";

        assertBothWays(Collections.singletonMap(new Software("microsoft", "windows"), new Hardware("x86", "p4")), expected);
    }
View Full Code Here

    public void testAllowsNamedFields() {
        ObjectWithNamedFields obj = new ObjectWithNamedFields();
        obj.name = "Joe";
        obj.number = 99;
        obj.someSoftware = new Software("tw", "xs");
        obj.polymorphic = new Hardware("small", "ipod");
        obj.nothing = null;

        xstream.alias("with-named-fields", ObjectWithNamedFields.class);
        xstream.alias("software", Software.class);
View Full Code Here

    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

        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" +
                "    <vendor>Microsoft</vendor>\n" +
View Full Code Here

        MegaSampleMaps sample = new MegaSampleMaps();
        sample.good.put("Windows", new Software("Microsoft", "Windows"));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));
        sample.good.put("Chrome", new Software("Google", "Chrome"));
        sample.bad.put("iPhone", new Product("iPhone", "i", 399.99));
        sample.other.put("Intel", new Hardware("i386", "Intel"));
        sample.other.put("AMD", new Hardware("amd64", "AMD"));
       
        String expected = "" +
                "<MEGA-sample>\n" +
                "  <software>\n" +
                "    <vendor>Microsoft</vendor>\n" +
View Full Code Here

    public void testCollectsDifferentTypesWithFieldOfSameName() {
        SampleMaps sample = new SampleMaps();
        sample.good = new OrderRetainingMap();
        sample.good.put("iPhone", new Product("iPhone", "i", 399.99));
        sample.good.put("Linux", new Software("Red Hat", "Linux"));
        sample.good.put("Intel", new Hardware("i386", "Intel"));

        String expected = "" +
                "<sample>\n" +
                "  <product>\n" +
                "    <name>iPhone</name>\n" +
View Full Code Here

TOP

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

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.