xmlBlaster 2.2.0 API

org.xmlBlaster.test.classtest
Class EventPluginTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.classtest.EventPluginTest
All Implemented Interfaces:
junit.framework.Test, I_Callback

public class EventPluginTest
extends junit.framework.TestCase
implements I_Callback

Test Timeout class (scheduling for timeouts).

All methods starting with 'test' and without arguments are invoked automatically

Invoke: java -Djava.compiler= junit.textui.TestRunner -noloading org.xmlBlaster.test.classtest.EventPluginTest

See Also:
Timeout

Field Summary
private  EmbeddedXmlBlaster embeddedServer
           
private static java.util.logging.Logger log
           
 
Constructor Summary
EventPluginTest(java.lang.String name)
           
 
Method Summary
static void main(java.lang.String[] args)
           
private  void startServer()
           
private  void stopServer()
           
 void testQueueEventsWithoutWildcards()
           
 void testQueueEventsWithWildcards()
          We start an embedded server where we define an EventPlugin to fire on two events: on all callback queues (all users) 70 % of the maximum has been reached (maximum is 10 Entries) on all topics when the history queue reaches 4 We then connect one failsafe client, make a subscription and leave the server (without logging out) to keep the entries in the callback queue (and in the history queue).
 void testRegex()
          Test a simple timeout
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          here come the updates for the test client.
private  void writePluginsFile(java.lang.String port, java.lang.String eventTypes)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

log

private static java.util.logging.Logger log

embeddedServer

private EmbeddedXmlBlaster embeddedServer
Constructor Detail

EventPluginTest

public EventPluginTest(java.lang.String name)
Method Detail

writePluginsFile

private void writePluginsFile(java.lang.String port,
                              java.lang.String eventTypes)

startServer

private void startServer()

stopServer

private void stopServer()

testRegex

public void testRegex()
Test a simple timeout


testQueueEventsWithoutWildcards

public void testQueueEventsWithoutWildcards()

testQueueEventsWithWildcards

public void testQueueEventsWithWildcards()
We start an embedded server where we define an EventPlugin to fire on two events: We then connect one failsafe client, make a subscription and leave the server (without logging out) to keep the entries in the callback queue (and in the history queue).

The second client subscribes to the configured events (this is the client which will get the events.

A third client publishes 5 messages (which hit the subscription of the first client). Such messages fill the callback queue and the history queue. This shall result in an event coming from the history queue. The callback queue shall not fire since it has not been exceeded, however the second history queue, the one for the __sys__Event shall fire since it has exceeded too, so two messages shall arrive.


update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
                        throws XmlBlasterException
here come the updates for the test client.

Specified by:
update in interface I_Callback
Parameters:
cbSessionId -
updateKey -
content -
updateQos -
Returns:
Throws:
XmlBlasterException
See Also:
I_XmlBlasterAccess

main

public static void main(java.lang.String[] args)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.