Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2010-05-14 16:50:40 +0000
committerPawel Piech2010-05-14 16:50:40 +0000
commit06e479681f0a3dc7582cab9ef5cc420b353cfa8f (patch)
treea2a5eb44ebca663dc809570d5db26c72ec1734de /dsf/org.eclipse.cdt.tests.dsf
parent1c2aa84166c0b1fff583f03b886fd7fb15688e13 (diff)
downloadorg.eclipse.cdt-06e479681f0a3dc7582cab9ef5cc420b353cfa8f.tar.gz
org.eclipse.cdt-06e479681f0a3dc7582cab9ef5cc420b353cfa8f.tar.xz
org.eclipse.cdt-06e479681f0a3dc7582cab9ef5cc420b353cfa8f.zip
Bug 312813 - [Launch] MIInferiorProcess.exitValue() never returns
Diffstat (limited to 'dsf/org.eclipse.cdt.tests.dsf')
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java
index 7da7f99aea4..5e74eaf0417 100644
--- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java
+++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java
@@ -110,6 +110,7 @@ public class DsfQueryTests {
@Test
public void doneExceptionTest() throws InterruptedException, ExecutionException {
Query<Integer> q = new Query<Integer>() {
+ @SuppressWarnings("deprecation")
@Override
protected void execute(DataRequestMonitor<Integer> rm) {
doneException(new Throwable());
@@ -246,12 +247,26 @@ public class DsfQueryTests {
Assert.assertTrue(cancelCalled[0]);
Assert.assertTrue(rmHolder[0].isCanceled());
Assert.assertTrue(q.isCancelled());
- Assert.assertFalse(q.isDone());
+ Assert.assertTrue(q.isDone());
+
+ // Retrieve data
+ try {
+ q.get();
+ } catch (CancellationException e) {
+ return; // Success
+ } finally {
+ Assert.assertTrue(q.isDone());
+ Assert.assertTrue(q.isCancelled());
+ }
// Complete rm and query.
+ @SuppressWarnings("unchecked")
+ DataRequestMonitor<Integer> drm = (DataRequestMonitor<Integer>)rmHolder[0];
+ drm.setData(new Integer(1));
rmHolder[0].done();
- // Retrieve data
+ // Try to retrieve data again, it should still result in
+ // cancellation exception.
try {
q.get();
} catch (CancellationException e) {
@@ -260,6 +275,8 @@ public class DsfQueryTests {
Assert.assertTrue(q.isDone());
Assert.assertTrue(q.isCancelled());
}
+
+
Assert.assertTrue("CancellationException should have been thrown", false); //$NON-NLS-1$
}

Back to the top