Package org.metagrid.gatekeeper.node.property

Examples of org.metagrid.gatekeeper.node.property.PropertyMap


    public void testGenericProperties()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<properties xmlns='urn:metagrid'>"
                + "  <property type='urn:metagrid/property/type/frog'>property.frog</property>"
                + "  <property type='urn:metagrid/property/type/toad'>property.toad</property>"
                + "</properties>"
                ).reader(),
            properties
            );
        //
        // Check the property values.
        assertEquals(
            "property.frog",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/frog"
                    )
                ).value()
            );
        assertEquals(
            "property.toad",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/toad"
                    )
                ).value()
            );
View Full Code Here


    public void testSkipComments()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<!-- skip this comment -->"
                + "<properties xmlns='urn:metagrid'>"
                + "  <!-- skip this comment -->"
                + "  <property type='urn:metagrid/property/type/frog'>property.frog</property>"
                + "  <!-- skip this comment -->"
                + "  <property type='urn:metagrid/property/type/toad'>property.toad</property>"
                + "  <!-- skip this comment -->"
                + "</properties>"
                + "<!-- skip this comment -->"
                ).reader(),
            properties
            );
        //
        // Check the property values.
        assertEquals(
            "property.frog",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/frog"
                    )
                ).value()
            );
        assertEquals(
            "property.toad",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/toad"
                    )
                ).value()
            );
View Full Code Here

    public void testEmptySet()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<properties xmlns='urn:metagrid'>"
                + "</properties>"
                ).reader(),
            properties
            );
        //
        // Create the Iterator.
        Iterator<Property> iterator = properties.iterator();
        //
        // Check the set is empty.
        assertFalse(
            iterator.hasNext()
            );
View Full Code Here

    public void testUnknownElement()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
View Full Code Here

TOP

Related Classes of org.metagrid.gatekeeper.node.property.PropertyMap

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.