directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r349935 - in /directory/network/branches/chain_refactor/src: java/org/apache/mina/integration/spring/support/ test/org/apache/mina/examples/echoserver/ test/org/apache/mina/integration/spring/support/
Date Wed, 30 Nov 2005 12:48:58 GMT
Author: trustin
Date: Wed Nov 30 04:48:49 2005
New Revision: 349935

URL: http://svn.apache.org/viewcvs?rev=349935&view=rev
Log:
Fixed failing test cases except for spring integration package

Modified:
    directory/network/branches/chain_refactor/src/java/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBean.java
    directory/network/branches/chain_refactor/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
    directory/network/branches/chain_refactor/src/test/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBeanTest.java

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBean.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBean.java?rev=349935&r1=349934&r2=349935&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBean.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBean.java
Wed Nov 30 04:48:49 2005
@@ -18,9 +18,9 @@
  */
 package org.apache.mina.integration.spring.support;
 
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IoFilter;
-import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.integration.spring.IoFilterMapping;
 import org.springframework.beans.factory.config.AbstractFactoryBean;
@@ -72,10 +72,10 @@
         /*
          * Add filters to the end of the filter chain.
          */
-        IoFilterChain filterChain = sessionManager.getFilterChain();
+        DefaultIoFilterChainBuilder builder = ( DefaultIoFilterChainBuilder ) sessionManager.getFilterChainBuilder();
         for( int i = 0; i < filterMappings.length; i++ )
         {
-            filterChain.addLast( filterMappings[ i ].getName(),
+            builder.addLast( filterMappings[ i ].getName(),
                     filterMappings[ i ].getFilter() );
         }
     }
@@ -94,8 +94,8 @@
         /*
          * Remove all filters.
          */
-        IoFilterChain filterChain = sessionManager.getFilterChain();
-        filterChain.clear();
+        DefaultIoFilterChainBuilder builder = ( DefaultIoFilterChainBuilder ) sessionManager.getFilterChainBuilder();
+        builder.clear();
     }
 
     /**

Modified: directory/network/branches/chain_refactor/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java?rev=349935&r1=349934&r2=349935&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
(original)
+++ directory/network/branches/chain_refactor/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
Wed Nov 30 04:48:49 2005
@@ -33,6 +33,7 @@
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
+import org.apache.mina.common.IoFilterChain.Entry;
 import org.apache.mina.examples.echoserver.ssl.BogusSSLContextFactory;
 import org.apache.mina.filter.LoggingFilter;
 import org.apache.mina.filter.SSLFilter;
@@ -78,7 +79,7 @@
         SSLFilter connectorSSLFilter =
             new SSLFilter( BogusSSLContextFactory.getInstance( false ) );
         connectorSSLFilter.setUseClientMode( true ); // set client mode
-        ( ( DefaultIoFilterChainBuilder ) acceptor.getFilterChainBuilder() ).addLast( "SSL",
connectorSSLFilter );
+        ( ( DefaultIoFilterChainBuilder ) connector.getFilterChainBuilder() ).addLast( "SSL",
connectorSSLFilter );
 
         testConnector( connector );
     }
@@ -143,9 +144,10 @@
         testConnector0( session );
         
         // Send closeNotify to test TLS closure if it is TLS connection.
-        SSLFilter sslf = ( SSLFilter ) ( ( DefaultIoFilterChainBuilder ) connector.getFilterChainBuilder()
).get( "SSL" ).getFilter();
-        if( sslf != null )
+        Entry sslFilterEntry = ( ( DefaultIoFilterChainBuilder ) connector.getFilterChainBuilder()
).get( "SSL" );
+        if( sslFilterEntry != null )
         {
+            SSLFilter sslf = ( SSLFilter ) sslFilterEntry .getFilter();
             ( ( DefaultIoFilterChainBuilder ) connector.getFilterChainBuilder() ).addFirst(
"log", new LoggingFilter() );
             sslf.stopSSL( session ).join();
             

Modified: directory/network/branches/chain_refactor/src/test/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBeanTest.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/test/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBeanTest.java?rev=349935&r1=349934&r2=349935&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/test/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBeanTest.java
(original)
+++ directory/network/branches/chain_refactor/src/test/org/apache/mina/integration/spring/support/AbstractIoSessionManagerFactoryBeanTest.java
Wed Nov 30 04:48:49 2005
@@ -20,9 +20,9 @@
 
 import junit.framework.TestCase;
 
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IoFilter;
-import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.integration.spring.IoFilterMapping;
 import org.easymock.MockControl;
@@ -70,8 +70,8 @@
         /*
          * Create EasyMock mocks.
          */
-        MockControl mockIoFilterChain = MockControl
-                .createStrictControl( IoFilterChain.class );
+        MockControl mockIoFilterChainBuilder = MockControl
+                .createStrictControl( DefaultIoFilterChainBuilder.class );
         MockControl mockIoSessionManager = MockControl
                 .createControl( IoSessionManager.class );
 
@@ -85,23 +85,23 @@
 
         IoSessionManager ioSessionManager = ( IoSessionManager ) mockIoSessionManager
                 .getMock();
-        IoFilterChain ioFilterChain = ( IoFilterChain ) mockIoFilterChain
+        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder
) mockIoFilterChainBuilder
                 .getMock();
 
         /*
          * Record expectations.
          */
-        ioFilterChain.addLast( "filter0", filters[ 0 ] );
-        ioFilterChain.addLast( "filter1", filters[ 1 ] );
-        ioFilterChain.addLast( "filter2", filters[ 2 ] );
+        ioFilterChainBuilder.addLast( "filter0", filters[ 0 ] );
+        ioFilterChainBuilder.addLast( "filter1", filters[ 1 ] );
+        ioFilterChainBuilder.addLast( "filter2", filters[ 2 ] );
 
-        ioSessionManager.getFilterChain();
-        mockIoSessionManager.setReturnValue( mockIoFilterChain.getMock() );
+        ioSessionManager.getFilterChainBuilder();
+        mockIoSessionManager.setReturnValue( mockIoFilterChainBuilder.getMock() );
 
         /*
          * Replay.
          */
-        mockIoFilterChain.replay();
+        mockIoFilterChainBuilder.replay();
         mockIoSessionManager.replay();
 
         factory.setFilters( filters );
@@ -110,7 +110,7 @@
         /*
          * Verify.
          */
-        mockIoFilterChain.verify();
+        mockIoFilterChainBuilder.verify();
         mockIoSessionManager.verify();
     }
 
@@ -125,8 +125,8 @@
         /*
          * Create EasyMock mocks.
          */
-        MockControl mockIoFilterChain = MockControl
-                .createStrictControl( IoFilterChain.class );
+        MockControl mockIoFilterChainBuilder = MockControl
+                .createStrictControl( DefaultIoFilterChainBuilder.class );
         MockControl mockIoSessionManager = MockControl
                 .createControl( IoSessionManager.class );
 
@@ -140,23 +140,23 @@
 
         IoSessionManager ioSessionManager = ( IoSessionManager ) mockIoSessionManager
                 .getMock();
-        IoFilterChain ioFilterChain = ( IoFilterChain ) mockIoFilterChain
+        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder
) mockIoFilterChainBuilder
                 .getMock();
 
         /*
          * Record expectations.
          */
-        ioFilterChain.addLast( "first", mappings[ 0 ].getFilter() );
-        ioFilterChain.addLast( "second", mappings[ 1 ].getFilter() );
-        ioFilterChain.addLast( "third", mappings[ 2 ].getFilter() );
+        ioFilterChainBuilder.addLast( "first", mappings[ 0 ].getFilter() );
+        ioFilterChainBuilder.addLast( "second", mappings[ 1 ].getFilter() );
+        ioFilterChainBuilder.addLast( "third", mappings[ 2 ].getFilter() );
 
-        ioSessionManager.getFilterChain();
-        mockIoSessionManager.setReturnValue( mockIoFilterChain.getMock() );
+        ioSessionManager.getFilterChainBuilder();
+        mockIoSessionManager.setReturnValue( mockIoFilterChainBuilder.getMock() );
 
         /*
          * Replay.
          */
-        mockIoFilterChain.replay();
+        mockIoFilterChainBuilder.replay();
         mockIoSessionManager.replay();
 
         factory.setFilterMappings( mappings );
@@ -165,7 +165,7 @@
         /*
          * Verify.
          */
-        mockIoFilterChain.verify();
+        mockIoFilterChainBuilder.verify();
         mockIoSessionManager.verify();
     }
 
@@ -184,16 +184,16 @@
 
         IoSessionManager ioSessionManager = ( IoSessionManager ) mockIoSessionManager
                 .getMock();
-        IoFilterChain ioFilterChain = ( IoFilterChain ) MockControl
-                .createControl( IoFilterChain.class ).getMock();
+        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder
) MockControl
+                .createControl( DefaultIoFilterChainBuilder.class ).getMock();
         ExceptionMonitor exceptionMonitor = ( ExceptionMonitor ) MockControl
                 .createControl( ExceptionMonitor.class ).getMock();
 
         /*
          * Record expectations.
          */
-        ioSessionManager.getFilterChain();
-        mockIoSessionManager.setReturnValue( ioFilterChain );
+        ioSessionManager.getFilterChainBuilder();
+        mockIoSessionManager.setReturnValue( ioFilterChainBuilder );
         ioSessionManager.setExceptionMonitor( exceptionMonitor );
 
         /*
@@ -220,27 +220,27 @@
         /*
          * Create EasyMock mocks.
          */
-        MockControl mockIoFilterChain = MockControl
-                .createStrictControl( IoFilterChain.class );
+        MockControl mockIoFilterChainBuilder = MockControl
+                .createStrictControl( DefaultIoFilterChainBuilder.class );
         MockControl mockIoSessionManager = MockControl
                 .createControl( IoSessionManager.class );
 
         IoSessionManager ioSessionManager = ( IoSessionManager ) mockIoSessionManager
                 .getMock();
-        IoFilterChain ioFilterChain = ( IoFilterChain ) mockIoFilterChain
+        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder
) mockIoFilterChainBuilder
                 .getMock();
 
         /*
          * Record expectations.
          */
-        ioSessionManager.getFilterChain();
-        mockIoSessionManager.setReturnValue( ioFilterChain );
-        ioFilterChain.clear();
+        ioSessionManager.getFilterChainBuilder();
+        mockIoSessionManager.setReturnValue( ioFilterChainBuilder );
+        ioFilterChainBuilder.clear();
 
         /*
          * Replay.
          */
-        mockIoFilterChain.replay();
+        mockIoFilterChainBuilder.replay();
         mockIoSessionManager.replay();
 
         factory.destroyIoSessionManager( ioSessionManager );
@@ -248,7 +248,7 @@
         /*
          * Verify.
          */
-        mockIoFilterChain.verify();
+        mockIoFilterChainBuilder.verify();
         mockIoSessionManager.verify();
     }
 



Mime
View raw message