Example usage for org.apache.solr JSONTestUtil DEFAULT_DELTA

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

Introduction

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

Prototype

double DEFAULT_DELTA

To view the source code for org.apache.solr JSONTestUtil DEFAULT_DELTA.

Click Source Link

Document

Default delta used in numeric equality comparisons for floats and doubles.

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  w w  .j ava 2 s.c o  m*/
            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;
}