directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r713781 - /directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
Date Thu, 13 Nov 2008 18:45:15 GMT
Author: elecharny
Date: Thu Nov 13 10:45:15 2008
New Revision: 713781

URL: http://svn.apache.org/viewvc?rev=713781&view=rev
Log:
Defined a specific DummySession inheriting from MINA DummySession.

Modified:
    directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java

Modified: directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java?rev=713781&r1=713780&r2=713781&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
(original)
+++ directory/apacheds/branches/apacheds-mina2/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
Thu Nov 13 10:45:15 2008
@@ -30,15 +30,10 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.mina.core.buffer.IoBuffer;
-import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.filterchain.IoFilter.NextFilter;
 import org.apache.mina.core.future.WriteFuture;
-import org.apache.mina.core.service.IoHandler;
-import org.apache.mina.core.service.IoProcessor;
-import org.apache.mina.core.service.IoService;
-import org.apache.mina.core.service.TransportMetadata;
-import org.apache.mina.core.session.AbstractIoSession;
+import org.apache.mina.core.session.DummySession;
 import org.apache.mina.core.session.IoSession;
-import org.apache.mina.core.session.IoSessionConfig;
 import org.apache.mina.filter.codec.AbstractProtocolEncoderOutput;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.mina.filter.codec.demux.MessageDecoder;
@@ -96,7 +91,7 @@
 
         };
         
-        IoSession session = new  DummySession();
+        IoSession session = new MitosisDummySession();
         
         session.setAttribute( "registries", service.getRegistries() );
         encoder.encode( session, message, encoderOut );
@@ -126,6 +121,9 @@
         public void flush()
         {
         }
+        
+        public void flush(NextFilter nextFilter, IoSession session) {
+        }
 
 
         public void write( Object message )
@@ -135,71 +133,23 @@
     }
 
 
-    protected static class DummySession extends AbstractIoSession
+    protected static class MitosisDummySession extends DummySession
     {
         Object message;
 
 
-        public IoProcessor<IoSession> getProcessor()
-        {
-            return null;
-        }
-        
-        
         protected Object getMessage()
         {
             return message;
         }
 
 
-        protected void updateTrafficMask()
-        {
-            // Do nothing.
-        }
-
-
-        public IoService getService()
-        {
-            return null;
-        }
-
-
-        public IoHandler getHandler()
-        {
-            return null;
-        }
-
-
-        public IoFilterChain getFilterChain()
-        {
-            return null;
-        }
-
-
-        public TransportMetadata getTransportMetadata()
-        {
-            return null;
-        }
-
-
         public SocketAddress getRemoteAddress()
         {
             return new InetSocketAddress( 10088 );
         }
 
-
-        public SocketAddress getLocalAddress()
-        {
-            return null;
-        }
-
-
-        public IoSessionConfig getConfig()
-        {
-            return null;
-        }
-
-
+        
         public int getScheduledWriteRequests()
         {
             return 0;
@@ -210,5 +160,11 @@
         {
             return null;
         }
+        
+        
+        public WriteFuture write(Object message) {
+        	this.message = message;
+        	return null;
+        }
     }
 }



Mime
View raw message