PastAxis extends AbstractTemporalAxis<R, W> { @Override public ResourceManager<R, W> getResourceManager() { return mResourceManager; } PastAxis(final ResourceManager<R, W> resourceManager, final R rtx);  PastAxis(final ResourceManager<R, W> resourceManager, final R rtx, final IncludeSelf includeSelf); @Override ResourceManager<R, W> getResourceManager();  }
@Test public void testPastOrSelfAxis() { 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(thirdRtx, secondRtx, firstRtx), null) { @Override protected Iterator<XmlNodeReadOnlyTrx> newTargetIterator() { return new PastAxis<>(thirdRtx.getResourceManager(), thirdRtx, IncludeSelf.YES); } }.test(); }
@Test public void testPastAxisWithRemovedNode() { try (final XmlNodeTrx wtx = holder.getResourceManager().beginNodeTrx()) { wtx.commit(); wtx.commit(); } try (final XmlNodeReadOnlyTrx thirdReader = holder.getResourceManager().beginNodeReadOnlyTrx(3); final XmlNodeReadOnlyTrx fourthReader = holder.getResourceManager().beginNodeReadOnlyTrx(4); final XmlNodeReadOnlyTrx fifthReader = holder.getResourceManager().beginNodeReadOnlyTrx(5)) { thirdReader.moveTo(16); fourthReader.moveTo(16); fifthReader.moveTo(16); new IteratorTester<>(ITERATIONS, IteratorFeature.UNMODIFIABLE, ImmutableList.of(fifthReader, fourthReader, thirdReader), null) { @Override protected Iterator<XmlNodeReadOnlyTrx> newTargetIterator() { return new PastAxis<>(fifthReader.getResourceManager(), fifthReader, IncludeSelf.YES); } }.test(); } }