org.apache.solr

## Class JSONTestUtil

- java.lang.Object
- - org.apache.solr.JSONTestUtil

-     public class JSONTestUtil
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `DEFAULT_DELTA` Default delta used in numeric equality comparisons for floats and doubles.
    `static boolean` | `failRepeatedKeys`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONTestUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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(Object input, String pathAndExpected, 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`

- - ### Field Detail

    - #### DEFAULT_DELTA

          public static final double DEFAULT_DELTA

      Default delta used in numeric equality comparisons for floats and doubles.
      See Also:
        Constant Field Values

    - #### failRepeatedKeys

          public static boolean failRepeatedKeys

  - ### Constructor Detail

    - #### JSONTestUtil

          public JSONTestUtil()

  - ### Method Detail

    - #### 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 against
        `pathAndExpected` - JSON path expression + '==' + expected value
        `delta` - tollerance allowed in comparing float/double values
      Throws:
        `Exception`

    - #### matchObj

          public static String matchObj(Object input,
                                        String pathAndExpected,
                                        double delta)
                                 throws Exception

      Parameters:
        `input` - Object structure to parse and test against
        `pathAndExpected` - JSON path expression + '==' + expected value
        `delta` - 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 expression
        `input` - JSON Structure to parse and test against
        `expected` - expected value of path
        `delta` - 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 expression
        `input` - JSON Structure
        `expected` - expected JSON Object
        `delta` - tollerance allowed in comparing float/double values

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.