@Override protected String getMessage(String urlString) throws Exception { Project project = getProject(); String failureMessage = FailureMessageUtil.getFailureMessage(project, urlString); return formatXML("<div>" + failureMessage + "</div>"); }
private static void _writeExpectedFailureMessage(Project project, File sampleDir) throws Exception { File expectedFailureMessageFile = new File(sampleDir, "expected_failure_message.html"); String expectedFailureMessage = FailureMessageUtil.getFailureMessage(project, _toExternalForm(sampleDir)); _write(expectedFailureMessageFile, expectedFailureMessage); }
protected void assertSample(Project project, File caseDir) throws Exception { System.out.print("Asserting sample " + caseDir.getName() + ": "); File expectedFailureMessageFile = new File(caseDir, "expected_failure_message.html"); String expectedFailureMessage = _read(expectedFailureMessageFile); String actualFailureMessage = FailureMessageUtil.getFailureMessage(project, _toExternalForm(caseDir)); boolean value = expectedFailureMessage.equals(actualFailureMessage); if (value) { System.out.println(" PASSED"); } else { System.out.println(" FAILED"); System.out.println("\nActual results: \n" + actualFailureMessage); System.out.println("\nExpected results: \n" + expectedFailureMessage); } Assert.assertTrue(value); }