Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-12-12 02:59:07 -0500
committerEugene Tarassov2011-12-12 02:59:07 -0500
commitab5fe997529ec6f4b33e96053dd41505110e1ed0 (patch)
tree00ad8d68b5e324cc42f4cf6c56961d233514832d
parent5917b6046d3e0bd6608b7511fdaba455ebd7e516 (diff)
downloadorg.eclipse.tcf-ab5fe997529ec6f4b33e96053dd41505110e1ed0.tar.gz
org.eclipse.tcf-ab5fe997529ec6f4b33e96053dd41505110e1ed0.tar.xz
org.eclipse.tcf-ab5fe997529ec6f4b33e96053dd41505110e1ed0.zip
TCF Tests: fixed regression in Path Map tests.
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestPathMap.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestPathMap.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestPathMap.java
index c120565de..f88ec68ca 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestPathMap.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestPathMap.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.tm.internal.tcf.debug.tests;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
+import java.util.UUID;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.IToken;
@@ -27,6 +29,7 @@ class TestPathMap implements ITCFTest {
private final IPathMap service;
private final Random rnd = new Random();
+ private final String test_id = UUID.randomUUID().toString();
private static final String[] prop_names = {
IPathMap.PROP_SOURCE,
@@ -107,7 +110,7 @@ class TestPathMap implements ITCFTest {
final IPathMap.PathMapRule[] map_out = new IPathMap.PathMapRule[rnd.nextInt(12)];
for (int i = 0; i < map_out.length; i++) {
Map<String,Object> props = new HashMap<String,Object>();
- props.put(IPathMap.PROP_ID, "PM" + i);
+ props.put(IPathMap.PROP_ID, test_id + "-" + i);
for (int l = 0; l < 2; l++) {
String nm = prop_names[rnd.nextInt(prop_names.length)];
StringBuffer bf = new StringBuffer();
@@ -129,6 +132,7 @@ class TestPathMap implements ITCFTest {
else {
service.get(new IPathMap.DoneGet() {
public void doneGet(IToken token, Exception error, PathMapRule[] map_inp) {
+ map_inp = filterMap(map_inp);
if (error != null) {
exit(error);
}
@@ -154,6 +158,17 @@ class TestPathMap implements ITCFTest {
}
}
+ private PathMapRule[] filterMap(PathMapRule[] map) {
+ if (map == null) return null;
+ ArrayList<PathMapRule> res = new ArrayList<PathMapRule>();
+ for (PathMapRule r : map) {
+ String id = r.getID();
+ if (id == null) continue;
+ if (id.startsWith(test_id)) res.add(r);
+ }
+ return res.toArray(new PathMapRule[res.size()]);
+ }
+
private boolean map_equ(Map<String,Object> x, Map<String,Object> y) {
for (String key : x.keySet()) {
if (!obj_equ(key, x.get(key), y.get(key))) return false;
@@ -180,3 +195,4 @@ class TestPathMap implements ITCFTest {
return false;
}
}
+

Back to the top