You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by p v <ic...@yahoo.com> on 2006/04/13 16:35:50 UTC

Scattering and Gathering strategy for MINA and more

Hi *, 

to the core Team, do you provide NIO Scattering and
Gathering I/O strategy ? (reminder: several buffers to
manage message)  -> helpfull to manage message header
and body seperatly with different king of bytes
mapping? (HTTP, SIP ,...) thanks to Mickael and Robert
to let me think about that ... with previous
messages,)

for all, is there any MINA-SIP opensource released
...thinking about a JAIN-SIP implementation ?


nio joke :
Still waiting zero-copy socket from the jdk! ^^)

Regards
i3


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Need a concrete or mock class of Protocol Session for tests

Posted by Vinod Panicker <vi...@gmail.com>.
Hi,

>From what I've seen, mock objects are fantastic - but use them only as
a last resort.  If possible break up your functionality in a way that
you can call it from your unit test without mocking any objects.

If you do go and create a mock object of ProtocolSession, then I'd
advise you to do so against a final MINA release so that you dont have
to keep changing the recorded method calls.

I believe MINA uses easymock for mock objects.

HTH,
Vinod.

On 4/14/06, Serkan Demir <se...@oksijen.com> wrote:
> Hi guys,
>
> I have implemented a protocol stack with MINA. Now, I have to increase
> my unit tests coverage. I have stuck at the testing of my
> ProtocolHandler's methods (sessionCreated,sessionOpened, sessionClosed
> etc..) Therefore i need a concrete or mock class of Protocol Session for
> my tests. I noticed the TestSession class in your codebase, but it is
> private class like as ProtocolSessionImpl. Is there any session factory
> or a public concrete class of ProtocolSession which I can use for tests?
> If your answer is no, i will pass to my second alternative, JMock.
>
> I am talking about unit tests of such method.Unless i create a session
> in unit test scope, i cannot test its functionality. Could you recommend
> a way for testing such methods?
>
>     public void messageReceived(ProtocolSession session, Object message) {
>         if (BaseStackLogger.logger.isDebugEnabled()){
>             BaseStackLogger.logger.debug("Message is received. Message
> is:"+message.toString());
>         }
>
>  // some other actions have been done
> //
> //
>      if(!message instanceof MyMessageType) {
>     session.close();
>     }
>      resetTimer();
>     }
>

Need a concrete or mock class of Protocol Session for tests

Posted by Serkan Demir <se...@oksijen.com>.
Hi guys,

I have implemented a protocol stack with MINA. Now, I have to increase 
my unit tests coverage. I have stuck at the testing of my 
ProtocolHandler's methods (sessionCreated,sessionOpened, sessionClosed 
etc..) Therefore i need a concrete or mock class of Protocol Session for 
my tests. I noticed the TestSession class in your codebase, but it is 
private class like as ProtocolSessionImpl. Is there any session factory 
or a public concrete class of ProtocolSession which I can use for tests? 
If your answer is no, i will pass to my second alternative, JMock.

I am talking about unit tests of such method.Unless i create a session 
in unit test scope, i cannot test its functionality. Could you recommend 
a way for testing such methods?

    public void messageReceived(ProtocolSession session, Object message) {
        if (BaseStackLogger.logger.isDebugEnabled()){
            BaseStackLogger.logger.debug("Message is received. Message 
is:"+message.toString());
        }

 // some other actions have been done
//
//
     if(!message instanceof MyMessageType) {
    session.close();
    }
     resetTimer();
    }

Re: Scattering and Gathering strategy for MINA and more

Posted by Trustin Lee <tr...@gmail.com>.
Hi p v,

On 4/13/06, p v <ic...@yahoo.com> wrote:
>
> to the core Team, do you provide NIO Scattering and
> Gathering I/O strategy ? (reminder: several buffers to
> manage message)  -> helpfull to manage message header
> and body seperatly with different king of bytes
> mapping? (HTTP, SIP ,...) thanks to Mickael and Robert
> to let me think about that ... with previous
> messages,)


MINA doesn't support gathering write or scattering read at all for now.  We
are considering implementing gathering write, but will there be performance
improvement here?

for all, is there any MINA-SIP opensource released
> ...thinking about a JAIN-SIP implementation ?


Not yet unfortunately, AFAIK.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6