VarRefExpr extends AbstractExpression implements IObserver { @Override public void update(final long pVarKey) { mVarKey = pVarKey; reset(mVarKey); } VarRefExpr(final XmlNodeReadOnlyTrx pRtx, @Nonnull final VariableAxis pVariable); @Override void update(final long pVarKey); @Override void evaluate();  }
@Test public void testEveryExpr() throws SirixException { final AbstractAxis axis = new XPathAxis(holder.getXmlNodeReadTrx(), "for $a in b return $a"); final VariableAxis variable = new VariableAxis(holder.getXmlNodeReadTrx(), axis); final VarRefExpr axis1 = new VarRefExpr(holder.getXmlNodeReadTrx(), variable); axis1.update(5L); assertEquals(true, axis1.hasNext()); axis1.next(); assertEquals(5L, holder.getXmlNodeReadTrx().getNodeKey()); axis1.update(13L); assertEquals(true, axis1.hasNext()); axis1.next(); assertEquals(13L, holder.getXmlNodeReadTrx().getNodeKey()); axis1.update(1L); assertEquals(true, axis1.hasNext()); axis1.next(); assertEquals(1L, holder.getXmlNodeReadTrx().getNodeKey()); assertEquals(false, axis1.hasNext()); final VarRefExpr axis2 = new VarRefExpr(holder.getXmlNodeReadTrx(), variable); axis2.update(13L); assertEquals(true, axis2.hasNext()); axis2.next(); assertEquals(13L, holder.getXmlNodeReadTrx().getNodeKey()); assertEquals(false, axis2.hasNext()); axis2.update(12L); assertEquals(true, axis2.hasNext()); axis2.next(); assertEquals(12L, holder.getXmlNodeReadTrx().getNodeKey()); assertEquals(false, axis2.hasNext()); }