Package org.apache.solr
Class JSONTestUtil
java.lang.Object
org.apache.solr.JSONTestUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault delta used in numeric equality comparisons for floats and doubles.static boolean -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_DELTA
public static final double DEFAULT_DELTADefault delta used in numeric equality comparisons for floats and doubles.- See Also:
-
failRepeatedKeys
public static boolean failRepeatedKeys
-
-
Constructor Details
-
JSONTestUtil
public JSONTestUtil()
-
-
Method Details
-
match
comparison using default delta- Throws:
IOException- See Also:
-
match
comparison using default delta- Throws:
IOException- See Also:
-
matchObj
comparison using default delta- Throws:
IOException- See Also:
-
match
- Parameters:
input- JSON Structure to parse and test againstpathAndExpected- JSON path expression + '==' + expected valuedelta- tolerance allowed in comparing float/double values- Throws:
IOException
-
matchObj
public static String matchObj(Object input, String pathAndExpected, double delta) throws IOException - Parameters:
input- Object structure to parse and test againstpathAndExpected- JSON path expression + '==' + expected valuedelta- tolerance allowed in comparing float/double values- Throws:
IOException
-
match
public static String match(String path, String input, String expected, double delta) throws IOException - Parameters:
path- JSON path expressioninput- JSON Structure to parse and test againstexpected- expected value of pathdelta- tolerance allowed in comparing float/double values- Throws:
IOException
-
matchObj
- Parameters:
path- JSON path expressioninput- JSON Structureexpected- expected JSON Objectdelta- tolerance allowed in comparing float/double values- Returns:
- the error message from the match, or null if match was good
-