hammant     2003/08/19 23:21:34

  Modified:    .        build.xml
               src/java/org/apache/altrmi/server/impl/direct
                        DirectMarshalledServer.java
               src/test/org/apache/altrmi/test/direct
                        DirectMarshalledTestCase.java
  Log:
  More testcases passing now
  
  Revision  Changes    Path
  1.21      +2 -0      incubator-altrmi/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/build.xml,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.xml 15 Jul 2003 07:10:39 -0000      1.20
  +++ build.xml 20 Aug 2003 06:21:34 -0000      1.21
  @@ -371,6 +371,8 @@
                       <include name="**/${test.filter}.class"/>
                       <exclude name="**/Abstract*"/>
                       <exclude name="**/BetwixtTestCase.class"/> 
  +                    
  +                    <!-- <exclude 
name="**/CallbackEnabledCustomStreamTestCase.class"/> -->
                       <!-- <exclude 
name="**/SynchronousMessengerTestCase.class"/> --> 
                   </fileset>
               </batchtest>
  
  
  
  1.8       +66 -43    
incubator-altrmi/src/java/org/apache/altrmi/server/impl/direct/DirectMarshalledServer.java
  
  Index: DirectMarshalledServer.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-altrmi/src/java/org/apache/altrmi/server/impl/direct/DirectMarshalledServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DirectMarshalledServer.java       19 Aug 2003 21:24:09 -0000      1.7
  +++ DirectMarshalledServer.java       20 Aug 2003 06:21:34 -0000      1.8
  @@ -80,53 +80,83 @@
    * @version $Revision$
    */
   public class DirectMarshalledServer extends AbstractServer
  -        implements ServerMarshalledInvocationHandler
  -{
  +    implements ServerMarshalledInvocationHandler {
   
       private final MarshalledInvocationHandlerAdapter 
m_marshalledInvocationHandlerAdapter;
   
       /**
        * Constructor DirectMarshalledServer for use with pre-exiting 
InvocationHandlerAdapter and MarshalledInvocationHandler
        *
  -     * @param classRetriever
  -     * @param authenticator
  +     * @param invocationHandlerAdapter
        * @param serverMonitor
        * @param threadPool
        * @param contextFactory
  -     * @param marshalledInvocationHandlerAdapter
  +     * @param m_marshalledInvocationHandlerAdapter
        */
       public DirectMarshalledServer(
  -
  -            ClassRetriever classRetriever,
  -            Authenticator authenticator,
  -            ServerMonitor serverMonitor,
  -            ThreadPool threadPool,
  -            ServerSideClientContextFactory contextFactory,
  -            MarshalledInvocationHandlerAdapter 
marshalledInvocationHandlerAdapter)
  -    {
  +        InvocationHandlerAdapter invocationHandlerAdapter,
  +        ServerMonitor serverMonitor,
  +        ThreadPool threadPool,
  +        ServerSideClientContextFactory contextFactory,
  +        MarshalledInvocationHandlerAdapter 
m_marshalledInvocationHandlerAdapter) {
           super(
  -                new InvocationHandlerAdapter(
  -                        classRetriever,
  -                        authenticator,
  -                        serverMonitor,
  -                        contextFactory),
  -                serverMonitor, threadPool, contextFactory);
  -        m_marshalledInvocationHandlerAdapter = 
marshalledInvocationHandlerAdapter;
  +            invocationHandlerAdapter,
  +            serverMonitor,
  +            threadPool,
  +            contextFactory);
  +        this.m_marshalledInvocationHandlerAdapter = 
m_marshalledInvocationHandlerAdapter;
  +    }
  +
  +    public static class WithMarshalledInvocationHandlerAdapter extends 
DirectMarshalledServer {
  +        public WithMarshalledInvocationHandlerAdapter(
  +            InvocationHandlerAdapter invocationHandlerAdapter,
  +            MarshalledInvocationHandlerAdapter 
marshalledInvocationHandlerAdapter) {
  +            super(
  +                invocationHandlerAdapter,
  +                new NullServerMonitor(),
  +                new DefaultThreadPool(),
  +                new DefaultServerSideClientContextFactory(),
  +                marshalledInvocationHandlerAdapter
  +            );
  +        }
       }
   
  -    public static class WithSimpleDefaults extends DirectMarshalledServer
  -    {
  -        public WithSimpleDefaults()
  -        {
  +    public static class WithInvocationHandlerAdapter extends 
WithMarshalledInvocationHandlerAdapter {
  +        public WithInvocationHandlerAdapter(InvocationHandlerAdapter 
invocationHandlerAdapter) {
               super(
  +                invocationHandlerAdapter,
  +                new 
MarshalledInvocationHandlerAdapter(invocationHandlerAdapter)
  +            );
  +        }
  +    }
  +
  +//    public DirectMarshalledServer(
  +//
  +//            ClassRetriever classRetriever,
  +//            Authenticator authenticator,
  +//            ServerMonitor serverMonitor,
  +//            ThreadPool threadPool,
  +//            ServerSideClientContextFactory contextFactory,
  +//            MarshalledInvocationHandlerAdapter 
marshalledInvocationHandlerAdapter)
  +//    {
  +//        super(
  +//                new InvocationHandlerAdapter(
  +//                        classRetriever,
  +//                        authenticator,
  +//                        serverMonitor,
  +//                        contextFactory),
  +//                serverMonitor, threadPool, contextFactory);
  +//        m_marshalledInvocationHandlerAdapter = 
marshalledInvocationHandlerAdapter;
  +//    }
  +
  +    public static class WithSimpleDefaults extends 
WithInvocationHandlerAdapter {
  +        public WithSimpleDefaults() {
  +            super(
  +                new InvocationHandlerAdapter(
                       new NoClassRetriever(),
                       new DefaultAuthenticator(),
                       new NullServerMonitor(),
  -                    new DefaultThreadPool(),
  -                    new DefaultServerSideClientContextFactory(), new 
MarshalledInvocationHandlerAdapter(
  -                            new InvocationHandlerAdapter(new 
NoClassRetriever(),
  -                                    new DefaultAuthenticator(), new 
NullServerMonitor(),
  -                                    new 
DefaultServerSideClientContextFactory()))
  +                    new DefaultServerSideClientContextFactory())
               );
           }
       }
  @@ -135,8 +165,7 @@
        * Method start
        *
        */
  -    public void start()
  -    {
  +    public void start() {
           setState(STARTED);
       }
   
  @@ -144,8 +173,7 @@
        * Method stop
        *
        */
  -    public void stop()
  -    {
  +    public void stop() {
   
           setState(SHUTTINGDOWN);
   
  @@ -163,8 +191,7 @@
        * @return
        *
        */
  -    public byte[] handleInvocation(byte[] request, Object connectionDetails)
  -    {
  +    public byte[] handleInvocation(byte[] request, Object connectionDetails) 
{
           return 
m_marshalledInvocationHandlerAdapter.handleInvocation(request, 
connectionDetails);
       }
   
  @@ -177,15 +204,11 @@
        * @return
        *
        */
  -    public Reply handleInvocation(Request request, Object connectionDetails)
  -    {
  +    public Reply handleInvocation(Request request, Object connectionDetails) 
{
   
  -        if (getState() == STARTED)
  -        {
  +        if (getState() == STARTED) {
               return super.handleInvocation(request, connectionDetails);
  -        }
  -        else
  -        {
  +        } else {
               return new InvocationExceptionReply("Service is not started");
           }
       }
  
  
  
  1.4       +6 -2      
incubator-altrmi/src/test/org/apache/altrmi/test/direct/DirectMarshalledTestCase.java
  
  Index: DirectMarshalledTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-altrmi/src/test/org/apache/altrmi/test/direct/DirectMarshalledTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DirectMarshalledTestCase.java     15 Jul 2003 07:10:46 -0000      1.3
  +++ DirectMarshalledTestCase.java     20 Aug 2003 06:21:34 -0000      1.4
  @@ -92,11 +92,15 @@
           // Client side setup
           factory = new ClientSideClassFactory(new 
DirectMarshalledHostContext.WithSimpleDefaults((DirectMarshalledServer)server), 
false);
   
  -        //testClient = (TestInterface) m_factory.lookup("Hello");
  +        testClient = (TestInterface) factory.lookup("Hello");
   
           // just a kludge for unit testing given we are intrinsically dealing 
with
           // threads, AltRMI being a client/server thing
  -        //Thread.yield();
  +        Thread.yield();
  +    }
  +
  +    public void testHello2Call() throws Exception {
  +        super.testHello2Call();
       }
   
       protected void tearDown() throws Exception
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to