diff options
-rw-r--r-- | src/test/java/org/javacs/JavaCompilerServiceTest.java | 10 |
1 files changed, 9 insertions, 1 deletions
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); |