Examples of ImmutableStructureType


Examples of com.volantis.shared.metadata.type.immutable.ImmutableStructureType

        assertEquals(constraint, otherConstraint);
    }

    public void testAddressType() throws Exception {

        final ImmutableStructureType rootType =
            (ImmutableStructureType) unmarshall(
                getResourceAsString("res/address-type.xml"),
                ImmutableStructureTypeImpl.class);

        final Set rootFields = rootType.getFields();
        assertEquals(1, rootFields.size());
        final FieldDefinition addressDef =
            (FieldDefinition) rootFields.iterator().next();
        final ImmutableStructureType addressType =
            (ImmutableStructureType) addressDef.getType();

        final Set addressFields = addressType.getFields();
        assertEquals(2, addressFields.size());
        final FieldDefinition postalDef =
            getFieldDefinition("postal", addressFields);
        final FieldDefinition emailDef =
            getFieldDefinition("email", addressFields);

        final ImmutableStringType emailType =
            (ImmutableStringType) emailDef.getType();
        assertNull(emailType.getEnumeratedConstraint());

        final ImmutableStructureType postalType =
            (ImmutableStructureType) postalDef.getType();
        final Set postalFields = postalType.getFields();
        assertEquals(4, postalFields.size());
        final FieldDefinition cityDef = getFieldDefinition("city", postalFields);
        final FieldDefinition streetNameDef =
            getFieldDefinition("street-name", postalFields);
        final FieldDefinition streetTypeDef =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.