Package org.metagrid.gatekeeper.common.io.test

Examples of org.metagrid.gatekeeper.common.io.test.StringResource


            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<properties xmlns='urn:metagrid'>"
                + "</properties>"
                ).reader(),
            properties
            );
View Full Code Here


        //
        // Create the Iterable reader.
        log.debug("Creating Iterable");
        Iterable<Node> iterable =
            reader.read(
                new StringResource(
                      "<nodes xmlns='urn:metagrid'>"
                    + "  <node ident='urn:node/001' type='urn:metagrid.node'>"
                    + "    <properties>"
                    + "      <property type='urn:metagrid/property/type/frog'>property.frog</property>"
                    + "      <property type='urn:metagrid/property/type/toad'>property.toad</property>"
View Full Code Here

            server.creator()
            );
        //
        // Parse the node XML.
        AppleNode created = creator.read(
            new StringResource(
                "<node xmlns='urn:metagrid' type='urn:metagrid.apple'>"
              + "  <properties>"
              + "    <property type='urn:metagrid.apple.weight'>27</property>"
              + "    <property type='urn:metagrid.fruit.modified'>2008-11-29T06:25:50.379+0000</property>"
              + "  </properties>"
              + "</node>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
        assertEquals(
            "27",
            created.properties().get(
                AppleNode.WEIGHT_PROPERTY_URI
                ).value()
            );
        //
        // Check the AppleBean weight.
        assertEquals(
            new Integer(27),
            created.object().weight()
            );

        //
        // Create our XMLNodeReader.
        final XMLNodeReader<AppleNode> selector = new XMLNodeReaderImpl<AppleNode>(
            server.selector()
            );
        //
        // Parse the node XML to select the AppleBean.
        final AppleNode selected = selector.read(
            new StringResource(
                "<node xmlns='urn:metagrid' ident='" + created.ident() + "' type='urn:metagrid.apple'/>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
View Full Code Here

        //
        // Create the Iterable reader.
        log.debug("Creating Iterable");
        Iterable<Node> iterable =
            reader.read(
                new StringResource(
                      "<!--+"
                    + "    | multi-line comment  "
                    + "    | multi-line comment  "
                    + "    +-->"
                    + "<nodes xmlns='urn:metagrid'>"
View Full Code Here

            server.creator()
            );
        //
        // Parse the node XML to create the AppleBean.
        final AppleNode created = creator.read(
            new StringResource(
                "<node xmlns='urn:metagrid' type='urn:metagrid.apple'>"
              + "  <properties>"
              + "    <property type='urn:metagrid.apple.weight'>27</property>"
              + "    <property type='urn:metagrid.fruit.modified'>2008-11-29T06:25:50.379+0000</property>"
              + "  </properties>"
              + "</node>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
        assertEquals(
            "27",
            created.properties().get(
                AppleNode.WEIGHT_PROPERTY_URI
                ).value()
            );
        //
        // Check the AppleBean weight.
        assertEquals(
            new Integer(27),
            created.object().weight()
            );

        //
        // Create our XMLNodeReader.
        final XMLNodeReader<AppleNode> updator = new XMLNodeReaderImpl<AppleNode>(
            server.updator()
            );
        //
        // Parse the node XML to update the AppleNode.
        final AppleNode updatable = updator.read(
            new StringResource(
                "<node xmlns='urn:metagrid' ident='" + created.ident() + "' type='urn:metagrid.apple'/>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
        assertEquals(
            "27",
            updatable.properties().get(
                AppleNode.WEIGHT_PROPERTY_URI
                ).value()
            );
        //
        // Check the AppleBean weight.
        assertEquals(
            new Integer(27),
            updatable.object().weight()
            );
        //
        // Modify the AppleNode weight.
        updatable.properties().set(
            AppleNode.WEIGHT_PROPERTY_URI,
            "31"
            );
//
// Save (commit) the transaction.
//
        //
        // Create our XMLNodeReader.
        final XMLNodeReader<AppleNode> selector = new XMLNodeReaderImpl<AppleNode>(
            server.selector()
            );
        //
        // Parse the node XML to select the AppleNode.
        final AppleNode selected = selector.read(
            new StringResource(
                "<node xmlns='urn:metagrid' ident='" + created.ident() + "' type='urn:metagrid.apple'/>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
View Full Code Here

        //
        // Create the Iterable reader.
        log.debug("Creating Iterable");
        Iterable<Node> iterable =
            reader.read(
                new StringResource(
                    "<nodes xmlns='urn:metagrid'/>"
                    ).reader()
                );
        //
        // Create the Iterator.
View Full Code Here

            new TestBlock(){
                public void run()
                throws Exception
                    {
                    reader.read(
                        new StringResource(
                              "<properties xmlns='urn:metagrid'>"
                            + "  <unknown></unknown>"
                            + "</properties>"
                            ).reader(),
                        properties
View Full Code Here

        //
        // Create the Iterable reader.
        log.debug("Creating Iterable");
        Iterable<Node> iterable =
            reader.read(
                new StringResource(
                      "<nodes xmlns='urn:metagrid'>"
                    + "  <unknown></unknown>"
                    + "</nodes>"
                    ).reader()
                );
View Full Code Here

            server.creator()
            );
        //
        // Parse the node XML to create the AppleNode.
        final AppleNode created = creator.read(
            new StringResource(
                "<node xmlns='urn:metagrid' type='urn:metagrid.apple'>"
              + "  <properties>"
              + "    <property type='urn:metagrid.apple.weight'>27</property>"
              + "    <property type='urn:metagrid.fruit.modified'>2008-11-29T06:25:50.379+0000</property>"
              + "  </properties>"
              + "</node>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
        assertEquals(
            "27",
            created.properties().get(
                AppleNode.WEIGHT_PROPERTY_URI
                ).value()
            );
        //
        // Check the AppleBean weight.
        assertEquals(
            new Integer(27),
            created.object().weight()
            );

        //
        // Create our XMLNodeReader.
        final XMLNodeReader<AppleNode> updator = new XMLNodeReaderImpl<AppleNode>(
            server.updator()
            );
        //
        // Parse the node XML to update the AppleNode.
        final AppleNode updatable = updator.read(
            new StringResource(
                "<node xmlns='urn:metagrid' ident='" + created.ident() + "' type='urn:metagrid.apple'>"
              + "  <properties>"
              + "    <property type='urn:metagrid.apple.weight'>98</property>"
              + "  </properties>"
              + "</node>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
        assertEquals(
            "98",
            updatable.properties().get(
                AppleNode.WEIGHT_PROPERTY_URI
                ).value()
            );
        //
        // Check the AppleBean weight.
        assertEquals(
            new Integer(98),
            updatable.object().weight()
            );
//
// Save (commit) the transaction.
//

        //
        // Create our XMLNodeReader.
        final XMLNodeReader<AppleNode> selector = new XMLNodeReaderImpl<AppleNode>(
            server.selector()
            );
        //
        // Parse the node XML to select the AppleNode.
        final AppleNode selected = selector.read(
            new StringResource(
                "<node xmlns='urn:metagrid' ident='" + created.ident() + "' type='urn:metagrid.apple'/>"
                ).reader()
            );
        //
        // Check the AppleNode weight.
View Full Code Here

        //
        // Create the Iterable reader.
        log.debug("Creating Iterable");
        Iterable<Node> iterable =
            reader.read(
                new StringResource(
                      "<nodes xmlns='urn:metagrid'>"
                    + "  <node ident='urn:node/001' type='urn:metagrid.node'/>"
                    + "  <unknown></unknown>"
                    + "  <node ident='urn:node/002' type='urn:metagrid.node'/>"
                    + "</nodes>"
View Full Code Here

TOP

Related Classes of org.metagrid.gatekeeper.common.io.test.StringResource

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.