@Test public void testCompare() throws TTXPathException { 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.getNRtx(), new LiteralExpr(holder.getNRtx(), -2), new LiteralExpr(holder .getNRtx(), -1), CompKind.PRE); comparator.compare(op1, op2); Assert.fail("Expexcted not yet implemented exception."); } catch (IllegalStateException e) { assertEquals("Evaluation of node comparisons not possible", e.getMessage()); } try { comparator = new NodeComp(holder.getNRtx(), new LiteralExpr(holder.getNRtx(), -2), new LiteralExpr(holder .getNRtx(), -1), CompKind.FO); comparator.compare(op1, op2); Assert.fail("Expexcted not yet implemented exception."); } catch (IllegalStateException e) { assertEquals("Evaluation of node comparisons not possible", e.getMessage()); } }
@Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws TTXPathException { 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 extends AbsComparator { @Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws TTXPathException { 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 extends AbsComparator { @Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws TTXPathException { 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 INodeReadTrx rtx, final AbsAxis mOperand1, final AbsAxis mOperand2,
        final CompKind mComp); }
NodeComp extends AbsComparator { @Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws TTXPathException { 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 INodeReadTrx rtx, final AbsAxis mOperand1, final AbsAxis mOperand2,
        final CompKind mComp);  }
NodeComp extends AbsComparator { @Override protected boolean compare(final AtomicValue[] mOperand1, final AtomicValue[] mOperand2) throws TTXPathException { 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 INodeReadTrx rtx, final AbsAxis mOperand1, final AbsAxis mOperand2,
        final CompKind mComp);   }