Package com.volantis.shared.metadata

Examples of com.volantis.shared.metadata.MetaDataFactory


    /**
     * Tests that the typed list only accepts allowable types.
     */
    public void testMapOnlyStoresAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue allowableValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        Object forbiddenValue = new Integer(1);

        // create the map so that it only allows allowable values and keys
        TypedMap typedMap = createTypedMap(new HashMap(),
View Full Code Here


    /**
     * This tests that the containsValue method will only work if the value is of the
     * permitted type.
     */
    public void testContainsValueOnlyAcceptsAllowableValues() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String allowableKey = "key";

        BooleanValue allowableValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        Object forbiddenValue = new Integer(1);

        // create the map so that it only allows allowable values and keys
        TypedMap typedMap = createTypedMap(new HashMap(),
View Full Code Here

    /**
     * This tests that the containsKey method will only work if the key is of the
     * permitted type.
     */
    public void testContainsKeyOnlyAcceptsAllowableKeys() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String allowableKey = "key";

        BooleanValue allowableValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        Object forbiddenKey = new Integer(2);
        // create the map so that it only allows allowable values and keys
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           allowableValue.getClass(), false);
View Full Code Here

    /**
     * This tests that the remove method will only work if the key is of the
     * permitted type.
     */
    public void testRemoveAcceptsAllowableValues() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String allowableKey = "key";

        BooleanValue allowableValue = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        Object forbiddenValue = new Integer(1);
        // create the map so that it only allows allowable values and keys
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           allowableValue.getClass(), false);
View Full Code Here

    /**
     * This tests that the get method will only work if the key is of the
     * permitted type.
     */
    public void testGetOnlyAcceptsAllowableKeys() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableValue = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        String allowableKey = "key";

        NumberValue forbiddenKey = (NumberValue) f.getValueFactory()
            .createNumberValue();

        // create the map so that it only allows allowable values and keys
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           allowableValue.getClass(), false);
View Full Code Here

     * This test ensures that when entrySet() is called, then the provided Iterator will
     * not allow callers to use setValue on the <code>Map.Entry</code> object with
     * forbidden types, but will allow callers to setValue with an allowed type.
     */
    public void testEntrySetIteratorWillOnlyAllowCorrectType() {
        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
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           allowableValue.getClass(), false);

View Full Code Here

    /**
     * This test ensures that when entrySet() is called, the set returned is backed by the
     * <code>TypedMap</code>.
     */
    public void testEntrySetIteratorEffectsTheSet() {
        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

    /**
     * This test ensures that when entrySet() is called, the remove() method of the
     * iterator works correctly.
     */
    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);
View Full Code Here

    /**
     * This test ensures that when entrySet() is called, the remove() method works.
     */
    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);
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 {
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.MetaDataFactory

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.