summaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-01 17:38:42 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-01 17:38:42 -0800
commit280e801d4e529f471fc0631dc880b778815aa394 (patch)
treeb75d464669f18a61f9cb49258dfaae8d8487e13b /src/test/java
parent6260e5e63a30f348f1f2e5dad08038a4ba4447ce (diff)
downloadjava-language-server-280e801d4e529f471fc0631dc880b778815aa394.zip
Use error-prone
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/javacs/JavaCompilerServiceTest.java19
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()));
}