org.apache.solr
Class JSONTestUtil
java.lang.Object
org.apache.solr.JSONTestUtil
public class JSONTestUtil
- extends Object
|
Field Summary |
static double |
DEFAULT_DELTA
Default delta used in numeric equality comparisons for floats and doubles. |
|
Method Summary |
static String |
match(String input,
String pathAndExpected)
comparison using default delta |
static String |
match(String input,
String pathAndExpected,
double delta)
|
static String |
match(String path,
String input,
String expected)
comparison using default delta |
static String |
match(String path,
String input,
String expected,
double delta)
|
static String |
matchObj(String path,
Object input,
Object expected)
comparison using default delta |
static String |
matchObj(String path,
Object input,
Object expected,
double delta)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_DELTA
public static final double DEFAULT_DELTA
- Default delta used in numeric equality comparisons for floats and doubles.
- See Also:
- Constant Field Values
JSONTestUtil
public JSONTestUtil()
match
public static String match(String input,
String pathAndExpected)
throws Exception
- comparison using default delta
- Throws:
Exception- See Also:
DEFAULT_DELTA,
match(String,String,double)
match
public static String match(String path,
String input,
String expected)
throws Exception
- comparison using default delta
- Throws:
Exception- See Also:
DEFAULT_DELTA,
match(String,String,String,double)
matchObj
public static String matchObj(String path,
Object input,
Object expected)
throws Exception
- comparison using default delta
- Throws:
Exception- See Also:
DEFAULT_DELTA,
matchObj(String,Object,Object,double)
match
public static String match(String input,
String pathAndExpected,
double delta)
throws Exception
- Parameters:
input - JSON Structure to parse and test againstpathAndExpected - JSON path expression + '==' + expected valuedelta - tollerance allowed in comparing float/double values
- Throws:
Exception
match
public static String match(String path,
String input,
String expected,
double delta)
throws Exception
- Parameters:
path - JSON path expressioninput - JSON Structure to parse and test againstexpected - expected value of pathdelta - tollerance allowed in comparing float/double values
- Throws:
Exception
matchObj
public static String matchObj(String path,
Object input,
Object expected,
double delta)
- Parameters:
path - JSON path expressioninput - JSON Structureexpected - expected JSON Objectdelta - tollerance allowed in comparing float/double values
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.