geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r448380 - /geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java
Date Wed, 20 Sep 2006 22:37:05 GMT
Author: chirino
Date: Wed Sep 20 15:37:04 2006
New Revision: 448380

URL: http://svn.apache.org/viewvc?view=rev&rev=448380
Log:
Start the transport and just print out the commands the server recives.

Modified:
    geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java

Modified: geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java?view=diff&rev=448380&r1=448379&r2=448380
==============================================================================
--- geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java
(original)
+++ geronimo/sandbox/gcache/openwire/src/test/java/org/apache/geronimo/openwire/transport/tcp/TcpTransportFactoryTest.java
Wed Sep 20 15:37:04 2006
@@ -17,15 +17,18 @@
  */
 package org.apache.geronimo.openwire.transport.tcp;
 
+import java.io.IOException;
 import java.net.URI;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.openwire.command.Command;
 import org.apache.geronimo.openwire.command.NodeInfo;
 import org.apache.geronimo.openwire.transport.DefaultTransportListener;
 import org.apache.geronimo.openwire.transport.Transport;
 import org.apache.geronimo.openwire.transport.TransportAcceptListener;
 import org.apache.geronimo.openwire.transport.TransportFactory;
+import org.apache.geronimo.openwire.transport.TransportListener;
 import org.testng.annotations.AfterSuite;
 import org.testng.annotations.BeforeSuite;
 import org.testng.annotations.Test;
@@ -54,6 +57,24 @@
                 "this parameter is ignored", new URI(serverURI));
         server.setAcceptListener(new TransportAcceptListener () {
             public void onAccept(Transport transport) {
+            	
+            	transport.setTransportListener(new TransportListener() {
+					public void onCommand(Command command) {
+						System.out.println("Got: "+command);
+					}
+					public void onException(IOException error) {
+						System.out.println("Got Error: "+error);
+					}
+					public void transportInterupted() {
+					}
+					public void transportResumed() {
+					}});
+            	
+            	try {
+					transport.start();
+				} catch (Exception e) {
+					onAcceptError(e);
+				}
             }
             
             public void onAcceptError(Exception error) {
@@ -74,7 +95,7 @@
         remoteTransport.start();
         localTransport.start();
         NodeInfo command = new NodeInfo();
-        remoteTransport.oneway(command);
+        remoteTransport.request(command);
         log.info("send " + command);
     }
 



Mime
View raw message