incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: incubator-altrmi/src/test/org/apache/altrmi/test/messenger MessengerTestCase.java
Date Fri, 21 Mar 2003 00:15:43 GMT
hammant     2003/03/20 16:15:42

  Modified:    .        build.xml default.properties
  Added:       lib      commons-beanutils-1.6.jar
                        commons-collections-2.1-dev.jar
                        commons-digester-1.3.jar
                        commons-messenger-1.0-dev-12.jar
                        commons-pool-1.1-dev.jar
               src/conf Messenger.xml
               src/java/org/apache/altrmi/client/impl/messenger
                        SynchronousMessengerHostContext.java
               src/java/org/apache/altrmi/server/impl/messenger
                        SynchronousMessengerServer.java
               src/test/org/apache/altrmi/test/messenger
                        MessengerTestCase.java
  Log:
  start of unit tests for JMS Messanger transport
  
  Revision  Changes    Path
  1.7       +13 -0     incubator-altrmi/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/build.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- build.xml	15 Mar 2003 02:35:55 -0000	1.6
  +++ build.xml	21 Mar 2003 00:15:41 -0000	1.7
  @@ -36,7 +36,14 @@
           <pathelement location="${jakarta-commons-attributes.jar}"/>
           <pathelement location="${jakarta-commons-httpclient.jar}"/>
           <pathelement location="${jakarta-commons-logging.jar}"/>
  +        <pathelement location="${commons-digester.jar}"/>
  +        <pathelement location="${commons-messenger.jar}"/>
  +        <pathelement location="${commons-collections.jar}"/>
  +        <pathelement location="${commons-beanutils.jar}"/>
  +        <pathelement location="${commons-pool.jar}"/>
           <pathelement location="${jakarta-bcel.jar}"/>
  +        <pathelement location="${spiritwave.jar}"/>
  +        <pathelement location="${jms.jar}"/>
           <pathelement path="${java.class.path}"/>
           <pathelement path="${cornerstone-api.jar}"/>
           <pathelement path="${phoenix-client.jar}"/>
  @@ -304,6 +311,12 @@
       <target name="test-run">
   
           <mkdir dir="${build.tests}"/>
  +
  +        <copy todir="${build.testclasses}">
  +            <fileset dir="src/conf">
  +                <include name="Mess*"/>
  +            </fileset>
  +        </copy>
   
           <!-- Plain tests -->
   
  
  
  
  1.4       +7 -0      incubator-altrmi/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/default.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- default.properties	15 Mar 2003 02:36:10 -0000	1.3
  +++ default.properties	21 Mar 2003 00:15:41 -0000	1.4
  @@ -35,7 +35,14 @@
   phoenix-client.jar=./lib/optional/phoenix-client.jar
   jakarta-commons-attributes.jar=./lib/commons-attributes-0.1.jar
   jakarta-commons-logging.jar=./lib/commons-logging.jar
  +commons-messenger.jar=./lib/commons-messenger-1.0-dev-12.jar
  +commons-digester.jar=./lib/commons-digester-1.3.jar
  +commons-collections.jar=./lib/commons-collections-2.1-dev.jar
  +commons-beanutils.jar=./lib/commons-beanutils-1.6.jar
  +commons-pool.jar=./lib/commons-pool-1.1-dev.jar
  +spiritwave.jar=./lib/spiritwave-5.3-b47.jar
   excalibur-lifecycle.jar=./lib/optional/excalibur-lifecycle-1.0.jar
  +jms.jar=./lib/jms-1.0.2b.jar
   phoenix-metagenerate.jar=./lib/buildtime/phoenix-metagenerate.jar
   qdox.jar=./lib/buildtime/qdox-1.0.jar
   
  
  
  
  1.1                  incubator-altrmi/lib/commons-beanutils-1.6.jar
  
  	<<Binary file>>
  
  
  1.1                  incubator-altrmi/lib/commons-collections-2.1-dev.jar
  
  	<<Binary file>>
  
  
  1.1                  incubator-altrmi/lib/commons-digester-1.3.jar
  
  	<<Binary file>>
  
  
  1.1                  incubator-altrmi/lib/commons-messenger-1.0-dev-12.jar
  
  	<<Binary file>>
  
  
  1.1                  incubator-altrmi/lib/commons-pool-1.1-dev.jar
  
  	<<Binary file>>
  
  
  1.1                  incubator-altrmi/src/conf/Messenger.xml
  
  Index: Messenger.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <manager>
  
    <!-- Used by JUnit test cases -->
    <messenger name="cacheTopicConnection">
      <factory className="com.spirit.messenger.WaveTopicSessionFactory">
        <property>
          <name>driverName</name>
          <value>SpiritJungle</value>
        </property>          
  			<property> 
  				<name>discoverURL</name> 
  				<value>multicast://224.0.0.04:5076</value> 
  			</property> 
        <property>
          <name>tcpNoDelay</name>
          <value>true</value>
        </property>          
      </factory>
    </messenger>
  
    <messenger name="cacheQueueConnection">
      <factory className="com.spirit.messenger.WaveQueueSessionFactory">
        <property>
          <name>driverName</name>
          <value>SpiritJungle</value>
        </property>          
  			<property> 
  				<name>discoverURL</name> 
  				<value>multicast://224.0.0.04:5076</value> 
  			</property> 
        <property>
          <name>tcpNoDelay</name>
          <value>true</value>
        </property>          
      </factory>
    </messenger>
  
    <messenger name="cacheQueueConnection2">
      <factory className="com.spirit.messenger.WaveQueueSessionFactory">
        <property>
          <name>driverName</name>
          <value>SpiritJungle</value>
        </property>          
  			<property> 
  				<name>discoverURL</name> 
  				<value>multicast://224.0.0.04:5076</value> 
  			</property> 
        <property>
          <name>tcpNoDelay</name>
          <value>true</value>
        </property>          
      </factory>
    </messenger>
  </manager>
  
  
  
  1.1                  incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger/SynchronousMessengerHostContext.java
  
  Index: SynchronousMessengerHostContext.java
  ===================================================================
  /**
   * Created by IntelliJ IDEA.
   * User: Administrator
   * Date: Mar 20, 2003
   * Time: 9:33:45 PM
   * To change this template use Options | File Templates.
   */
  package org.apache.altrmi.client.impl.messenger;
  
  import org.apache.altrmi.client.HostContext;
  import org.apache.altrmi.client.ClientInvocationHandler;
  import org.apache.commons.messenger.Messenger;
  
  public class SynchronousMessengerHostContext implements HostContext {
      public SynchronousMessengerHostContext(Messenger clientMessenger) {
      }
  
      public ClientInvocationHandler getClientInvocationHandler() {
          return null;
      }
  }
  
  
  
  1.1                  incubator-altrmi/src/java/org/apache/altrmi/server/impl/messenger/SynchronousMessengerServer.java
  
  Index: SynchronousMessengerServer.java
  ===================================================================
  /**
   * Created by IntelliJ IDEA.
   * User: Administrator
   * Date: Mar 20, 2003
   * Time: 9:26:16 PM
   * To change this template use Options | File Templates.
   */
  package org.apache.altrmi.server.impl.messenger;
  
  import org.apache.altrmi.server.impl.AbstractServer;
  import org.apache.altrmi.server.ServerException;
  import org.apache.commons.messenger.Messenger;
  
  public class SynchronousMessengerServer extends AbstractServer {
      public SynchronousMessengerServer(Messenger messenger) {
          super(null);
      }
  
      public void start() throws ServerException {
      }
  
      public void stop() {
      }
  }
  
  
  
  1.1                  incubator-altrmi/src/test/org/apache/altrmi/test/messenger/MessengerTestCase.java
  
  Index: MessengerTestCase.java
  ===================================================================
  package org.apache.altrmi.test.messenger;
  
  import junit.framework.TestCase;
  import org.apache.altrmi.server.impl.socket.CompleteSocketCustomStreamServer;
  import org.apache.altrmi.server.impl.messenger.SynchronousMessengerServer;
  import org.apache.altrmi.server.PublicationDescription;
  import org.apache.altrmi.test.*;
  import org.apache.altrmi.client.impl.ClientSideClassFactory;
  import org.apache.altrmi.client.impl.messenger.SynchronousMessengerHostContext;
  import org.apache.altrmi.client.impl.socket.SocketCustomStreamHostContext;
  import org.apache.commons.messenger.Messenger;
  import org.apache.commons.messenger.MessengerManager;
  
  public class MessengerTestCase extends AbstractHelloTestCase {
      private Messenger serverMessenger;
      private Messenger clientMessenger;
  
      public MessengerTestCase(String name) {
          super(name);
      }
  
      protected void setUp() throws Exception {
          super.setUp();
  
          // server side setup.
          Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
          serverMessenger = MessengerManager.get("cacheTopicConnection");
          server = new SynchronousMessengerServer(serverMessenger);
          testServer = new TestInterfaceImpl();
          PublicationDescription pd = new PublicationDescription(TestInterface.class,
                  new Class[]{TestInterface3.class, TestInterface2.class});
          server.publish(testServer, "Hello", pd);
          server.start();
  
          // Client side setup
          altrmiFactory = new ClientSideClassFactory();
          clientMessenger = MessengerManager.get("cacheTopicConnection");
          altrmiFactory.setHostContext(new SynchronousMessengerHostContext(clientMessenger),
false);
          testClient = (TestInterface) altrmiFactory.lookup("Hello");
  
          // just a kludge for unit testing given we are intrinsically dealing with
          // threads, AltRMI being a client/server thing
          Thread.yield();
      }
  
  
      protected void tearDown() throws Exception {
          testClient = null;
          System.gc();
          Thread.yield();
          altrmiFactory.close();
          Thread.yield();
          server.stop();
          Thread.yield();
          server = null;
          testServer = null;
          super.tearDown();
      }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message