Package com.volantis.shared.metadata.value.immutable

Examples of com.volantis.shared.metadata.value.immutable.ImmutableStringValue


        final Object otherConstraint = doRoundTrip(constraint);
        assertEquals(constraint, otherConstraint);
    }

    public void testString() throws Exception {
        final ImmutableStringValue string = (ImmutableStringValue) unmarshall(
            getResourceAsString("res/string.xml"),
            ImmutableStringTypeImpl.class);

        // check the created object
        assertEquals("hello world", string.getAsString());

        final Object otherString = doRoundTrip(string);
        assertEquals(string, otherString);
    }
View Full Code Here


            (ImmutableStringType) streetTypeDef.getType();
        final ImmutableEnumeratedConstraint enumeratedConstraint =
            streetTypeType.getEnumeratedConstraint();
        final Iterator constraintIter =
            enumeratedConstraint.getEnumeratedValues().iterator();
        final ImmutableStringValue road =
            (ImmutableStringValue) constraintIter.next();
        assertEquals("Road", road.getValueAsString());
        final ImmutableStringValue street =
            (ImmutableStringValue) constraintIter.next();
        assertEquals("Street", street.getValueAsString());
        final ImmutableStringValue avenue =
            (ImmutableStringValue) constraintIter.next();
        assertEquals("Avenue", avenue.getValueAsString());

        final ImmutableNumberType houseNumberType =
            (ImmutableNumberType) houseNumberDef.getType();
        final ImmutableNumberSubTypeConstraint subTypeConstraint =
            houseNumberType.getNumberSubTypeConstraint();
View Full Code Here

         if (!(value instanceof ImmutableStringValue)) {
            fail("Expected a ImmutableStringValue but got a " +
                 value.getClass().toString());
        }

        ImmutableStringValue str = (ImmutableStringValue) value;
        assertEquals("ImmutableStringValue is invalid",
                     expectedStr,
                     str.getAsString());
        return str;
    }
View Full Code Here

        final Object otherNumber = doRoundTrip(number);
        assertEquals(number, otherNumber);
    }

    public void testString() throws Exception {
        final ImmutableStringValue string = (ImmutableStringValue) unmarshall(
            getResourceAsString("res/string.xml"),
            ImmutableStringValueImpl.class);

        // check the created object
        assertEquals("hello world", string.getAsString());

        final Object otherString = doRoundTrip(string);
        assertEquals(string, otherString);
    }
View Full Code Here

        // check the created object
        final Map addressFields = addressValue.getFieldValuesAsMap();
        assertEquals(2, addressFields.size());

        final ImmutableStringValue emailValue =
            (ImmutableStringValue) addressFields.get("email");
        assertEquals("foo-bar@example.com", emailValue.getValueAsString());

        final ImmutableStructureValue postalValue =
            (ImmutableStructureValue) addressFields.get("postal");

        final Map postalFields = postalValue.getFieldValuesAsMap();
        assertEquals(4, postalFields.size());

        final ImmutableNumberValue houseNumberValue =
            (ImmutableNumberValue) postalFields.get("house-number");
        assertEquals(new Integer(42), houseNumberValue.getValueAsNumber());
        final ImmutableStringValue streetNameValue =
            (ImmutableStringValue) postalFields.get("street-name");
        assertEquals("Foo", streetNameValue.getValueAsString());
        final ImmutableStringValue streetTypeValue =
            (ImmutableStringValue) postalFields.get("street-type");
        assertEquals("Road", streetTypeValue.getValueAsString());
        final ImmutableStringValue cityValue =
            (ImmutableStringValue) postalFields.get("city");
        assertEquals("Bar", cityValue.getValueAsString());

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

TOP

Related Classes of com.volantis.shared.metadata.value.immutable.ImmutableStringValue

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.