From c49a1fe6f2b467840b92ab2dd7b22d857d4cb06c Mon Sep 17 00:00:00 2001 From: alanb Date: Mon, 20 Apr 2009 09:30:50 +0100 Subject: [PATCH] 6830721: (fc) test/java/nio/channels/AsynchronousFileChannel/Basic.java intermittent failure Reviewed-by: sherman --- .../nio/channels/AsynchronousFileChannel/Basic.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/java/nio/channels/AsynchronousFileChannel/Basic.java b/test/java/nio/channels/AsynchronousFileChannel/Basic.java index ea9a54159..1f37d4be1 100644 --- a/test/java/nio/channels/AsynchronousFileChannel/Basic.java +++ b/test/java/nio/channels/AsynchronousFileChannel/Basic.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4607272 6822643 + * @bug 4607272 6822643 6830721 * @summary Unit test for AsynchronousFileChannel */ @@ -431,10 +431,11 @@ public class Basic { throw new RuntimeException("isCancelled not consistent"); try { res.get(); - if (!cancelled) + if (cancelled) throw new RuntimeException("CancellationException expected"); } catch (CancellationException x) { - // expected + if (!cancelled) + throw new RuntimeException("CancellationException not expected"); } catch (ExecutionException x) { throw new RuntimeException(x); } catch (InterruptedException x) { @@ -442,9 +443,11 @@ public class Basic { } try { res.get(1, TimeUnit.SECONDS); - throw new RuntimeException("CancellationException expected"); + if (cancelled) + throw new RuntimeException("CancellationException expected"); } catch (CancellationException x) { - // expected + if (!cancelled) + throw new RuntimeException("CancellationException not expected"); } catch (ExecutionException x) { throw new RuntimeException(x); } catch (TimeoutException x) { -- GitLab