public final class TestErrorReporter
extends Assert
implements com.google.javascript.rhino.head.ErrorReporter
An error reporter for testing that verifies that messages reported to the reporter are expected.
Sample use
TestErrorReporter e =
new TestErrorReporter(null, new String[] { "first warning" });
...
assertTrue(e.hasEncounteredAllWarnings());
| Constructor and Description |
|---|
TestErrorReporter(String[] errors,
String[] warnings) |
| Modifier and Type | Method and Description |
|---|---|
void |
error(String message,
String sourceName,
int line,
String lineSource,
int lineOffset) |
boolean |
hasEncounteredAllErrors()
Returns whether all errors were reported to this reporter.
|
boolean |
hasEncounteredAllWarnings()
Returns whether all warnings were reported to this reporter.
|
com.google.javascript.rhino.head.EvaluatorException |
runtimeError(String message,
String sourceName,
int line,
String lineSource,
int lineOffset) |
void |
warning(String message,
String sourceName,
int line,
String lineSource,
int lineOffset) |
public void error(String message, String sourceName, int line, String lineSource, int lineOffset)
error in interface com.google.javascript.rhino.head.ErrorReporterpublic void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
warning in interface com.google.javascript.rhino.head.ErrorReporterpublic com.google.javascript.rhino.head.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
runtimeError in interface com.google.javascript.rhino.head.ErrorReporterpublic boolean hasEncounteredAllWarnings()
public boolean hasEncounteredAllErrors()
Copyright © 2009-2014 Google. All Rights Reserved.