Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-06-30 20:11:44 +0000
committereutarass2008-06-30 20:11:44 +0000
commit4197d7dde1857b07d118d109d6e5a0495d76c2fe (patch)
tree2ff70b9a3b45ce4f7ec5a7d21f8fe3a9d47e07d6 /plugins/org.eclipse.tm.tcf.debug.ui
parenta6f3b6c63465bee931e3d40df402b06bc437c009 (diff)
downloadorg.eclipse.tcf-4197d7dde1857b07d118d109d6e5a0495d76c2fe.tar.gz
org.eclipse.tcf-4197d7dde1857b07d118d109d6e5a0495d76c2fe.tar.xz
org.eclipse.tcf-4197d7dde1857b07d118d109d6e5a0495d76c2fe.zip
Fixed: TCF tests could generate false error report like "invalid contextCreated event..."
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug.ui')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
index aedc05233..13eff9423 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
@@ -297,7 +297,7 @@ class TCFSelfTest {
private void startProcess() {
if (cancel || cnt == 4) {
- if (!map.isEmpty()) {
+ if (!process_ids.isEmpty()) {
new Thread() {
public void run() {
try {
@@ -308,14 +308,14 @@ class TCFSelfTest {
Protocol.invokeLater(new Runnable() {
public void run() {
sync_cnt++;
- if (map.isEmpty()) {
+ if (process_ids.isEmpty()) {
exit(null);
}
else if (sync_cnt < 300) {
startProcess();
}
else {
- exit(new Error("Missing 'contextRemoved' event for " + map.keySet()));
+ exit(new Error("Missing 'contextRemoved' event for " + process_ids));
}
}
});
@@ -369,8 +369,7 @@ class TCFSelfTest {
String[] suspended_ids) {
for (String context : suspended_ids) {
assert context != null;
- IRunControl.RunControlContext ctx = map.get(context);
- if (ctx == null) exit(new Error("Invalid 'contextSuspended' event for " + context));
+ contextSuspended(context, null, null, null);
}
}
@@ -383,19 +382,23 @@ class TCFSelfTest {
public void contextChanged(RunControlContext[] contexts) {
for (RunControlContext ctx : contexts) {
- if (map.get(ctx.getID()) == null) exit(new Error("Invalid 'contextChanged' event"));
+ if (map.get(ctx.getID()) == null) return;
map.put(ctx.getID(), ctx);
}
}
public void contextException(String context, String msg) {
- exit(new Error("Unexpected 'contextException' event for " + context + ": " + msg));
+ IRunControl.RunControlContext ctx = map.get(context);
+ if (ctx == null) return;
+ if (process_ids.contains(ctx.getParentID())) {
+ exit(new Error("Unexpected 'contextException' event for " + context + ": " + msg));
+ }
}
public void contextRemoved(String[] context_ids) {
for (String id : context_ids) {
- if (map.get(id) == null) exit(new Error("Invalid 'contextRemoved' event"));
map.remove(id);
+ process_ids.remove(id);
}
}
@@ -406,7 +409,7 @@ class TCFSelfTest {
Map<String, Object> params) {
assert context != null;
IRunControl.RunControlContext ctx = map.get(context);
- if (ctx == null) exit(new Error("Invalid 'contextSuspended' event for " + context));
+ if (ctx == null) return;
if (process_ids.contains(ctx.getParentID())) {
ctx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
public void doneCommand(IToken token, Exception error) {

Back to the top