qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r743028 - in /qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol: AMQProtocolSessionMBeanTest.java MaxChannelsTest.java MockIoSession.java TestIoSession.java
Date Tue, 10 Feb 2009 17:38:46 GMT
Author: aidan
Date: Tue Feb 10 17:38:43 2009
New Revision: 743028

URL: http://svn.apache.org/viewvc?rev=743028&view=rev
Log:
Remove MockIoSession, replace with TestIoSession everywhere.

Removed:
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MockIoSession.java
Modified:
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?rev=743028&r1=743027&r2=743028&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
Tue Feb 10 17:38:43 2009
@@ -114,7 +114,7 @@
 
         IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
         _protocolSession =
-            new AMQMinaProtocolSession(new MockIoSession(), appRegistry.getVirtualHostRegistry(),
new AMQCodecFactory(true),
+            new AMQMinaProtocolSession(new TestIoSession(), appRegistry.getVirtualHostRegistry(),
new AMQCodecFactory(true),
                 null);
         _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
         _channel = new AMQChannel(_protocolSession, 1, _messageStore);

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java?rev=743028&r1=743027&r2=743028&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
Tue Feb 10 17:38:43 2009
@@ -38,7 +38,7 @@
 
     public void testChannels() throws Exception
     {
-        _session = new AMQMinaProtocolSession(new MockIoSession(), _appRegistry
+        _session = new AMQMinaProtocolSession(new TestIoSession(), _appRegistry
 				.getVirtualHostRegistry(), new AMQCodecFactory(true), null);
         _session.setVirtualHost(_appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java?rev=743028&r1=743027&r2=743028&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
Tue Feb 10 17:38:43 2009
@@ -24,6 +24,7 @@
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.apache.qpid.pool.ReadWriteThreadModel;
 
+import java.net.InetAddress;
 import java.net.SocketAddress;
 import java.net.InetSocketAddress;
 import java.util.Set;
@@ -37,6 +38,8 @@
 public class TestIoSession implements IoSession
 {
     private final ConcurrentMap attributes = new ConcurrentHashMap();
+    private String _address;
+    private int _port;
 
     public TestIoSession()
     {
@@ -139,7 +142,7 @@
 
     public SocketAddress getRemoteAddress()
     {
-        return new InetSocketAddress("127.0.0.1", 1234);
+        return new InetSocketAddress(getAddress(), getPort());
     }
 
     public SocketAddress getLocalAddress()
@@ -282,6 +285,26 @@
         return 0; 
     }
 
+    public void setAddress(String string)
+    {
+        this._address = string;
+    }
+
+    public String getAddress()
+    {
+        return _address;
+    }
+
+    public void setPort(int _port)
+    {
+        this._port = _port;
+    }
+
+    public int getPort()
+    {
+        return _port;
+    }
+
     /**
      * Test implementation of IoServiceConfig
      */



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message