directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject svn commit: r111993 - /incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java
Date Wed, 15 Dec 2004 16:32:03 GMT
Author: bloritsch
Date: Wed Dec 15 08:32:02 2004
New Revision: 111993

URL: http://svn.apache.org/viewcvs?view=rev&rev=111993
Log:
Move the same type of thing over to the SEDAServer test
Modified:
   incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java

Modified: incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java?view=diff&rev=111993&p1=incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java&r1=111992&p2=incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java&r2=111993
==============================================================================
--- incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java
(original)
+++ incubator/directory/network/trunk/sedang/src/test/org/apache/directory/seda/test/TestSEDAServer.java
Wed Dec 15 08:32:02 2004
@@ -24,6 +24,7 @@
 
 import java.nio.channels.SocketChannel;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.InetAddress;
@@ -83,7 +84,7 @@
         }
     }
 
-    public void disable_testConnection() throws IOException
+    public void testConnection() throws IOException
     {
         final SEDAServer server = SEDAServer.getServer();
         final SocketChannel client = SocketChannel.open();
@@ -107,7 +108,7 @@
             client.close();
             buffer.flip();
 
-            assertEquals( "test", buffer.asCharBuffer().toString() );
+            assertEquals( "test", readString( buffer, "ISO-8859-1" ) );
 
             BufferPool.putBuffer(buffer);
         }
@@ -116,5 +117,11 @@
             server.removeProtocolHandler( PORT );
             if (null != client) client.close();
         }
+    }
+
+    private String readString( final ByteBuffer buffer, final String charset )
+    {
+        final Charset set = Charset.forName( charset );
+        return set.decode( buffer ).toString();
     }
 }

Mime
View raw message