diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/javacs/JavaCompilerServiceTest.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/test/java/org/javacs/JavaCompilerServiceTest.java b/src/test/java/org/javacs/JavaCompilerServiceTest.java index 838d9b5..82fe157 100644 --- a/src/test/java/org/javacs/JavaCompilerServiceTest.java +++ b/src/test/java/org/javacs/JavaCompilerServiceTest.java @@ -278,10 +278,25 @@ public class JavaCompilerServiceTest { } @Test - public void lint() { + public void reportErrors() { var uri = resourceUri("HasError.java"); var files = Collections.singleton(uri); - var diags = compiler.compileBatch(files).lint(); + var diags = compiler.reportErrors(files); + assertThat(diags, not(empty())); + } + + @Test + public void errorProne() { + var uri = resourceUri("ErrorProne.java"); + var files = Collections.singleton(uri); + var diags = compiler.reportErrors(files); + for (var d : diags) { + var file = d.getSource().toUri().getPath(); + var line = d.getLineNumber(); + var kind = d.getKind(); + var msg = d.getMessage(null); + System.out.println(String.format("%s(%d)\t%s\t%s", file, line, kind, msg)); + } assertThat(diags, not(empty())); } |