Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-06-18 13:59:22 -0400
committerStephan Herrmann2019-08-27 09:44:37 -0400
commitc4d90ef30fd4d2d4794e9d36a53bd9d8cda7955e (patch)
tree4ddbbb180c2d857a4481d8c02986aae2074f4879
parentcadf5b022b631a8203a7b6c1f6d5d1aeda367ba1 (diff)
downloadeclipse.jdt.core-I20190828-0600.tar.gz
eclipse.jdt.core-I20190828-0600.tar.xz
eclipse.jdt.core-I20190828-0600.zip
and content assist - new test only (plus a setup-fix in existing tests) Change-Id: Idaf632dd2dac919666f6e1ac35901583ef500642
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java65
1 files changed, 49 insertions, 16 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
index 77022c605f..bdae7244dd 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
@@ -39,7 +39,7 @@ public static Test suite() {
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=338398
public void testBug338398a() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/A.java",
@@ -74,7 +74,7 @@ public void testBug338398a() throws CoreException {
}
public void _testBug338398b() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/A_CLASS.java",
@@ -100,7 +100,7 @@ public void _testBug338398b() throws CoreException {
}
public void _testBug338398c() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/A_CLASS.java",
@@ -126,7 +126,7 @@ public void _testBug338398c() throws CoreException {
}
public void testBug504095() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[2];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Bug504095.java",
@@ -155,7 +155,7 @@ public void testBug504095() throws CoreException {
}
public void testBug425035a() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -196,7 +196,7 @@ public void testBug425035a() throws CoreException {
}
public void testBug425035b() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -236,7 +236,7 @@ public void testBug425035b() throws CoreException {
}
public void testBug425035c() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -277,7 +277,7 @@ public void testBug425035c() throws CoreException {
}
public void testBug425035d() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -317,7 +317,7 @@ public void testBug425035d() throws CoreException {
}
public void testBug425035e() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -357,7 +357,7 @@ public void testBug425035e() throws CoreException {
}
public void testBug425035f() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -398,7 +398,7 @@ public void testBug425035f() throws CoreException {
}
public void testBug425035_method_a() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -442,7 +442,7 @@ public void testBug425035_method_a() throws CoreException {
}
public void testBug425035_method_b() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -485,7 +485,7 @@ public void testBug425035_method_b() throws CoreException {
}
public void testBug425035_method_c() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -529,7 +529,7 @@ public void testBug425035_method_c() throws CoreException {
}
public void testBug425035_method_d() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -572,7 +572,7 @@ public void testBug425035_method_d() throws CoreException {
}
public void testBug425035_method_e() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -615,7 +615,7 @@ public void testBug425035_method_e() throws CoreException {
}
public void testBug425035_method_f() throws CoreException {
try {
- createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin", "1.7");
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
this.workingCopies = new ICompilationUnit[3];
this.workingCopies[0] = getWorkingCopy(
"/P/src/a/Values.java",
@@ -657,4 +657,37 @@ public void testBug425035_method_f() throws CoreException {
deleteProject("P");
}
}
+public void testBug547256() throws CoreException {
+ try {
+ createJavaProject("P", new String[] {"src"}, new String[]{"JCL17_LIB"}, "bin", "1.7");
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "/P/src/jdt/Something.java",
+ "package jdt;\n" +
+ "public class Something {\n" +
+ " public static void main(String[] args) {\n" +
+ " done: for (int i = 0; i < 5; ++i) {\n" +
+ " if (i == 3) {\n" +
+ " break done;\n" +
+ " }\n" +
+ " System.out.println(i);\n" +
+ " }\n" +
+ " arg\n" +
+ " System.out.println(\"done\");\n" +
+ " }\n" +
+ "}\n");
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ requestor.setAllowsRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF, true);
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "arg";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ assertResults(
+ "args[LOCAL_VARIABLE_REF]{args, null, [Ljava.lang.String;, args, null, 52}",
+ requestor.getResults());
+
+ } finally {
+ deleteProject("P");
+ }
+}
}

Back to the top