Package com.volantis.shared.metadata.type.mutable

Examples of com.volantis.shared.metadata.type.mutable.MutableCollectionType.verify()


        collectionType.setMemberTypeConstraint(memberTypeConstraint);

        // check constraint with right value
        final MutableCollectionValue collectionValue =
            createCollectionValue(new String[]{"one", "two"});
        Collection errors = collectionType.verify(collectionValue);
        assertEquals(0, errors.size());

        // check constraint violation
        memberTypeConstraint.setMemberType(TYPE_FACTORY.createBooleanType());
        collectionType.setMemberTypeConstraint(memberTypeConstraint);
View Full Code Here


        assertEquals(0, errors.size());

        // check constraint violation
        memberTypeConstraint.setMemberType(TYPE_FACTORY.createBooleanType());
        collectionType.setMemberTypeConstraint(memberTypeConstraint);
        errors = collectionType.verify(collectionValue);
        assertEquals(4, errors.size());

        MutableStringValue stringValue = VALUE_FACTORY.createStringValue();
        stringValue.setValue("one");
View Full Code Here

        collectionType.setMinimumLengthConstraint(minimumLengthConstraint);

        // check constraint with right value
        final MutableCollectionValue collectionValue =
            createCollectionValue(new String[]{"one", "two"});
        Collection errors = collectionType.verify(collectionValue);
        assertEquals(0, errors.size());

        // check constraint violation
        minimumLengthConstraint.setLimit(3);
        collectionType.setMinimumLengthConstraint(minimumLengthConstraint);
View Full Code Here

        assertEquals(0, errors.size());

        // check constraint violation
        minimumLengthConstraint.setLimit(3);
        collectionType.setMinimumLengthConstraint(minimumLengthConstraint);
        errors = collectionType.verify(collectionValue);
        assertEquals(1, errors.size());
        final Iterator iter = errors.iterator();
        VerificationError error = (VerificationError) iter.next();
        assertEquals(VerificationError.TYPE_CONSTRAINT_VIOLATION,
            error.getType());
View Full Code Here

        collectionType.setMaximumLengthConstraint(maximumLengthConstraint);

        // check constraint with right value
        final MutableCollectionValue collectionValue =
            createCollectionValue(new String[]{"one", "two"});
        Collection errors = collectionType.verify(collectionValue);
        assertEquals(0, errors.size());

        // check constraint violation
        maximumLengthConstraint.setLimit(1);
        collectionType.setMaximumLengthConstraint(maximumLengthConstraint);
View Full Code Here

        assertEquals(0, errors.size());

        // check constraint violation
        maximumLengthConstraint.setLimit(1);
        collectionType.setMaximumLengthConstraint(maximumLengthConstraint);
        errors = collectionType.verify(collectionValue);
        assertEquals(1, errors.size());
        final Iterator iter = errors.iterator();
        VerificationError error = (VerificationError) iter.next();
        assertEquals(VerificationError.TYPE_CONSTRAINT_VIOLATION,
            error.getType());
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.