harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r417192 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java
Date Mon, 26 Jun 2006 13:47:58 GMT
Author: gharley
Date: Mon Jun 26 06:47:57 2006
New Revision: 417192

URL: http://svn.apache.org/viewvc?rev=417192&view=rev
Log:
HARMONY 658 : Remove an unstable test from DatagramChannelTest

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java?rev=417192&r1=417191&r2=417192&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java
Mon Jun 26 06:47:57 2006
@@ -510,8 +510,6 @@
 
     /**
      * Test method for 'DatagramChannelImpl.connect(SocketAddress)'
-     * 
-     * @throws IOException
      */
     public void testConnect_BlockWithServer() throws IOException {
         // blocking mode
@@ -520,6 +518,14 @@
         datagramSocket1.close();
         disconnectAfterConnected();
     }
+    
+    /**
+     * Test method for 'DatagramChannelImpl.connect(SocketAddress)'
+     */
+    public void testConnect_BlockNoServer() throws IOException {
+        connectWithoutServer();
+        disconnectAfterConnected();
+    }
 
     /**
      * Test method for 'DatagramChannelImpl.connect(SocketAddress)'
@@ -922,16 +928,6 @@
      * 
      * @throws Exception
      */
-    public void testReceive_BlockNoServerBufEmpty() throws Exception {
-        assertTrue(this.channel1.isBlocking());
-        receiveBlockNoServer(CAPACITY_NORMAL);
-    }
-
-    /**
-     * Test method for 'DatagramChannelImpl.receive(ByteBuffer)'
-     * 
-     * @throws Exception
-     */
     public void testReceive_NonBlockNoServerBufEmpty() throws Exception {
         this.channel1.configureBlocking(false);
         receiveNonBlockNoServer(CAPACITY_NORMAL);
@@ -982,16 +978,6 @@
      * 
      * @throws Exception
      */
-    public void testReceive_BlockNoServerBufZero() throws Exception {
-        assertTrue(this.channel1.isBlocking());
-        receiveBlockNoServer(CAPACITY_ZERO);
-    }
-
-    /**
-     * Test method for 'DatagramChannelImpl.receive(ByteBuffer)'
-     * 
-     * @throws Exception
-     */
     public void testReceive_NonBlockNoServerBufZero() throws Exception {
         this.channel1.configureBlocking(false);
         receiveNonBlockNoServer(CAPACITY_ZERO);
@@ -1002,18 +988,6 @@
      * 
      * @throws Exception
      */
-    public void testReceive_BlockNoServerBufNotEmpty() throws Exception {
-        assertTrue(this.channel1.isBlocking());
-        connectWithoutServer();
-        ByteBuffer dst = allocateNonEmptyBuf();
-        closeBlockedChannelForReceive(dst);
-    }
-
-    /**
-     * Test method for 'DatagramChannelImpl.receive(ByteBuffer)'
-     * 
-     * @throws Exception
-     */
     public void testReceive_NonBlockNoServerBufNotEmpty() throws Exception {
         this.channel1.configureBlocking(false);
         connectWithoutServer();
@@ -1021,17 +995,6 @@
         assertNull(this.channel1.receive(dst));
     }
 
-    /**
-     * Test method for 'DatagramChannelImpl.receive(ByteBuffer)'
-     * 
-     * @throws Exception
-     */
-    public void testReceive_BlockNoServerBufFull() throws Exception {
-        assertTrue(this.channel1.isBlocking());
-        connectWithoutServer();
-        ByteBuffer dst = allocateFullBuf();
-        closeBlockedChannelForReceive(dst);
-    }
 
     /**
      * Test method for 'DatagramChannelImpl.receive(ByteBuffer)'
@@ -1132,35 +1095,6 @@
         connectWithoutServer();
         ByteBuffer dst = ByteBuffer.allocateDirect(size);
         assertNull(this.channel1.receive(dst));
-    }
-
-    private void receiveBlockNoServer(int size) throws IOException {
-        connectWithoutServer();
-        ByteBuffer dst = ByteBuffer.allocateDirect(size);
-        closeBlockedChannelForReceive(dst);
-    }
-
-    private void closeBlockedChannelForReceive(ByteBuffer dst)
-            throws IOException {
-        // TODO refine async close test when AbstractInterruptibleChannel
-        // complete
-        // to break the blocking status, let a thread to close this channel.
-        new Thread() {
-            public void run() {
-                try {
-                    Thread.sleep(TIME_UNIT);
-                    channel1.close();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        }.start();
-        try {
-            this.channel1.receive(dst);
-            fail("Should throw a AsynchronousCloseException");
-        } catch (AsynchronousCloseException e) {
-            //expected
-        }
     }
 
     private void receiveNoServerChannelClose() throws IOException {



Mime
View raw message