Package com.volantis.shared.metadata.value

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


     */
    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

     */
    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

     * 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

     */
    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

     */
    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

        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

        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

        // 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

    public boolean equals(Object obj) {
        if (!(obj instanceof BooleanValue)) {
            return false;
        }

        BooleanValue other = (BooleanValue) obj;

        return value == other.getValueAsBoolean().booleanValue();
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.value.BooleanValue

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.