org.jivesoftware.smackx.bytestreams.socks5
Class InitiationListenerTest

java.lang.Object
  extended by org.jivesoftware.smackx.bytestreams.socks5.InitiationListenerTest

public class InitiationListenerTest
extends java.lang.Object

Test for the InitiationListener class.

Author:
Henning Staib

Constructor Summary
InitiationListenerTest()
           
 
Method Summary
 void setup()
          Initialize fields used in the tests.
 void shouldIgnoreSocks5BytestreamRequestOnce()
          If a request with a specific session ID should be ignored no listeners should be notified.
 void shouldInvokeAllRequestsListenerIfUserListenerExists()
          If a user specific listener and an all requests listener is registered only the all requests listener should be notified on an incoming request for another user.
 void shouldInvokeListenerForAllRequests()
          If a listener for all requests is registered it should be notified on incoming requests.
 void shouldInvokeListenerForUser()
          If a listener for a specific user in registered it should be notified on incoming requests for that user.
 void shouldNotInvokeAllRequestsListenerIfUserListenerExists()
          If a user specific listener and an all requests listener is registered only the user specific listener should be notified.
 void shouldNotInvokeListenerForUser()
          If listener for a specific user is registered it should not be notified on incoming requests from other users.
 void shouldRespondWithError()
          If no listeners are registered for incoming SOCKS5 Bytestream requests, all request should be rejected with an error.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitiationListenerTest

public InitiationListenerTest()
Method Detail

setup

public void setup()
Initialize fields used in the tests.


shouldRespondWithError

public void shouldRespondWithError()
                            throws java.lang.Exception
If no listeners are registered for incoming SOCKS5 Bytestream requests, all request should be rejected with an error.

Throws:
java.lang.Exception - should not happen

shouldInvokeListenerForAllRequests

public void shouldInvokeListenerForAllRequests()
                                        throws java.lang.Exception
If a listener for all requests is registered it should be notified on incoming requests.

Throws:
java.lang.Exception - should not happen

shouldInvokeListenerForUser

public void shouldInvokeListenerForUser()
                                 throws java.lang.Exception
If a listener for a specific user in registered it should be notified on incoming requests for that user.

Throws:
java.lang.Exception - should not happen

shouldNotInvokeListenerForUser

public void shouldNotInvokeListenerForUser()
                                    throws java.lang.Exception
If listener for a specific user is registered it should not be notified on incoming requests from other users.

Throws:
java.lang.Exception - should not happen

shouldNotInvokeAllRequestsListenerIfUserListenerExists

public void shouldNotInvokeAllRequestsListenerIfUserListenerExists()
                                                            throws java.lang.Exception
If a user specific listener and an all requests listener is registered only the user specific listener should be notified.

Throws:
java.lang.Exception - should not happen

shouldInvokeAllRequestsListenerIfUserListenerExists

public void shouldInvokeAllRequestsListenerIfUserListenerExists()
                                                         throws java.lang.Exception
If a user specific listener and an all requests listener is registered only the all requests listener should be notified on an incoming request for another user.

Throws:
java.lang.Exception - should not happen

shouldIgnoreSocks5BytestreamRequestOnce

public void shouldIgnoreSocks5BytestreamRequestOnce()
                                             throws java.lang.Exception
If a request with a specific session ID should be ignored no listeners should be notified.

Throws:
java.lang.Exception - should not happen