NodeComp extends AbstractComparator { @Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws SirixXPathException { final String op1 = new String(mOperand1[0].getRawValue()); final String op2 = new String(mOperand2[0].getRawValue()); return getCompKind().compare( op1, op2, getType(mOperand1[0].getTypeKey(), mOperand2[0].getTypeKey())); } NodeComp(final XmlNodeReadOnlyTrx rtx, final Axis mOperand1, final Axis mOperand2,
      final CompKind mComp);   }
@Test public void testCompare() throws SirixXPathException { AtomicValue[] op1 = {new AtomicValue(2, Type.INTEGER)}; AtomicValue[] op2 = {new AtomicValue(3, Type.INTEGER)}; AtomicValue[] op3 = {new AtomicValue(3, Type.INTEGER)}; assertEquals(false, comparator.compare(op1, op2)); assertEquals(true, comparator.compare(op3, op2)); try { comparator = new NodeComp(holder.getXmlNodeReadTrx(), new LiteralExpr(holder.getXmlNodeReadTrx(), -2), new LiteralExpr(holder.getXmlNodeReadTrx(), -1), CompKind.PRE); comparator.compare(op1, op2); fail("Expexcted not yet implemented exception."); } catch (IllegalStateException e) { assertEquals("Evaluation of node comparisons not possible", e.getMessage()); } try { comparator = new NodeComp(holder.getXmlNodeReadTrx(), new LiteralExpr(holder.getXmlNodeReadTrx(), -2), new LiteralExpr(holder.getXmlNodeReadTrx(), -1), CompKind.FO); comparator.compare(op1, op2); fail("Expexcted not yet implemented exception."); } catch (IllegalStateException e) { assertEquals("Evaluation of node comparisons not possible", e.getMessage()); } }