Package com.volantis.shared.metadata

Examples of com.volantis.shared.metadata.MetaDataFactory


    /**
     * Test that null values are rejected when they are not allowed.
     */
    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 {
View Full Code Here


    /**
     * Test that null keys are accepted when they are allowed.
     */
    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

    /**
     * Tests that the typed list only accepts allowable types.
     */
    public void testSetOnlyStoresAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

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

        TypedSet typedSet = new TypedSet(new HashSet(), BooleanValue.class);

        try {
View Full Code Here

    /**
     * Tests that the typed list only accepts allowable types.
     */
    public void testListOnlyStoresAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

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

        TypedList typedList = new TypedList(new ArrayList(), BooleanValue.class);

        try {
View Full Code Here

     * Tests that we are not allowed to add objects of the wrong type, and are
     * allowed to add objects of the correct type on the <code>ListIterator</code>
     * provided by {@link TypedList#iterator}.
     */
    public void testIteratorOnlyAddsAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

        NumberValue unallowableObject = (NumberValue) f.getValueFactory()
            .createNumberValue();
        TypedList typedList = new TypedList(new ArrayList(), BooleanValue.class);
        ListIterator iterator = typedList.listIterator();

        // check that the list iterator will allow an permitted type to be added
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.