use of org.sirix.service.xml.xpath.expr.LiteralExpr in project sirix by sirixdb.
the class SubOpAxisTest method testOperate.
@Test
public final void testOperate() throws SirixException {
AtomicValue item1 = new AtomicValue(1.0, Type.DOUBLE);
AtomicValue item2 = new AtomicValue(2.0, Type.DOUBLE);
AbstractAxis op1 = new LiteralExpr(holder.getReader(), holder.getReader().getItemList().addItem(item1));
AbstractAxis op2 = new LiteralExpr(holder.getReader(), holder.getReader().getItemList().addItem(item2));
AbstractObAxis axis = new SubOpAxis(holder.getReader(), op1, op2);
assertEquals(true, axis.hasNext());
axis.next();
assertThat(-1.0, is(Double.parseDouble(holder.getReader().getValue())));
assertEquals(holder.getReader().keyForName("xs:double"), holder.getReader().getTypeKey());
assertEquals(false, axis.hasNext());
}
Aggregations