Class TestErrorReporter
java.lang.Object
junit.framework.Assert
com.google.javascript.jscomp.testing.TestErrorReporter
- All Implemented Interfaces:
com.google.javascript.rhino.head.ErrorReporter
public final class TestErrorReporter
extends junit.framework.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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
Returns whether all errors were reported to this reporter.boolean
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
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
-
Constructor Details
-
TestErrorReporter
-
-
Method Details
-
error
- Specified by:
error
in interfacecom.google.javascript.rhino.head.ErrorReporter
-
warning
- Specified by:
warning
in interfacecom.google.javascript.rhino.head.ErrorReporter
-
runtimeError
public com.google.javascript.rhino.head.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) - Specified by:
runtimeError
in interfacecom.google.javascript.rhino.head.ErrorReporter
-
hasEncounteredAllWarnings
public boolean hasEncounteredAllWarnings()Returns whether all warnings were reported to this reporter. -
hasEncounteredAllErrors
public boolean hasEncounteredAllErrors()Returns whether all errors were reported to this reporter.
-