jdk/test/java/nio/channels/Pipe/NonBlocking.java
changeset 5970 d4e98bbfb0be
parent 5506 202f599c92aa
child 7668 d4a77089c587
--- a/jdk/test/java/nio/channels/Pipe/NonBlocking.java	Tue Jun 22 19:18:06 2010 -0700
+++ b/jdk/test/java/nio/channels/Pipe/NonBlocking.java	Wed Jun 23 20:19:29 2010 +0100
@@ -41,12 +41,17 @@
 
     static void test1() throws Exception {
         Pipe p = Pipe.open();
-        p.sink().configureBlocking(false);
-        if (p.sink().isBlocking())
-            throw new Exception("Sink still blocking");
-        p.source().configureBlocking(false);
-        if (p.source().isBlocking())
-            throw new Exception("Source still blocking");
+        try {
+            p.sink().configureBlocking(false);
+            if (p.sink().isBlocking())
+                throw new Exception("Sink still blocking");
+            p.source().configureBlocking(false);
+            if (p.source().isBlocking())
+                throw new Exception("Source still blocking");
+        } finally {
+            p.sink().close();
+            p.source().close();
+        }
     }
 
 }