aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-01-22 12:58:36 -0500
committerTill Brychcy2018-01-22 12:58:52 -0500
commit9599981de1e324d33a872e84d29687e9cc17ab39 (patch)
tree447aa4f8f57302eacdcdd871e27c446e5aa68613 /org.eclipse.jdt.core.tests.model
parent67d6195b2e1eca85cb02928c65c7f9577967fe35 (diff)
downloadeclipse.jdt.core-master.zip
eclipse.jdt.core-master.tar.gz
eclipse.jdt.core-master.tar.xz
Bug 530142 - [9] Module autocompletion ignores Automatic-Module-Name forHEADmaster
Classpath Container entries Change-Id: Ieae333a26b5dec3a4c74ac34c27972a3e40f5291
Diffstat (limited to 'org.eclipse.jdt.core.tests.model')
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
index 52e2e2c..e5f90d8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
@@ -1247,4 +1247,34 @@ public void testBug528948_002() throws Exception {
deleteProject(project2);
}
}
+public void testBug530142() throws Exception {
+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"Completion9_1", "/Completion/test.second.jar,/Completion/test.third.jar,/Completion/test.some.api.jar"}));
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL19_LIB", "org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, "bin", "9");
+ try {
+ project1.open(null);
+
+ createFolder("/Completion9_1/src/x");
+ String content = "module my.mod { \n" +
+ "requires test.\n" +
+ "}\n";
+ String filePath = "/Completion9_1/src/module-info.java";
+ String completeBehind = "requires test.";
+ createFile(filePath, content);
+ int cursorLocation = content.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ waitUntilIndexesReady();
+
+ ICompilationUnit unit = getCompilationUnit("/Completion9_1/src/module-info.java");
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "[MODULE_REF]{test.second, test.second, null, null, 49}\n" +
+ "[MODULE_REF]{test.some.core.api, test.some.core.api, null, null, 49}\n" +
+ "[MODULE_REF]{test.third.from.manifest, test.third.from.manifest, null, null, 49}";
+ assertResults(expected, requestor.getResults());
+
+ } finally {
+ deleteProject(project1);
+ }
+}
} \ No newline at end of file