Examples of BooleanValue


Examples of com.volantis.shared.metadata.value.BooleanValue

        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableValue= (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableValue.setValue(Boolean.TRUE);

        BooleanValue newAllowableValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        String allowableKey = "key";
        NumberValue forbiddenValue = (NumberValue) f.getValueFactory().createNumberValue();

        // create the map so that it only allows allowable values and keys
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue originalValue = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        originalValue.setValue(Boolean.TRUE);

        BooleanValue newValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        String key = "key";

        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

     */
    public void testEntrySetIteratorRemoveMethodWorks() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), false);
        typedMap.put(key, value);

        // Get an iterator on the entry set
        Set entrySet = typedMap.entrySet();
        Iterator iter = entrySet.iterator();
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

     */
    public void testEntrySetRemoveMethodWorks() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key2";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), false);
        typedMap.put(key, value);

        // Get the entry from the entry set and remove it
        Set entrySet = typedMap.entrySet();
        Map.Entry entry = (Map.Entry) entrySet.toArray()[0];
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

     * Test that null keys are rejected when they are not allowed.
     */
    public void testNullKeysRejected() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), false);
        try {
            typedMap.put(null, value);
            fail("Expected exception due to null key");
        } catch (IllegalArgumentException e) {
            // Expected.
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

     */
    public void testNullValuesRejected() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), false);
        try {
            typedMap.put(key, null);
            fail("Expected exception due to null value");
        } catch (IllegalArgumentException e) {
            // Expected.
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

     */
    public void testNullValuesAccepted() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), true);
        typedMap.put(key, null);
    }
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

        assertEquals("", error.getLocation());
        assertEquals(numberValue, error.getInvalidValue());
        assertNull(error.getConstraint());

        // invalid type
        BooleanValue booleanValue = VALUE_FACTORY.createBooleanValue();
        errors = numberType.verify(booleanValue);
        assertEquals(1, errors.size());
        error = (VerificationError) errors.iterator().next();
        assertEquals(VerificationError.TYPE_INVALID_IMPLEMENTATION,
            error.getType());
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

        MutableBooleanValue booleanValue = MetaDataFactory.getDefaultInstance().
                getValueFactory().createBooleanValue();
        typedList.add(booleanValue);

        BooleanValue obtainedBooleanValue = (BooleanValue) typedList.get(0);

        if (obtainedBooleanValue instanceof ImmutableInhibitor == false) {
            fail("the returned value should be an implementation of an " +
                    "ImmutableMetaDataOobject, was " + obtainedBooleanValue.getClass());
        }
    }
View Full Code Here

Examples of com.volantis.shared.metadata.value.BooleanValue

        // check that the list iterator will store this new value as an immutable object
        iterator.next();
        iterator.set(booleanValue2);

        // Get the value stored in index 1
        BooleanValue obtainedBooleanValue = (BooleanValue) typedList.get(0);

        // check that the new value set at index 1 is value 2
        assertEquals("The new value at index 1 should be " + booleanValue2,
                booleanValue2, obtainedBooleanValue);

        // check that it is immutable
        if (obtainedBooleanValue instanceof ImmutableInhibitor == false) {
            fail("the returned value should be an implementation of an " +
                    "ImmutableMetaDataOobject, was " + obtainedBooleanValue.getClass());
        }
    }
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.