public void validate(XtextResource resource, IExpectation expectation, @TestResult String actual) {
Assert.assertNotNull(resource);
Assert.assertNotNull(expectation);
Assert.assertNotNull(expectation.getExpectation());
Assert.assertNotNull(actual);
String exp;
if (!config.whitespaceSensitive()) {
FormattingMigrator migrator = new FormattingMigrator();
exp = migrator.migrate(actual, expectation.getExpectation());
} else
exp = expectation.getExpectation();
if ((config.caseSensitive() && !exp.equals(actual))
|| (!config.caseSensitive() && !exp.equalsIgnoreCase(actual))) {
String expDoc = IExpectation.Util.replace(resource, expectation, exp);
String actDoc = IExpectation.Util.replace(resource, expectation, actual);
throw new ComparisonFailure("", expDoc, actDoc);
}
}
}