Examples of moveDown()


Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        assertEquals(new Path("/a"), pathTracker.getPath());

        reader.moveDown();
        assertEquals(new Path("/a/b"), pathTracker.getPath());

        reader.moveDown();
        assertEquals(new Path("/a/b/c"), pathTracker.getPath());

        reader.moveUp();
        assertEquals(new Path("/a/b"), pathTracker.getPath());
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        reader.moveUp();
        assertEquals(new Path("/a/b"), pathTracker.getPath());

        reader.moveUp();
        reader.moveDown();
        assertEquals(new Path("/a/b[2]"), pathTracker.getPath());

        reader.moveUp();
        reader.moveDown();
        assertEquals(new Path("/a/d"), pathTracker.getPath());
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        reader.moveUp();
        reader.moveDown();
        assertEquals(new Path("/a/b[2]"), pathTracker.getPath());

        reader.moveUp();
        reader.moveDown();
        assertEquals(new Path("/a/d"), pathTracker.getPath());

        reader.moveUp();
        assertEquals(new Path("/a"), pathTracker.getPath());
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        xmlReader.moveDown();
        assertEquals("some getValue!", xmlReader.getValue());
        xmlReader.moveUp();

        xmlReader.moveDown();
        assertEquals("more", xmlReader.getValue());
        xmlReader.moveUp();
    }

    public void testDoesNotIgnoreWhitespaceAroundText() throws Exception {
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        assertEquals("world", xmlReader.getAttribute(0));
        assertEquals("b", xmlReader.getAttribute(1));
        assertEquals("d", xmlReader.getAttribute(2));

        xmlReader.moveDown();
        assertEquals("empty", xmlReader.getNodeName());
        assertEquals(0, xmlReader.getAttributeCount());
    }

    public void testExposesAttributesKeysAsIterator() throws Exception {
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        assertEquals("root", xmlReader.getNodeName());
        assertEquals("", xmlReader.getValue());
        assertTrue(xmlReader.hasMoreChildren());

        xmlReader.moveDown(); // at: /root/child
        assertEquals("child", xmlReader.getNodeName());
        assertEquals(null, xmlReader.getAttribute("something"));
        assertEquals("", xmlReader.getValue());

        assertFalse(xmlReader.hasMoreChildren()); // <--- This is an awkward one for pull parsers
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        xmlReader.moveUp(); // at: /root

        assertTrue(xmlReader.hasMoreChildren());

        xmlReader.moveDown(); // at: /root/sibling
        assertEquals("sibling", xmlReader.getNodeName());
        assertEquals("text2", xmlReader.getValue());
        assertFalse(xmlReader.hasMoreChildren());
        xmlReader.moveUp(); // at: /root
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

    public void testExposesTextValueOfCurrentElementButNotChildren() throws Exception {
        HierarchicalStreamReader xmlReader
                = createReader("<root>hello<child>FNARR</child></root>");

        assertEquals("hello", xmlReader.getValue());
        xmlReader.moveDown();
        assertEquals("FNARR", xmlReader.getValue());
    }

    public void testCanReadLineFeedInString() throws Exception {
        HierarchicalStreamReader xmlReader = createReader("<string>a\nb</string>");
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

                "</big>");
        Element small = document.getRootElement().element("small");

        HierarchicalStreamReader xmlReader = new Dom4JReader(small);
        assertEquals("small", xmlReader.getNodeName());
        xmlReader.moveDown();
        assertEquals("tiny", xmlReader.getNodeName());
    }

}
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown()

        // deserialize
        HierarchicalStreamReader reader = new XppReader(new StringReader(buffer.toString()));

        assertTrue("should be another object to read (1)", reader.hasMoreChildren());
        reader.moveDown();
        assertEquals(new Person("Postman", "Pat"), xstream.unmarshal(reader));
        reader.moveUp();

        assertTrue("should be another object to read (2)", reader.hasMoreChildren());
        reader.moveDown();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.