Example usage for org.apache.solr JSONTestUtil matchObj

List of usage examples for org.apache.solr JSONTestUtil matchObj

Introduction

In this page you can find the example usage for org.apache.solr JSONTestUtil matchObj.

Prototype

public static String matchObj(String path, Object input, Object expected, double delta) 

Source Link

Usage

From source file:org.vootoo.search.function.RandomValueSourceParserTest.java

License:Apache License

private boolean assertNotSameSum(Object inputObj) {
    int sameSum = 0;
    for (int i = 0; i < 4; i++) {
        String err = JSONTestUtil.matchObj("response/docs/[" + i + "]/id", inputObj, i + 1,
                JSONTestUtil.DEFAULT_DELTA);
        if (err != null) {
            //System.out.println(err);
        } else {/*from  w  ww. j  a v a2 s .com*/
            sameSum += 1;
        }
    }
    if (sameSum == 4) {
        logger.warn("sort rand maybe fail, sameSum=" + sameSum);
    } else {
        logger.info("sort randed=" + (sameSum < 4) + " sameSum=" + sameSum);
    }
    //Assert.assertTrue("not rand, sameSum="+sameSum+", total=4", sameSum < 4);
    return sameSum < 4;
}