harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r527774 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java
Date Thu, 12 Apr 2007 05:30:55 GMT
Author: pyang
Date: Wed Apr 11 22:30:55 2007
New Revision: 527774

URL: http://svn.apache.org/viewvc?view=rev&rev=527774
Log:
Apply patch for HARMONY-3607([classlib][luni]add tests for java.net.DatagramSocketImpl.connect)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java?view=diff&rev=527774&r1=527773&r2=527774
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/DatagramSocketImplTest.java
Wed Apr 11 22:30:55 2007
@@ -35,6 +35,18 @@
         MockDatagramSocketImpl impl = new MockDatagramSocketImpl();
         assertNull(impl.getFileDescriptor());
     }
+    
+    
+    public void test_connect() throws Exception {
+        MockDatagramSocketImpl impl = new MockDatagramSocketImpl();
+        InetAddress localhost = InetAddress.getByName("localhost"); //$NON-NLS-1$
+        // connect do nothing, so will not throw exception
+        impl.test_connect(localhost, 0);
+        impl.test_connect(localhost, -1);
+        impl.test_connect(null, -1);
+        // disconnect
+        impl.test_disconnect();
+    }
 }
 
 class MockDatagramSocketImpl extends DatagramSocketImpl {
@@ -113,7 +125,7 @@
 
     @Override
     protected void send(DatagramPacket pack) throws IOException {
-        // TODO Auto-generated method stub
+        // empty
 
     }
 
@@ -132,4 +144,11 @@
         // empty
     }
 
+    public void test_connect(InetAddress inetAddr, int port ) throws SocketException{
+        super.connect(inetAddr, port);
+    }
+    
+    public void test_disconnect(){
+        super.disconnect();
+    }
 }



Mime
View raw message