gdamour 2004/05/24 05:03:34
Modified: sandbox/messaging/src/test/org/apache/geronimo/messaging/proxy
EndPointProxyFactoryTest.java
sandbox/messaging/src/test/org/apache/geronimo/messaging/replication
ReplicationMemberImplTest.java
sandbox/messaging/src/test/org/apache/geronimo/messaging/reference
ReferenceManagerImplTest.java
sandbox/messaging/src/test/org/apache/geronimo/messaging/io
StreamManagerImplTest.java
Added: sandbox/messaging/src/test/org/apache/geronimo/messaging
EndPointUtil.java
Log:
o Adds a JUnit utility class to inter-connect EndPoints
Revision Changes Path
1.2 +3 -19
incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/proxy/EndPointProxyFactoryTest.java
Index: EndPointProxyFactoryTest.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/proxy/EndPointProxyFactoryTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EndPointProxyFactoryTest.java 20 May 2004 13:37:11 -0000 1.1
+++ EndPointProxyFactoryTest.java 24 May 2004 12:03:34 -0000 1.2
@@ -22,14 +22,12 @@
import junit.framework.TestCase;
+import org.apache.geronimo.messaging.EndPointUtil;
import org.apache.geronimo.messaging.MockEndPoint;
import org.apache.geronimo.messaging.MockEndPointImpl;
import org.apache.geronimo.messaging.MockNode;
-import org.apache.geronimo.messaging.MsgHeaderConstants;
import org.apache.geronimo.messaging.NodeInfo;
import org.apache.geronimo.messaging.Request;
-import org.apache.geronimo.messaging.interceptors.HeaderOutInterceptor;
-import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
/**
*
@@ -63,21 +61,7 @@
public void testInvoke() throws Exception {
MockEndPoint actual = new MockEndPointImpl(new MockNode(), "",
targets);
- MsgOutInterceptor out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, "",
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "",
- actual.getMsgConsumerOut()));
- factory.setMsgProducerOut(out);
-
- out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, "",
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "",
- factory.getMsgConsumerOut()));
- actual.setMsgProducerOut(out);
+ EndPointUtil.interConnect(actual, factory);
MockEndPoint endPoint = (MockEndPoint) proxy;
Object opaque = new Object();
1.2 +3 -19
incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/replication/ReplicationMemberImplTest.java
Index: ReplicationMemberImplTest.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/replication/ReplicationMemberImplTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ReplicationMemberImplTest.java 11 May 2004 12:06:43 -0000 1.1
+++ ReplicationMemberImplTest.java 24 May 2004 12:03:34 -0000 1.2
@@ -21,11 +21,9 @@
import junit.framework.TestCase;
+import org.apache.geronimo.messaging.EndPointUtil;
import org.apache.geronimo.messaging.MockNode;
-import org.apache.geronimo.messaging.MsgHeaderConstants;
import org.apache.geronimo.messaging.NodeInfo;
-import org.apache.geronimo.messaging.interceptors.HeaderOutInterceptor;
-import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
/**
*
@@ -46,21 +44,7 @@
primary = new ReplicationMemberImpl(new MockNode(), "Group",
targets);
secondary = new ReplicationMemberImpl(new MockNode(), "Group",
targets);
- MsgOutInterceptor out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, dummy,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- secondary.getMsgConsumerOut()));
- primary.setMsgProducerOut(out);
-
- out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, dummy,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- primary.getMsgConsumerOut()));
- secondary.setMsgProducerOut(out);
+ EndPointUtil.interConnect(primary, secondary);
}
public void testRegisterReplicantCapable() {
1.2 +3 -19
incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/reference/ReferenceManagerImplTest.java
Index: ReferenceManagerImplTest.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/reference/ReferenceManagerImplTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ReferenceManagerImplTest.java 11 May 2004 12:06:43 -0000 1.1
+++ ReferenceManagerImplTest.java 24 May 2004 12:03:34 -0000 1.2
@@ -21,11 +21,9 @@
import junit.framework.TestCase;
+import org.apache.geronimo.messaging.EndPointUtil;
import org.apache.geronimo.messaging.MockNode;
-import org.apache.geronimo.messaging.MsgHeaderConstants;
import org.apache.geronimo.messaging.NodeInfo;
-import org.apache.geronimo.messaging.interceptors.HeaderOutInterceptor;
-import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
/**
*
@@ -43,21 +41,7 @@
ReferenceableManager manager1 = new ReferenceableManagerImpl(node1,
"A");
ReferenceableManager manager2 = new ReferenceableManagerImpl(new
MockNode(), "A");
- MsgOutInterceptor out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, node1,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- manager2.getMsgConsumerOut()));
- manager1.setMsgProducerOut(out);
-
- out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, node1,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- manager1.getMsgConsumerOut()));
- manager2.setMsgProducerOut(out);
+ EndPointUtil.interConnect(manager1, manager2);
MockReferenceableImpl reference1 = new MockReferenceableImpl();
ReferenceableInfo info = manager1.register(reference1);
1.2 +3 -20
incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/io/StreamManagerImplTest.java
Index: StreamManagerImplTest.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/io/StreamManagerImplTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StreamManagerImplTest.java 11 May 2004 12:06:43 -0000 1.1
+++ StreamManagerImplTest.java 24 May 2004 12:03:34 -0000 1.2
@@ -23,11 +23,9 @@
import junit.framework.TestCase;
+import org.apache.geronimo.messaging.EndPointUtil;
import org.apache.geronimo.messaging.MockNode;
-import org.apache.geronimo.messaging.MsgHeaderConstants;
import org.apache.geronimo.messaging.NodeInfo;
-import org.apache.geronimo.messaging.interceptors.HeaderOutInterceptor;
-import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
/**
*
@@ -64,24 +62,9 @@
node.setNodeInfo(new NodeInfo("dummy", address, 8081));
StreamManager master = new StreamManagerImpl(node);
-
StreamManager slave = new StreamManagerImpl(node);
- MsgOutInterceptor out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, node,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- slave.getMsgConsumerOut()));
- master.setMsgProducerOut(out);
-
- out =
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_NODE, node,
- new HeaderOutInterceptor(
- MsgHeaderConstants.SRC_ENDPOINT, "DUMMY",
- master.getMsgConsumerOut()));
- slave.setMsgProducerOut(out);
+ EndPointUtil.interConnect(master, slave);
int size = 1024*1024;
InputStream inputStream = new DummyInputStream(size);
1.1
incubator-geronimo/sandbox/messaging/src/test/org/apache/geronimo/messaging/EndPointUtil.java
Index: EndPointUtil.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.geronimo.messaging;
import org.apache.geronimo.messaging.interceptors.HeaderOutInterceptor;
import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
/**
*
* @version $Revision: 1.1 $ $Date: 2004/05/24 12:03:34 $
*/
public class EndPointUtil
{
public static void interConnect(EndPoint anEP1, EndPoint anEP2) {
MsgOutInterceptor out =
new HeaderOutInterceptor(
MsgHeaderConstants.SRC_NODE, "",
new HeaderOutInterceptor(
MsgHeaderConstants.SRC_ENDPOINT, "",
anEP1.getMsgConsumerOut()));
anEP2.setMsgProducerOut(out);
out =
new HeaderOutInterceptor(
MsgHeaderConstants.SRC_NODE, "",
new HeaderOutInterceptor(
MsgHeaderConstants.SRC_ENDPOINT, "",
anEP2.getMsgConsumerOut()));
anEP1.setMsgProducerOut(out);
}
}