summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2011-11-08 06:38:26 (EST)
committer Stephan Herrmann2012-01-14 09:10:54 (EST)
commitb0c15639b3893752ccd65779bca02145e5b4f030 (patch)
treeea65fc2a87736af09e8b190bb400e9bc6ac5a36e
parentf3b2f1f8f0d88129c8aa72e8730a4785d51f4b84 (diff)
downloadorg.eclipse.objectteams-b0c15639b3893752ccd65779bca02145e5b4f030.zip
org.eclipse.objectteams-b0c15639b3893752ccd65779bca02145e5b4f030.tar.gz
org.eclipse.objectteams-b0c15639b3893752ccd65779bca02145e5b4f030.tar.bz2
Test & fix for Bug 345646 - [select] F3 not working for a specific signature-less callin binding
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java15
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/workspace/CodeSelection/src/mappings/MappingsTeam1.java6
2 files changed, 18 insertions, 3 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
index 90d4ee7..fc8dae0 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/selection/org/eclipse/objectteams/otdt/tests/selection/codeselect/CodeSelectionTests.java
@@ -313,6 +313,19 @@ public class CodeSelectionTests extends AbstractJavaModelTests
}
/**
+ * Select a callin replace mapping (role method spec)
+ */
+ public void testCallin1() throws JavaModelException
+ {
+ ICompilationUnit cu = getCompilationUnit("CodeSelection", "src", "mappings", "MappingsTeam1.java");
+ IJavaElement[] elements = codeSelect(cu, "rm1(int i, Collection c) <-", "rm1");
+ assertElementsEqual(
+ "Unexpected elements",
+ "rm1(int, Collection) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]",
+ elements);
+ }
+
+ /**
* Select argument name inside a callin parameter mapping.
*/
public void testParamMapping1() throws JavaModelException
@@ -321,7 +334,7 @@ public class CodeSelectionTests extends AbstractJavaModelTests
IJavaElement[] elements = codeSelect(cu, "i <- x,", "i");
assertElementsEqual(
"Unexpected elements",
- "i [in rm1(int) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]]",
+ "i [in rm1(int, Collection) [in R [in MappingsTeam1 [in MappingsTeam1.java [in mappings [in src [in CodeSelection]]]]]]]",
elements);
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/workspace/CodeSelection/src/mappings/MappingsTeam1.java b/testplugins/org.eclipse.objectteams.otdt.tests/workspace/CodeSelection/src/mappings/MappingsTeam1.java
index 37acbf8..09d86c9 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/workspace/CodeSelection/src/mappings/MappingsTeam1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/workspace/CodeSelection/src/mappings/MappingsTeam1.java
@@ -1,12 +1,14 @@
package mappings;
+import java.util.Collection;
import base basepkg.B1;
public team class MappingsTeam1 {
protected class R playedBy B1 {
- callin int rm1(int i) { base.rm1(i); }
- int rm1(int i) <- replace int bm1(int x) with {
+ callin int rm1(int i, Collection c) { base.rm1(i); }
+ int rm1(int i, Collection c) <- replace int bm1(int x) with {
i <- x,
+ c <- null,
result -> result
}
int rm2(int j) -> int bm1(int x)