avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket CustomStreamJNDITestCase.java CustomStreamSocketClientJNDITest.java
Date Sun, 25 Aug 2002 23:20:23 GMT
hammant     2002/08/25 16:20:23

  Added:       altrmi/src/test/org/apache/excalibur/altrmi/test/socket
                        CustomStreamJNDITestCase.java
  Removed:     altrmi/src/test/org/apache/excalibur/altrmi/test/socket
                        CustomStreamSocketClientJNDITest.java
  Log:
  JNDI test now a TestCase
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/socket/CustomStreamJNDITestCase.java
  
  Index: CustomStreamJNDITestCase.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.altrmi.test.socket;
  
  import org.apache.excalibur.altrmi.server.impl.socket.CompleteSocketCustomStreamServer;
  import org.apache.excalibur.altrmi.test.TestInterface;
  import org.apache.excalibur.altrmi.test.AbstractHelloTestCase;
  import org.apache.excalibur.altrmi.test.SimpleHelloTestServerImpl;
  
  import javax.naming.Context;
  import javax.naming.InitialContext;
  import java.util.Hashtable;
  
  
  /**
   * Test Custom Stream over sockets.
   * @author Paul Hammant
   */
  public class CustomStreamJNDITestCase extends AbstractHelloTestCase
  {
  
      public CustomStreamJNDITestCase(String name)
      {
          super(name);
      }
  
      protected void setUp() throws Exception
      {
          super.setUp();
  
          // server side setup.
          server = new CompleteSocketCustomStreamServer(10006);
          testServer = new SimpleHelloTestServerImpl();
          server.publish(testServer, "Hello", TestInterface.class);
          server.start();
  
          // Client side setup
          // JNDI lookup.  Note there are no imports of Altrmi classes in this test.
          Hashtable env = new Hashtable();
  
          env.put(
              Context.INITIAL_CONTEXT_FACTORY,
              "org.apache.excalibur.altrmi.client.impl.naming.DefaultAltrmiInitialContextFactory"
);
          env.put( Context.PROVIDER_URL, "altrmi://localhost:10006/SocketCustomStream" );
          env.put( "proxy.type", "ClientSideClasses" );
          env.put( "bean.type", "NotBeanOnly" );
  
          Context ctx = new InitialContext( env );
  
          testClient = (TestInterface)ctx.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
      {
          server.stop();
          Thread.yield();
          server = null;
          testServer = null;
          super.tearDown();
      }
  
  
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message