Package javax.jcr

Examples of javax.jcr.NodeIterator.skip()


                long expected = j + i;
                assertEquals("Wrong node after skip()", expected, propValue);
            }
            try {
                NodeIterator it = result.getNodes();
                it.skip(it.getSize() + 1);
                fail("must throw NoSuchElementException");
            } catch (NoSuchElementException e) {
                // correct
            }
            // remove node for the next iteration
View Full Code Here


    public void testOffsetAndSkip() throws Exception {
        query.setOffset(1);
        QueryResult result = query.execute();
        NodeIterator nodes = result.getNodes();
        nodes.skip(1);
        assertTrue(nodes.nextNode() == node3);
    }

    public void testOffsetAndLimitWithGetSize() throws Exception {
        query.setOffset(1);
View Full Code Here

        }
        if (count > 1) {
            // re-aquire iterator
            it = rs.getNodes();
            // skip all but one
            it.skip(count - 1);
            // get last one
            it.nextNode();
            try {
                it.nextNode();
                fail("nextNode() must throw a NoSuchElementException when no nodes are available");
View Full Code Here

            }

            // re-aquire iterator
            it = rs.getNodes();
            try {
                it.skip(count + 1);
                fail("skip() must throw a NoSuchElementException if one tries to skip past the end of the iterator");
            } catch (NoSuchElementException e) {
                // success
            }
        }
View Full Code Here

    public void testOffsetAndSkip() throws Exception {
        query.setOffset(1);
        QueryResult result = query.execute();
        NodeIterator nodes = result.getNodes();
        nodes.skip(1);
        assertTrue(node3.isSame(nodes.nextNode()));
    }

    public void testOffsetAndLimitWithGetSize() throws Exception {
        query.setOffset(1);
View Full Code Here

    public void testOffsetAndSkip() throws Exception {
        query.setOffset(1);
        QueryResult result = query.execute();
        NodeIterator nodes = result.getNodes();
        nodes.skip(1);
        assertTrue(nodes.nextNode() == node3);
    }

    public void testOffsetAndLimitWithGetSize() throws Exception {
        query.setOffset(1);
View Full Code Here

        if (count > 1) {
            // re-execute the query
            rs = execute(query, Query.XPATH);
            it = rs.getNodes();
            // skip all but one
            it.skip(count - 1);
            // get last one
            it.nextNode();
            try {
                it.nextNode();
                fail("nextNode() must throw a NoSuchElementException when no nodes are available");
View Full Code Here

            // re-execute the query
            rs = execute(query, Query.XPATH);
            it = rs.getNodes();
            try {
                it.skip(count + 1);
                fail("skip() must throw a NoSuchElementException if one tries to skip past the end of the iterator");
            } catch (NoSuchElementException e) {
                // success
            }
        }
View Full Code Here

    public void testOffsetAndSkip() throws Exception {
        query.setOffset(1);
        QueryResult result = query.execute();
        NodeIterator nodes = result.getNodes();
        nodes.skip(1);
        assertTrue(nodes.nextNode() == node3);
    }

    public void testOffsetAndLimitWithGetSize() throws Exception {
        query.setOffset(1);
View Full Code Here

        }
        if (count > 1) {
            // re-aquire iterator
            it = rs.getNodes();
            // skip all but one
            it.skip(count - 1);
            // get last one
            it.nextNode();
            try {
                it.nextNode();
                fail("nextNode() must throw a NoSuchElementException when no nodes are available");
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.