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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanReturns whether all errors were reported to this reporter.booleanReturns whether all warnings were reported to this reporter.com.google.javascript.rhino.head.EvaluatorExceptionruntimeError(String message, String sourceName, int line, String lineSource, int lineOffset) voidMethods 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:
errorin interfacecom.google.javascript.rhino.head.ErrorReporter
-
warning
- Specified by:
warningin 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:
runtimeErrorin 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.
-