public void assertOutputMatchesGoldenFile(final String actualOutput, final String goldenFileName)
      throws IOException {
    debug("GoldenComparator:assertOutputMatchesGoldenFile");
    final BufferedReader goldenReader = new BufferedReader(readGoldenFile(goldenFileName));
    final BufferedReader actualReader = new BufferedReader(new StringReader(actualOutput));

    final List<String> goldenStrings = readLines(goldenReader);
    final List<String> actualStrings = readLines(actualReader);

    scanForProblems(actualStrings);

    String actualLine = null;
    String goldenLine = null;

    int lineCount = 0;
    do {
      lineCount++;
      debug("GoldenComparator comparing line " + lineCount);

      actualLine = actualStrings.get(lineCount - 1);
      goldenLine = goldenStrings.get(lineCount - 1);

      if (actualLine == null && goldenLine != null) {
        fail("EOF reached in actual output but golden file, " + goldenFileName
            + ", continues at line " + lineCount + ": " + goldenLine
            + new OutputFormatter(actualStrings));

      } else if (actualLine != null && goldenLine == null) {
        fail("EOF reached in golden file, " + goldenFileName
            + ", but actual output continues at line " + lineCount + ": " + actualLine
            + new OutputFormatter(actualStrings));

      } else if (actualLine != null && goldenLine != null) {
        assertTrue("Actual output \"" + actualLine + "\" did not match expected pattern \""
            + goldenLine + "\" at line " + lineCount + " in " + goldenFileName + ": "
            + new OutputFormatter(actualStrings), compareLines(actualLine, goldenLine));
      }
    } while (actualLine != null && goldenLine != null);
  }
Compares test output to golden text file.

@since GemFire 4.1.1
geode-junit/src/main/java/org/apache/geode/test/golden/GoldenComparator.java