Package com.volantis.shared.metadata.value.mutable

Examples of com.volantis.shared.metadata.value.mutable.MutableStringValue


        // check the created object
        final Map expectedFields = new HashMap();
        final MutableStructureValueImpl structureValue =
            new MutableStructureValueImpl();
        final MutableStringValue value = new MutableStringValueImpl();
        value.setValue("1/A Value");
        structureValue.addField(new StructureFieldValue("sub1",
            (MetaDataValue) value.createImmutable()));
        value.setValue("1/B Value");
        structureValue.addField(new StructureFieldValue("sub2",
            (MetaDataValue) value.createImmutable()));
        expectedFields.put("first", structureValue);
        value.setValue("Second Value");
        expectedFields.put("second", value.createImmutable());
        assertEquals(expectedFields, structure.getFieldValuesAsMap());

        final Object otherStructure = doRoundTrip(structure);
        assertEquals(structure, otherStructure);
    }
View Full Code Here


            getResourceAsString("res/list-with-strings.xml"),
            ImmutableListValueImpl.class);

        // check the created object
        final List expectedList = new LinkedList();
        MutableStringValue value = new MutableStringValueImpl();
        value.setValue("First Value");
        expectedList.add(value.createImmutable());
        value.setValue("Second Value");
        expectedList.add(value.createImmutable());
        assertEquals(expectedList, list.getContentsAsList());

        final Object otherList = doRoundTrip(list);
        assertEquals(list, otherList);
    }
View Full Code Here

            getResourceAsString("res/list-with-booleans-and-strings.xml"),
            ImmutableListValueImpl.class);

        // check the created object
        final List expectedList = new LinkedList();
        MutableStringValue stringValue = new MutableStringValueImpl();
        stringValue.setValue("First Value");
        expectedList.add(stringValue.createImmutable());
        MutableBooleanValue booleanValue = new MutableBooleanValueImpl();
        booleanValue.setValue(Boolean.TRUE);
        expectedList.add(booleanValue.createImmutable());
        booleanValue.setValue(Boolean.FALSE);
        expectedList.add(booleanValue.createImmutable());
        stringValue.setValue("Fourth Value");
        expectedList.add(stringValue.createImmutable());
        assertEquals(expectedList, list.getContentsAsList());

        final Object otherList = doRoundTrip(list);
        assertEquals(list, otherList);
    }
View Full Code Here

            getResourceAsString("res/set-with-strings.xml"),
            ImmutableSetValueImpl.class);

        // check the created object
        final Set expectedSet = new HashSet();
        MutableStringValue value = new MutableStringValueImpl();
        value.setValue("First Value");
        expectedSet.add(value.createImmutable());
        value.setValue("Second Value");
        expectedSet.add(value.createImmutable());
        assertEquals(expectedSet, set.getContentsAsSet());

        final Object otherList = doRoundTrip(set);
        assertEquals(set, otherList);
    }
View Full Code Here

            getResourceAsString("res/set-with-booleans-and-strings.xml"),
            ImmutableSetValueImpl.class);

        // check the created object
        final Set expectedSet = new HashSet();
        MutableStringValue stringValue = new MutableStringValueImpl();
        stringValue.setValue("First Value");
        expectedSet.add(stringValue.createImmutable());
        MutableBooleanValue booleanValue = new MutableBooleanValueImpl();
        booleanValue.setValue(Boolean.TRUE);
        expectedSet.add(booleanValue.createImmutable());
        booleanValue.setValue(Boolean.FALSE);
        expectedSet.add(booleanValue.createImmutable());
        stringValue.setValue("Fourth Value");
        expectedSet.add(stringValue.createImmutable());
        assertEquals(expectedSet, set.getContentsAsSet());

        final Object otherList = doRoundTrip(set);
        assertEquals(set, otherList);
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.value.mutable.MutableStringValue

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.