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

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


        final MutableNumberValue magnitudeValue =
            VALUE_FACTORY.createNumberValue();
        magnitudeValue.setValue(new Integer(123));
        quantityValue.setMagnitudeValue(magnitudeValue);
        quantityValue.setUnitValue(QuantityUnits.CENTIMETERS);
        Collection errors = quantityType.verify(quantityValue);
        assertEquals(0, errors.size());

        // invalid magnitude type
        magnitudeValue.setValue(new Byte((byte) 42));
        quantityValue.setMagnitudeValue(magnitudeValue);
View Full Code Here


        assertEquals(0, errors.size());

        // invalid magnitude type
        magnitudeValue.setValue(new Byte((byte) 42));
        quantityValue.setMagnitudeValue(magnitudeValue);
        errors = quantityType.verify(quantityValue);
        assertEquals(1, errors.size());
        VerificationError error = (VerificationError) errors.iterator().next();
        assertEquals(VerificationError.TYPE_CONSTRAINT_VIOLATION,
            error.getType());
        assertEquals("[@magnitude]", error.getLocation());
View Full Code Here

        // invalid unit type
        magnitudeValue.setValue(new Integer(42));
        quantityValue.setMagnitudeValue(magnitudeValue);
        quantityValue.setUnitValue(QuantityUnits.PIXELS);
        errors = quantityType.verify(quantityValue);
        assertEquals(1, errors.size());
        error = (VerificationError) errors.iterator().next();
        assertEquals(VerificationError.TYPE_CONSTRAINT_VIOLATION,
            error.getType());
        assertEquals("[@unit]", error.getLocation());
View Full Code Here

        assertEquals(QuantityUnits.PIXELS, error.getInvalidValue());
        assertEquals(enumeratedConstraint, error.getConstraint());

        // invalid type
        BooleanValue booleanValue = VALUE_FACTORY.createBooleanValue();
        errors = quantityType.verify(booleanValue);
        assertEquals(1, errors.size());
        error = (VerificationError) errors.iterator().next();
        assertEquals(VerificationError.TYPE_INVALID_IMPLEMENTATION,
            error.getType());
        assertEquals("", error.getLocation());
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.