LiteralExpr extends AbstractExpression { public LiteralExpr(final XmlNodeReadOnlyTrx pRtx, final long pItemKey) { super(pRtx); mLiteralKey = pItemKey; } LiteralExpr(final XmlNodeReadOnlyTrx pRtx, final long pItemKey); @Override void evaluate();  }
@Test public void testLiteralExpr() throws SirixException { final AtomicValue item1 = new AtomicValue(false); final AtomicValue item2 = new AtomicValue(14, Type.INTEGER); final int key1 = holder.getXmlNodeReadTrx().getItemList().addItem(item1); final int key2 = holder.getXmlNodeReadTrx().getItemList().addItem(item2); final AbstractAxis axis1 = new LiteralExpr(holder.getXmlNodeReadTrx(), key1); assertEquals(true, axis1.hasNext()); axis1.next(); assertEquals(key1, holder.getXmlNodeReadTrx().getNodeKey()); assertEquals(holder.getXmlNodeReadTrx().keyForName("xs:boolean"), holder.getXmlNodeReadTrx().getTypeKey()); assertEquals(false, Boolean.parseBoolean(holder.getXmlNodeReadTrx().getValue())); assertEquals(false, axis1.hasNext()); final AbstractAxis axis2 = new LiteralExpr(holder.getXmlNodeReadTrx(), key2); assertEquals(true, axis2.hasNext()); axis2.next(); assertEquals(key2, holder.getXmlNodeReadTrx().getNodeKey()); assertEquals(holder.getXmlNodeReadTrx().keyForName("xs:integer"), holder.getXmlNodeReadTrx().getTypeKey()); assertEquals(14, Integer.parseInt(holder.getXmlNodeReadTrx().getValue())); assertEquals(false, axis2.hasNext()); }