Example usage for org.apache.commons.jxpath.ri.model NodePointer compareTo

List of usage examples for org.apache.commons.jxpath.ri.model NodePointer compareTo

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri.model NodePointer compareTo.

Prototype

public int compareTo(Object object) 

Source Link

Usage

From source file:org.firesoa.common.jxpath.JXPathTestCase.java

protected void assertDocumentOrder(JXPathContext context, String path1, String path2, int expected) {
    NodePointer np1 = (NodePointer) context.getPointer(path1);
    NodePointer np2 = (NodePointer) context.getPointer(path2);
    int res = np1.compareTo(np2);
    if (res < 0) {
        res = -1;// w w w.  ja  v a  2s.  co m
    } else if (res > 0) {
        res = 1;
    }
    assertEquals("Comparing paths '" + path1 + "' and '" + path2 + "'", expected, res);
}