diff --git a/test/java/nio/channels/AsynchronousFileChannel/Basic.java b/test/java/nio/channels/AsynchronousFileChannel/Basic.java index ea9a5415923f91e90f794a197b424c81796cde1c..1f37d4be11c0e48a421cc372f7934bab17068c97 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) {