FutureAxis extends AbstractTemporalAxis<R, W> { @Override public ResourceManager<R, W> getResourceManager() { return mResourceManager; } FutureAxis(final ResourceManager<R, W> resourceManager, final R rtx);  FutureAxis(final ResourceManager<R, W> resourceManager, final R rtx, final IncludeSelf includeSelf); @Override ResourceManager<R, W> getResourceManager();  }
@Test public void testFutureOrSelfAxis() { final XmlNodeReadOnlyTrx firstRtx = holder.getResourceManager().beginNodeReadOnlyTrx(1); final XmlNodeReadOnlyTrx secondRtx = holder.getResourceManager().beginNodeReadOnlyTrx(2); final XmlNodeReadOnlyTrx thirdRtx = holder.getXmlNodeReadTrx(); new IteratorTester<>(ITERATIONS, IteratorFeature.UNMODIFIABLE, ImmutableList.of(firstRtx, secondRtx, thirdRtx), null) { @Override protected Iterator<XmlNodeReadOnlyTrx> newTargetIterator() { return new FutureAxis<>(firstRtx.getResourceManager(), firstRtx, IncludeSelf.YES); } }.test(); }
@Test public void testAxisWithDeletedNode() { try (final XmlNodeTrx wtx = holder.getResourceManager().beginNodeTrx()) { wtx.moveTo(4); wtx.insertCommentAsRightSibling("foooooo"); wtx.commit(); wtx.moveTo(4); wtx.remove(); wtx.commit(); } try (final XmlNodeReadOnlyTrx thirdReader = holder.getResourceManager().beginNodeReadOnlyTrx(3); final XmlNodeReadOnlyTrx fourthReader = holder.getResourceManager().beginNodeReadOnlyTrx(4)) { thirdReader.moveTo(4); fourthReader.moveTo(4); new IteratorTester<>(ITERATIONS, IteratorFeature.UNMODIFIABLE, ImmutableList.of(thirdReader, fourthReader), null) { @Override protected Iterator<XmlNodeReadOnlyTrx> newTargetIterator() { return new FutureAxis<>(thirdReader.getResourceManager(), thirdReader, IncludeSelf.YES); } }.test(); } }