Author: fhanik Date: Thu Jul 6 09:16:53 2006 New Revision: 419605 URL: http://svn.apache.org/viewvc?rev=419605&view=rev Log: Test classes for low level IO testing
Added: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/group/ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/group/interceptors/ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/TestSerialization.java tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/mina/ Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketNioSend.java tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java Added: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/TestSerialization.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/TestSerialization.java?rev=419605&view=auto ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/TestSerialization.java (added) +++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/io/TestSerialization.java Thu Jul 6 09:16:53 2006 @@ -0,0 +1,24 @@ +package org.apache.catalina.tribes.test.io; + +import org.apache.catalina.tribes.io.XByteBuffer; +import junit.framework.TestCase; + +public class TestSerialization extends TestCase { + protected void setUp() throws Exception { + super.setUp(); + } + + public void testEmptyArray() throws Exception { + + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public static void main(String[] args) throws Exception { + //XByteBuffer.deserialize(new byte[0]); + XByteBuffer.deserialize(new byte[] {-84, -19, 0, 5, 115, 114, 0, 17, 106}); + } + +} Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketNioSend.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketNioSend.java?rev=419605&r1=419604&r2=419605&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketNioSend.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketNioSend.java Thu Jul 6 09:16:53 2006 @@ -30,8 +30,9 @@ BigDecimal bytes = new BigDecimal((double)len); NioSender sender = new NioSender(); sender.setDestination(mbr); - sender.setDirectBuffer(true); + sender.setDirectBuffer(false); sender.setSelector(selector); + sender.setTxBufSize(1024*1024); sender.connect(); sender.setMessage(buf); System.out.println("Writing to 9999"); @@ -82,6 +83,7 @@ return; } } + selector.selectedKeys().clear(); } System.out.println("Complete, sleeping 15 seconds"); Thread.sleep(15000); Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java?rev=419605&r1=419604&r2=419605&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java Thu Jul 6 09:16:53 2006 @@ -11,7 +11,7 @@ static long start = 0; static double mb = 0; //static byte[] buf = new byte[32871]; - static byte[] buf = new byte[1024]; + static byte[] buf = new byte[32871]; static boolean first = true; static int count = 0; static DecimalFormat df = new DecimalFormat("##.00"); @@ -20,11 +20,13 @@ public static void main(String[] args) throws Exception { + int size = 43800; + if (args.length > 0 ) try {size=Integer.parseInt(args[0]);}catch(Exception x){} XByteBuffer xbuf = new XByteBuffer(43800,true); ServerSocket srvSocket = new ServerSocket(9999); System.out.println("Listening on 9999"); Socket socket = srvSocket.accept(); - socket.setReceiveBufferSize(43800); + socket.setReceiveBufferSize(size); InputStream in = socket.getInputStream(); Thread t = new Thread() { public void run() { Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java?rev=419605&r1=419604&r2=419605&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java Thu Jul 6 09:16:53 2006 @@ -18,11 +18,13 @@ public static void main(String[] args) throws Exception { - + int size = 43800; + if (args.length > 0 ) try {size=Integer.parseInt(args[0]);}catch(Exception x){} + ServerSocket srvSocket = new ServerSocket(9999); System.out.println("Listening on 9999"); Socket socket = srvSocket.accept(); - socket.setReceiveBufferSize(43800); + socket.setReceiveBufferSize(size); InputStream in = socket.getInputStream(); MyDataReader reader = new MyDataReader(50000); Thread t = new Thread() { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]