From 8291ef4a16608fd695b5e8254a9a39489de286fb Mon Sep 17 00:00:00 2001 From: George Fraser Date: Wed, 9 Jan 2019 00:32:09 -0800 Subject: Test robustness --- src/test/java/org/javacs/JavaCompilerServiceTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/javacs/JavaCompilerServiceTest.java b/src/test/java/org/javacs/JavaCompilerServiceTest.java index 9b6c2ee..f10c078 100644 --- a/src/test/java/org/javacs/JavaCompilerServiceTest.java +++ b/src/test/java/org/javacs/JavaCompilerServiceTest.java @@ -11,11 +11,13 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.StringJoiner; import java.util.stream.Collectors; import javax.lang.model.element.Element; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; +import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -30,6 +32,11 @@ public class JavaCompilerServiceTest { return Paths.get("src/test/test-project/simple").normalize(); } + @Before + public void setWorkspaceRoot() { + FileStore.setWorkspaceRoots(Set.of(simpleProjectSrc())); + } + static String contents(String resourceFile) { var root = JavaCompilerServiceTest.simpleProjectSrc(); var file = root.resolve(resourceFile); @@ -248,7 +255,8 @@ public class JavaCompilerServiceTest { @Test public void localDoc() { var uri = resourceUri("LocalMethodDoc.java"); - var method = compiler.compileFocus(uri, 3, 21).methodInvocation().get().activeMethod.get(); + var invocation = compiler.compileFocus(uri, 3, 21).methodInvocation().get(); + var method = invocation.activeMethod.get(); var ptr = new Ptr(method); var file = compiler.docs().find(ptr).get(); var parse = compiler.docs().parse(file); -- cgit v1.2.3