Package com.volantis.shared.metadata.value.mutable

Examples of com.volantis.shared.metadata.value.mutable.MutableListValue


        final ImmutableUniqueMemberConstraint uniqueMemberConstraint =
            CONSTRAINT_FACTORY.getUniqueMemberConstraint();
        listType.setUniqueMemberConstraint(uniqueMemberConstraint);

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

        // check constraint violation
View Full Code Here


        super(memberType, valueString);
    }

    // Javadoc inherited
    public ImmutableMetaDataValue createMetaDataValue() {
        MutableListValue listValue = VALUE_FACTORY.createListValue();
        List contents = listValue.getContentsAsMutableList();

        for (Iterator i = values.iterator(); i.hasNext();) {
            InternalPolicyValue policyValue = (InternalPolicyValue) i.next();
            contents.add(policyValue.createMetaDataValue());
        }

        return (ImmutableMetaDataValue) listValue.createImmutable();
    }
View Full Code Here

        // create the
        // key2[0]/true
        //     [1]/false
        //
        // part
        MutableListValue metaList = META_DATA_VALUE_FACTORY.createListValue();
        List list = metaList.getContentsAsMutableList();

        MutableBooleanValue trueBool =
                META_DATA_VALUE_FACTORY.createBooleanValue();
        trueBool.setValue(Boolean.TRUE);
        list.add(trueBool);

        MutableBooleanValue falseBool =
                META_DATA_VALUE_FACTORY.createBooleanValue();
        falseBool.setValue(Boolean.FALSE);
        list.add(falseBool);

        topMap.put("key2", metaList.createImmutable());

        // create the
        // key3/set[0]/keyX/b-string
        //            /keyY/c-string
        //     /set[1]/true
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testWhenCharacteristicIsList() throws Exception {
        // add a policy/policy value pair to the request
        String charateristic = "list";
        MutableListValue value = META_DATA_VALUE_FACTORY.createListValue();
        List list = value.getContentsAsMutableList();
        MutableStringValue strVal = META_DATA_VALUE_FACTORY.createStringValue();
        strVal.setValue("str");
        list.add(strVal.createImmutable());
        ImmutableMetaDataValue listVal = (ImmutableMetaDataValue)
                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(listVal);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
View Full Code Here

     * Test which ensures that when {@link ListValueImpl#getContentsAsList} is
     * called on a {@link MutableListValue} then the returned {@link java.util.List} is
     * immutable.
     */
    public void testGetContentsAsListReturnsImmutableListOnMutable() {
        MutableListValue mutableList = (MutableListValue)
                getMutableInhibitor();
        List list = mutableList.getContentsAsList();
        MetaDataTestCaseHelper.ensureListIsImmutable(list);
    }
View Full Code Here

     * items of the specified class. See
     * {@link com.volantis.shared.metadata.impl.ImmutableGeneratingTypedListTestCase}.</p>
     *
     */
    public void testGetContentsAsMutableListReturnsCorrectList() throws Throwable {
        MutableListValue mutableList = (MutableListValue)
                getMutableInhibitor();
        List list = mutableList.getContentsAsMutableList();

        MetaDataTestCaseHelper.ensureMutableListIsCorrect(list, MetaDataValue.class);
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.value.mutable.MutableListValue

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.