Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1416)

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
index a4c64854531d2c8b2e516ae5bc024a35b2fbab82..1d4c2a06afddc9860938b0f5dddd8afeaee3e80a 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
@@ -8,7 +8,6 @@ import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.dart.compiler.DartCompilationError;
-import com.google.dart.compiler.DartCompilerErrorCode;
import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.ErrorCode;
import com.google.dart.compiler.ast.DartClass;
@@ -283,21 +282,11 @@ abstract class ResolverTestCase extends TestCase {
private DartCompilerListener getListener() {
return new DartCompilerListener() {
@Override
- public void compilationError(DartCompilationError event) {
+ public void onError(DartCompilationError event) {
encounteredErrors.add(event);
}
@Override
- public void compilationWarning(DartCompilationError event) {
- compilationError(event);
- }
-
- @Override
- public void typeError(DartCompilationError event) {
- compilationError(event);
- }
-
- @Override
public void unitCompiled(DartUnit unit) {
}
};
@@ -342,7 +331,7 @@ abstract class ResolverTestCase extends TestCase {
protected TestCompilerContext getContext() {
return new TestCompilerContext() {
@Override
- public void compilationError(DartCompilationError event) {
+ public void onError(DartCompilationError event) {
recordError(event);
}
};
@@ -376,10 +365,14 @@ abstract class ResolverTestCase extends TestCase {
*/
protected void printEncountered(List<DartCompilationError> encountered) {
for (DartCompilationError error : encountered) {
- DartCompilerErrorCode errorCode = (DartCompilerErrorCode) error
- .getErrorCode();
- String msg = String.format("%s > %s (%d:%d)", errorCode.name(), error
- .getMessage(), error.getLineNumber(), error.getColumnNumber());
+ ErrorCode errorCode = (ErrorCode) error.getErrorCode();
+ String msg =
+ String.format(
+ "%s > %s (%d:%d)",
+ errorCode.toString(),
+ error.getMessage(),
+ error.getLineNumber(),
+ error.getColumnNumber());
System.out.println(msg);
}
}
@@ -392,7 +385,7 @@ abstract class ResolverTestCase extends TestCase {
final List<DartCompilationError> encountered = Lists.newArrayList();
TestCompilerContext ctx = new TestCompilerContext() {
@Override
- public void compilationError(DartCompilationError event) {
+ public void onError(DartCompilationError event) {
encountered.add(event);
}
};

Powered by Google App Engine
This is Rietveld 408576698