summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/java/org/javacs/GotoTest.java14
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/GotoOtherPackageMethod.java13
-rw-r--r--src/test/test-project/workspace/src/org/javacs/other/ImplementsConsumer.java8
-rw-r--r--src/test/test-project/workspace/src/org/javacs/other/ImplementsRunnable.java6
4 files changed, 41 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/GotoTest.java b/src/test/java/org/javacs/GotoTest.java
index 564071e..6587eca 100644
--- a/src/test/java/org/javacs/GotoTest.java
+++ b/src/test/java/org/javacs/GotoTest.java
@@ -148,6 +148,20 @@ public class GotoTest {
}
@Test
+ public void gotoImplementsRunnable() {
+ String file = "/org/javacs/example/GotoOtherPackageMethod.java";
+
+ assertThat(doGoto(file, 7, 12), hasItem("ImplementsRunnable.java:5"));
+ }
+
+ @Test
+ public void gotoImplementsConsumer() {
+ String file = "/org/javacs/example/GotoOtherPackageMethod.java";
+
+ assertThat(doGoto(file, 11, 12), hasItem("ImplementsConsumer.java:7"));
+ }
+
+ @Test
public void gotoError() {
String file = "/org/javacs/example/GotoError.java";
diff --git a/src/test/test-project/workspace/src/org/javacs/example/GotoOtherPackageMethod.java b/src/test/test-project/workspace/src/org/javacs/example/GotoOtherPackageMethod.java
new file mode 100644
index 0000000..a02818f
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/GotoOtherPackageMethod.java
@@ -0,0 +1,13 @@
+package org.javacs.example;
+
+import java.util.function.Consumer;
+
+class GotoOtherPackageMethod {
+ void gotoRun(Runnable r) {
+ r.run();
+ }
+
+ void gotoAccept(Consumer<String> c) {
+ c.accept("foo");
+ }
+} \ No newline at end of file
diff --git a/src/test/test-project/workspace/src/org/javacs/other/ImplementsConsumer.java b/src/test/test-project/workspace/src/org/javacs/other/ImplementsConsumer.java
new file mode 100644
index 0000000..1e8b907
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/other/ImplementsConsumer.java
@@ -0,0 +1,8 @@
+package org.javacs.other;
+
+import java.util.function.Consumer;
+
+class ImplementsConsumer implements Consumer<String> {
+ @Override
+ public void accept(String foo) { }
+} \ No newline at end of file
diff --git a/src/test/test-project/workspace/src/org/javacs/other/ImplementsRunnable.java b/src/test/test-project/workspace/src/org/javacs/other/ImplementsRunnable.java
new file mode 100644
index 0000000..6f64355
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/other/ImplementsRunnable.java
@@ -0,0 +1,6 @@
+package org.javacs.other;
+
+class ImplementsRunnable implements Runnable {
+ @Override
+ public void run() { }
+} \ No newline at end of file