Examples of ArraySizeComparator


Examples of org.skyscreamer.jsonassert.comparator.ArraySizeComparator

    doTest("a", new ArrayValueMatcher<Object>(comparator, 0), "{a:[[6,7,8]]}", ARRAY_OF_JSONARRAYS);
  }

  @Test
  public void matchesSizeOfFirstThreeInnerArrays() throws JSONException {
    JSONComparator innerArraySizeComparator = new ArraySizeComparator(JSONCompareMode.STRICT_ORDER);
    doTest("a", new ArrayValueMatcher<Object>(innerArraySizeComparator, 0, 2), "{a:[[3]]}", ARRAY_OF_JSONARRAYS);
  }
View Full Code Here

Examples of org.skyscreamer.jsonassert.comparator.ArraySizeComparator

    doTest("a", new ArrayValueMatcher<Object>(innerArraySizeComparator, 0, 2), "{a:[[3]]}", ARRAY_OF_JSONARRAYS);
  }

  @Test
  public void failsWhenInnerArraySizeDoesNotMatch() throws JSONException {
    JSONComparator innerArraySizeComparator = new ArraySizeComparator(JSONCompareMode.STRICT_ORDER);
    doFailingMatchTest("a",
        new ArrayValueMatcher<Object>(innerArraySizeComparator),
        "{a:[[3]]}",
        ARRAY_OF_JSONARRAYS,
        "a\\[3\\]\\[\\]\\s*Expected:\\s*array size of 3 elements\\s*got:\\s*4 elements\\s*");
 
View Full Code Here

Examples of org.skyscreamer.jsonassert.comparator.ArraySizeComparator

     JSONAssert.assertEquals("{a:[{background:white},{background:grey}]}", ARRAY_OF_JSONOBJECTS, new CustomComparator(JSONCompareMode.LENIENT, customization));
  }
 
  @Test
  public void verifyEveryElementOfArrayIsJSONArrayOfLength3() throws JSONException {
     JSONComparator comparator = new ArraySizeComparator(JSONCompareMode.STRICT_ORDER);
     Customization customization = new Customization("a", new ArrayValueMatcher<Object>(comparator, 0, 2));
     JSONAssert.assertEquals("{a:[[3]]}", ARRAY_OF_JSONARRAYS, new CustomComparator(JSONCompareMode.LENIENT, customization));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.