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

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


            TYPE_FACTORY.createChoiceType();

        // normal case
        final MutableChoiceValue choiceValue =
            VALUE_FACTORY.createChoiceValue();
        Collection errors = choiceType.verify(choiceValue);
        assertEquals(0, errors.size());

        // invalid type
        final BooleanValue booleanValue = VALUE_FACTORY.createBooleanValue();
        errors = choiceType.verify(booleanValue);
View Full Code Here


        Collection errors = choiceType.verify(choiceValue);
        assertEquals(0, errors.size());

        // invalid type
        final BooleanValue booleanValue = VALUE_FACTORY.createBooleanValue();
        errors = choiceType.verify(booleanValue);
        assertEquals(1, errors.size());
        checkError(errors, "", VerificationError.TYPE_INVALID_IMPLEMENTATION,
                booleanValue, null);
    }
View Full Code Here

        choiceValue.setChoiceName("foo");
        final MutableStringValue fooValue = VALUE_FACTORY.createStringValue();
        fooValue.setValue("Foo");
        choiceValue.setValue(fooValue);

        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(0, errors.size());
    }
   
    public void testVerifyChoiceNameInvalid() {
        final MutableChoiceType choiceType = TYPE_FACTORY.createChoiceType();
View Full Code Here

        final MutableChoiceValue choiceValue =
            VALUE_FACTORY.createChoiceValue();
       
        choiceValue.setChoiceName("bar");

        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(1, errors.size());
    }
   
    public void testVerifyChoiceNameNull() {
        final MutableChoiceType choiceType = TYPE_FACTORY.createChoiceType();
View Full Code Here

   
        // set up the value structure
        final MutableChoiceValue choiceValue =
            VALUE_FACTORY.createChoiceValue();
       
        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(1, errors.size());
    }
   
    public void testVerifyChoiceValueOK() {
        final MutableChoiceType choiceType =
View Full Code Here

        choiceValue.setChoiceName("foo");
        final MutableStringValue fooValue = VALUE_FACTORY.createStringValue();
        fooValue.setValue("Foo");
        choiceValue.setValue(fooValue);

        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(0, errors.size());
    }

    public void testVerifyChoiceValueInvalid() {
        final MutableChoiceType choiceType =
View Full Code Here

        choiceValue.setChoiceName("foo");
        final MutableNumberValue fooValue = VALUE_FACTORY.createNumberValue();
        fooValue.setValue(new Integer(1));
        choiceValue.setValue(fooValue);

        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(1, errors.size());
    }

    public void testVerifyChoiceValueNull() {
        final MutableChoiceType choiceType =
View Full Code Here

        // set up the value strucutre
        final MutableChoiceValue choiceValue =
            VALUE_FACTORY.createChoiceValue();
        choiceValue.setChoiceName("foo");

        final Collection errors = choiceType.verify(choiceValue);
        assertEquals(1, errors.size());
    }

    private void checkError(final Collection errors,
                            final String path,
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.