Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-12-04 22:33:14 +0000
committerStephan Herrmann2012-12-04 22:33:14 +0000
commit68749180245d1ecc04c1a302a95201570e32eead (patch)
tree59316f29448b9e79e7b35c93cec595b2964d8aae /testplugins
parentfde4bd6d3ca452d719e7ab6107bb07bf7ea19140 (diff)
downloadorg.eclipse.objectteams-68749180245d1ecc04c1a302a95201570e32eead.tar.gz
org.eclipse.objectteams-68749180245d1ecc04c1a302a95201570e32eead.tar.xz
org.eclipse.objectteams-68749180245d1ecc04c1a302a95201570e32eead.zip
Bug 395762 - [assist] completion in c-t-f parameter mapping hangs
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
index 7be4b5c71..e430d6728 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
@@ -27,8 +27,6 @@ import java.util.Hashtable;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
@@ -573,6 +571,28 @@ public class CodeCompletionTest extends CoreTests {
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
+ // See Bug 395762: this case could trigger the reported hang
+ public void testCompleteParameterMapping1() throws Exception {
+ createBaseClass(" java.util.List<String> names;\n");
+ assertNosuchTypeBodyProposal(
+ " String setName(int i, String n) -> set java.util.List<String> names\n" +
+ " with { n -> base.| }",
+ "names",
+ INTERESTING_CALLIN_CALLOUT_PROPOSAL);
+ }
+
+ // similar to above, positive case
+ public void testCompleteParameterMapping2() throws Exception {
+ createBaseClass(" java.util.List<String> names;\n");
+ assertTypeBodyProposal(
+ " String getName(int i) -> get java.util.List<String> names\n" +
+ " with { result <- base.| }",
+ "names",
+ " String getName(int i) -> get java.util.List<String> names\n" +
+ " with { result <- base.names|| }",
+ INTERESTING_CALLIN_CALLOUT_PROPOSAL);
+ }
+
// Bug 353468 - [completion] completing a method binding inserts nested class by its binary name
public void testCreateMethodBinding1() throws Exception {
// secondary types:
@@ -1407,7 +1427,7 @@ public class CodeCompletionTest extends CoreTests {
"}\n",
true, null);
IPackageFragment rolePack = CompletionTestSetup.getTestPackage(this.fJProject1, "p1.SuperTeam");
- ICompilationUnit rofiCU = rolePack.createCompilationUnit("RoleFile.java",
+ rolePack.createCompilationUnit("RoleFile.java",
"team package test1.p1.SuperTeam;\n" +
"protected class RoleFile { }\n",
true, null);

Back to the top