提交 c49a1fe6 编写于 作者: A alanb

6830721: (fc) test/java/nio/channels/AsynchronousFileChannel/Basic.java intermittent failure

Reviewed-by: sherman
上级 78919f1d
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
/* @test /* @test
* @bug 4607272 6822643 * @bug 4607272 6822643 6830721
* @summary Unit test for AsynchronousFileChannel * @summary Unit test for AsynchronousFileChannel
*/ */
...@@ -431,10 +431,11 @@ public class Basic { ...@@ -431,10 +431,11 @@ public class Basic {
throw new RuntimeException("isCancelled not consistent"); throw new RuntimeException("isCancelled not consistent");
try { try {
res.get(); res.get();
if (!cancelled) if (cancelled)
throw new RuntimeException("CancellationException expected"); throw new RuntimeException("CancellationException expected");
} catch (CancellationException x) { } catch (CancellationException x) {
// expected if (!cancelled)
throw new RuntimeException("CancellationException not expected");
} catch (ExecutionException x) { } catch (ExecutionException x) {
throw new RuntimeException(x); throw new RuntimeException(x);
} catch (InterruptedException x) { } catch (InterruptedException x) {
...@@ -442,9 +443,11 @@ public class Basic { ...@@ -442,9 +443,11 @@ public class Basic {
} }
try { try {
res.get(1, TimeUnit.SECONDS); res.get(1, TimeUnit.SECONDS);
throw new RuntimeException("CancellationException expected"); if (cancelled)
throw new RuntimeException("CancellationException expected");
} catch (CancellationException x) { } catch (CancellationException x) {
// expected if (!cancelled)
throw new RuntimeException("CancellationException not expected");
} catch (ExecutionException x) { } catch (ExecutionException x) {
throw new RuntimeException(x); throw new RuntimeException(x);
} catch (TimeoutException x) { } catch (TimeoutException x) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册