Compares to JSON documents. Throws {@link AssertionError} if they are different.
519558
public static void assertJsonEquals(Object expected, Object actual, Configuration configuration) {
        assertJsonPartEquals(expected, actual, ROOT, configuration);
    }
1278162
public static void assertXMLNotEqual(String err, Reader control, Reader test)
        throws SAXException, IOException {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, false);
    }
700036
static public void assertEquals(String message, String expected, String actual) {
        if (expected == null && actual == null) {
            return;
        }
        if (expected != null && expected.equals(actual)) {
            return;
        }
        String cleanMessage = message == null ? "" : message;
        throw new ComparisonFailure(cleanMessage, expected, actual);
    }
161764
function compare (checkDictionary, path, pathContent) {
        var subPromises = [];
        pathContent.forEach(function (name) {
            var JS_EXT = ".js",
                JS_EXT_LENGTH = JS_EXT.length,
                contentFullName = path + name,
                contentFullNameLength = contentFullName.length;
            if (contentFullNameLength > JS_EXT_LENGTH
                && contentFullName.indexOf(JS_EXT) === contentFullNameLength - JS_EXT_LENGTH) {
                contentFullName = contentFullName.substring(START, contentFullNameLength - JS_EXT_LENGTH);
                if (checkDictionary[contentFullName] === "obsolete") {
                    checkDictionary[contentFullName] = "exists";
                } else {
                    checkDictionary[contentFullName] = "new";
                }
            } else if (name.indexOf(".") === NOT_FOUND) {
                subPromises.push(gpf.http.get("/fs/src/" + contentFullName)
                    .then(function (response) {
                        return JSON.parse(response.responseText);
                    })
                    .then(function (subPathContent) {
                        return compare(checkDictionary, contentFullName + "/", subPathContent);
                    }));
            }
        });
        if (!subPromises.length) {
            return Promise.resolve();
        }
        return Promise.all(subPromises);
    }
179733
def assert_equals(self, actual_val, expected_val, failure_message='Expected values to be equal: "{}" and "{}"'):
        
        assertion = lambda: expected_val == actual_val
        self.webdriver_assert(assertion, unicode(failure_message).format(actual_val, expected_val))
1205200
public static boolean isValidJsonStrict(Reader in) throws IOException {
		try {
			new JSONParser(MODE_RFC4627).parse(in, FakeMapper.DEFAULT);
			return true;
		} catch (ParseException e) {
			return false;
		}
	}
146438
function jsonEqual(json1, json2) {
    return JSON.stringify(json1, null, 1) == JSON.stringify(json2, null, 1);
}
967050
public static void assertXMLEqual(String err, Reader control, Reader test)
        throws SAXException, IOException {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, true);
    }
369227
@Override
  public int compareTo(Comparable<?> other) {
    if (other instanceof Region) {
      Region r = (Region) other;
      if (this.start < r.start) {
        return -1;
      } else if (this.end > r.end) {
        return 1;
      } else {
        return 0;
      }
    } else if (other instanceof Long) {
      Long l = (Long) other;
      if (l > end) {
          return -1;
      } else if (l < start) {
          return 1;
      } else {
          return 0;
      }
    } else {
      throw new AssertionError();
    }
  }
1374094
public JSONCompareResult missing(String field, Object expected) {
    	_fieldMissing.add(new FieldComparisonFailure(field, expected, null));
        fail(formatMissing(field, expected));
        return this;
    }
273921
private ComparisonState compareDocuments(final Document control,
                                             final XPathContext controlContext,
                                             final Document test,
                                             final XPathContext testContext) {
        final DocumentType controlDt = filterNode(control.getDoctype());
        final DocumentType testDt = filterNode(test.getDoctype());

        return compare(new Comparison(ComparisonType.HAS_DOCTYPE_DECLARATION,
                                      control, getXPath(controlContext),
                                      Boolean.valueOf(controlDt != null), getParentXPath(controlContext),
                                      test, getXPath(testContext),
                                      Boolean.valueOf(testDt != null), getParentXPath(testContext)))
            .andIfTrueThen(controlDt != null && testDt != null,
                           new DeferredComparison() {
                               @Override
                               public ComparisonState apply() {
                                   return compareNodes(controlDt, controlContext,
                                                       testDt, testContext);
                               }
                           })
            .andThen(compareDeclarations(control, controlContext,
                                         test, testContext));
    }
560770
private AssertionError createAssertionError() {
		// convert both sides to strings
		String expected = TreeQuery.toString(expectedDef, expectedRoot, expectedToString);
		String actual = TreeQuery.toString(actualDef, actualRoot, actualToString);
		// try to create a junit ComparisonFailure
		for (String exceptionType : Arrays.asList(
				"org.junit.ComparisonFailure",
				"junit.framework.ComparisonFailure")) {
			try {
				return createComparisonFailure(exceptionType, expected, actual);
			} catch (Exception e) {}
		}
		// we'll have to settle for a plain-jane AssertionError
		return new AssertionError("Expected:\n" + expected + "\n\nActual:\n" + actual);
	}
1116762
public static void assertXpathsNotEqual(String controlXpath,
                                            String testXpath,
                                            Document document)
        throws XpathException {
        assertXpathsNotEqual(controlXpath, document, testXpath, document);
    }
210244
public static void assertJsonNodePresent(Object actual, String path) {
        if (nodeAbsent(actual, path, configuration)) {
            doFail("Node \"" + path + "\" is missing.");
        }
    }
1167419
private Response assertOutdatedStatus(boolean outdated) throws JSONException {
        Response response = httpGet("keys/" + keyName);
        JSONObject actual = new JSONObject(response.asString());
        Assertions.assertThat(actual.getBoolean("outdated")).isEqualTo(outdated);
        return response;
    }
1070049
public static boolean isValidJson(Reader in) throws IOException {
		try {
			new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(in, FakeMapper.DEFAULT);
			return true;
		} catch (ParseException e) {
			return false;
		}
	}
778821
public static void assertEquals(String message, Object expected, Object actual) {
        if (expected == null && actual != null || expected != null && !expected.equals(actual)) {
            fail(message);
        }
    }