use of org.sirix.api.XdmNodeReadTrx in project sirix by sirixdb.
the class PostOrderTest method testIterateWhole.
@Test
public void testIterateWhole() throws SirixException {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveToDocumentRoot();
AbsAxisTest.testIAxisConventions(new PostOrderAxis(rtx), new long[] { 4L, 6L, 7L, 5L, 8L, 11L, 12L, 9L, 13L, 1L, 0L });
new IteratorTester<Long>(ITERATIONS, IteratorFeature.UNMODIFIABLE, ImmutableList.of(4L, 6L, 7L, 5L, 8L, 11L, 12L, 9L, 13L, 1L, 0L), null) {
@Override
protected Iterator<Long> newTargetIterator() {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveToDocumentRoot();
return new PostOrderAxis(rtx);
}
}.test();
}
use of org.sirix.api.XdmNodeReadTrx in project sirix by sirixdb.
the class PostOrderTest method testIterateFirstSubtree.
@Test
public void testIterateFirstSubtree() throws SirixException {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(5L);
AbsAxisTest.testIAxisConventions(new PostOrderAxis(rtx), new long[] { 6L, 7L });
new IteratorTester<Long>(ITERATIONS, IteratorFeature.UNMODIFIABLE, ImmutableList.of(6L, 7L), null) {
@Override
protected Iterator<Long> newTargetIterator() {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(5L);
return new PostOrderAxis(rtx);
}
}.test();
}
use of org.sirix.api.XdmNodeReadTrx in project sirix by sirixdb.
the class PostOrderTest method testIterateZero.
@Test
public void testIterateZero() throws SirixException {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(8L);
AbsAxisTest.testIAxisConventions(new PostOrderAxis(rtx), new long[] {});
new IteratorTester<Long>(ITERATIONS, IteratorFeature.UNMODIFIABLE, Collections.emptyList(), null) {
@Override
protected Iterator<Long> newTargetIterator() {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(8L);
return new PostOrderAxis(rtx);
}
}.test();
}
use of org.sirix.api.XdmNodeReadTrx in project sirix by sirixdb.
the class PrecedingAxisTest method testAxisConventions.
@Test
public void testAxisConventions() throws SirixException {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(12L);
AbsAxisTest.testIAxisConventions(new PrecedingAxis(rtx), new long[] { 11L, 8L, 7L, 6L, 5L, 4L });
rtx.moveTo(5L);
AbsAxisTest.testIAxisConventions(new PrecedingAxis(rtx), new long[] { 4L });
rtx.moveTo(13L);
AbsAxisTest.testIAxisConventions(new PrecedingAxis(rtx), new long[] { 12L, 11L, 9L, 8L, 7L, 6L, 5L, 4L });
rtx.moveTo(1L);
AbsAxisTest.testIAxisConventions(new PrecedingAxis(rtx), new long[] {});
rtx.moveTo(9L);
rtx.moveToAttribute(0);
AbsAxisTest.testIAxisConventions(new PrecedingAxis(rtx), new long[] {});
}
use of org.sirix.api.XdmNodeReadTrx in project sirix by sirixdb.
the class SelfAxisTest method testIterate.
@Test
public void testIterate() throws SirixException {
final XdmNodeReadTrx rtx = holder.getReader();
rtx.moveTo(4L);
AbsAxisTest.testIAxisConventions(new SelfAxis(rtx), new long[] { 4L });
rtx.moveTo(8L);
AbsAxisTest.testIAxisConventions(new SelfAxis(rtx), new long[] { 8L });
}
Aggregations