134135136137138139140141142143144
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");
148149150151152153154155156157158
// 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 } }
101102103104105106107108109110111
count++; } if (count > 0) { // re-aquire iterator iter = testRootNode.getNodes(); iter.skip(count); try { iter.nextNode(); fail("nextNode() must throw a NoSuchElementException when no nodes are available"); } catch (NoSuchElementException e) { // success
112113114115116117118119120121122
} // re-aquire iterator iter = testRootNode.getNodes(); try { iter.skip(count + 1); fail("skip() must throw a NoSuchElementException if one tries to skip past the end of the iterator"); } catch (NoSuchElementException e) { // success } }
132133134135136137138139140141142
} 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");
145146147148149150151152153154155
} // 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 } }
137138139140141142143144145146147
151152153154155156157158159160161
136137138139140141142143144145146
if (count > 1) { // re-execute the query rs = execute(query, qsXPATH); 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");
150151152153154155156157158159160
// re-execute the query rs = execute(query, qsXPATH); 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 } }