1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Neglected to spin off the service call in getProcessContext() on the dsf executor

This commit is contained in:
John Cortell 2010-04-09 22:55:26 +00:00
parent cbdc8d81d3
commit da04759802
2 changed files with 43 additions and 30 deletions

View file

@ -192,21 +192,28 @@ public class GDBProcessesTest extends BaseTestCase {
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
fProcService.getProcessesBeingDebugged(fGdbCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fSession.getExecutor(), null) {
@Override
protected void handleCompleted() {
if (isSuccess()) {
IDMContext[] contexts = getData();
Assert.assertNotNull("invalid return value from service", contexts);
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
IDMContext context = contexts[0];
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
Assert.assertNotNull("unexpected process context type ", processContext);
waitor.setReturnInfo(processContext);
}
fProcService.getExecutor().submit(new Runnable() {
public void run() {
fProcService.getProcessesBeingDebugged(fGdbCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fSession.getExecutor(), null) {
@Override
protected void handleCompleted() {
if (isSuccess()) {
IDMContext[] contexts = getData();
Assert.assertNotNull("invalid return value from service", contexts);
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
IDMContext context = contexts[0];
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
Assert.assertNotNull("unexpected process context type ", processContext);
waitor.setReturnInfo(processContext);
}
}
});
}
});
});
waitor.waitUntilDone(TestsPlugin.massageTimeout(2000));
Assert.assertTrue(fWait.getMessage(), fWait.isOK());

View file

@ -186,24 +186,30 @@ public class MIRunControlTest extends BaseTestCase {
@ThreadSafeAndProhibitedFromDsfExecutor("fSession.getExecutor()")
private IProcessDMContext getProcessContext() throws InterruptedException {
assert !fRunCtrl.getExecutor().isInExecutorThread();
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
fProcService.getProcessesBeingDebugged(fGDBCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fRunCtrl.getExecutor(), null) {
@Override
protected void handleCompleted() {
if (isSuccess()) {
IDMContext[] contexts = getData();
Assert.assertNotNull("invalid return value from service", contexts);
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
IDMContext context = contexts[0];
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
Assert.assertNotNull("unexpected process context type ", processContext);
waitor.setReturnInfo(processContext);
}
final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor();
fRunCtrl.getExecutor().submit(new Runnable() {
public void run() {
fProcService.getProcessesBeingDebugged(fGDBCtrl.getContext(), new DataRequestMonitor<IDMContext[]>(fRunCtrl.getExecutor(), null) {
@Override
protected void handleCompleted() {
if (isSuccess()) {
IDMContext[] contexts = getData();
Assert.assertNotNull("invalid return value from service", contexts);
Assert.assertEquals("unexpected number of processes", contexts.length, 1);
IDMContext context = contexts[0];
IProcessDMContext processContext = DMContexts.getAncestorOfType(context, IProcessDMContext.class);
Assert.assertNotNull("unexpected process context type ", processContext);
waitor.setReturnInfo(processContext);
}
}
});
}
});
});
waitor.waitUntilDone(TestsPlugin.massageTimeout(2000));
Assert.assertTrue(waitor.getMessage(), waitor.isOK());