xmlBlaster 2.2.0 API

org.xmlBlaster.test.authentication
Class TestLoginLogoutEvent

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.authentication.TestLoginLogoutEvent
All Implemented Interfaces:
junit.framework.Test

public class TestLoginLogoutEvent
extends junit.framework.TestCase

This client tests for login/logout events of other clients.

IMPORTANT NOTE: Switch on the event plugins in xmlBlasterPlugins.xml for this test!

There are two internal messages which hold login and logout events. You can subscribe to "__sys__Login" to be notified when a new client logs in, and to "__sys__Logout" to be notified when a client logs out. The message content contains the unique login name of this client.

Tests the '__cmd:?clientList' feature as well.

This client may be invoked multiple time on the same xmlBlaster server, as it cleans up everything after his tests are done.

Invoke examples:

    java junit.textui.TestRunner org.xmlBlaster.test.authentication.TestLoginLogoutEvent
    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.authentication.TestLoginLogoutEvent
 


Field Summary
private  java.lang.String expectedName
           
private  I_XmlBlasterAccess firstConnection
           
private  java.lang.String firstName
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String passwd
           
private  I_XmlBlasterAccess secondConnection
           
private  java.lang.String secondName
           
private  MsgInterceptor updateInterceptFirst
           
private  MsgInterceptor updateInterceptSecond
           
 
Constructor Summary
TestLoginLogoutEvent(Global glob, java.lang.String testName, java.lang.String firstName, java.lang.String secondName)
          Constructs the TestLoginLogoutEvent object.
 
Method Summary
static void main(java.lang.String[] args)
          Invoke: java org.xmlBlaster.test.authentication.TestLoginLogoutEvent
protected  void setUp()
          Sets up the fixture.
 void subscribe(java.lang.String oid)
          Subscribe to login events with oid="__sys__Login" or "__sys__Logout"
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
          Tears down the fixture.
 void testLoginLogout()
          TEST: Test to receive a login and a logout event.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

glob

private Global glob

log

private static java.util.logging.Logger log

firstConnection

private I_XmlBlasterAccess firstConnection

firstName

private java.lang.String firstName

secondConnection

private I_XmlBlasterAccess secondConnection

secondName

private java.lang.String secondName

expectedName

private java.lang.String expectedName

passwd

private java.lang.String passwd

updateInterceptFirst

private MsgInterceptor updateInterceptFirst

updateInterceptSecond

private MsgInterceptor updateInterceptSecond
Constructor Detail

TestLoginLogoutEvent

public TestLoginLogoutEvent(Global glob,
                            java.lang.String testName,
                            java.lang.String firstName,
                            java.lang.String secondName)
Constructs the TestLoginLogoutEvent object.

Parameters:
testName - The name used in the test suite
firstName - The name to login to the xmlBlaster
secondName - The name to login to the xmlBlaster again
Method Detail

setUp

protected void setUp()
Sets up the fixture.

Connect to xmlBlaster and login

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

cleaning up .... erase() the previous message OID and logout

Overrides:
tearDown in class junit.framework.TestCase

subscribe

public void subscribe(java.lang.String oid)
Subscribe to login events with oid="__sys__Login" or "__sys__Logout"


testLoginLogout

public void testLoginLogout()
TEST: Test to receive a login and a logout event.


suite

public static junit.framework.Test suite()
Method is used by TestRunner to load these tests


main

public static void main(java.lang.String[] args)
Invoke: java org.xmlBlaster.test.authentication.TestLoginLogoutEvent


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.