xmlBlaster 2.2.0 API

org.xmlBlaster.test.dispatch
Class TestPriorizedDispatchPlugin

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

public class TestPriorizedDispatchPlugin
extends junit.framework.TestCase

This client tests the dispatch.control.plugin requirement

We start our own xmlBlaster server in a thread. 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 -noloading org.xmlBlaster.test.dispatch.TestPriorizedDispatchPlugin
    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.dispatch.TestPriorizedDispatchPlugin
 

See Also:
PriorizedDispatchPlugin

Field Summary
private  java.lang.String BACKUP_LINE
           
private  I_XmlBlasterAccess con
           
private  java.lang.String DEAD_LINE
           
private  java.lang.String[][] expectedActions
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String msgOid
           
private  int msgSequenceNumber
           
private  java.lang.String name
           
private  java.lang.String NORMAL_LINE
           
private  java.lang.String passwd
           
private  int serverPort
           
private  EmbeddedXmlBlaster serverThread
           
private  boolean startEmbedded
           
private  java.lang.String[] states
           
private  java.lang.String statusOid
           
private  MsgInterceptor update
           
 
Constructor Summary
TestPriorizedDispatchPlugin(Global glob, java.lang.String testName, java.lang.String name)
          Constructs the TestPriorizedDispatchPlugin object.
 
Method Summary
private  void changeStatus(java.lang.String oid, java.lang.String state)
           
static void main(java.lang.String[] args)
          Invoke:
private  void publish(java.lang.String oid, int priority)
           
private  void publishNewConfig(java.lang.String config)
          Change the configuration of the plugin
protected  void setUp()
          Sets up the fixture.
private  void subscribe(java.lang.String oid)
           
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
          Tears down the fixture.
 void testPriorizedDispatchPlugin()
          Test all tuples of possibilities
 void testPriorizedDispatchPluginOne()
          Test the notifySender message 1.
 void testPriorizedDispatchPluginReconfigure()
          Tests to change the plugin configuration and different status message oids.
 
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

con

private I_XmlBlasterAccess con

name

private java.lang.String name

passwd

private java.lang.String passwd

serverThread

private EmbeddedXmlBlaster serverThread

serverPort

private int serverPort

startEmbedded

private boolean startEmbedded

update

private MsgInterceptor update

msgOid

private final java.lang.String msgOid
See Also:
Constant Field Values

msgSequenceNumber

private int msgSequenceNumber

statusOid

private java.lang.String statusOid

NORMAL_LINE

private java.lang.String NORMAL_LINE

BACKUP_LINE

private java.lang.String BACKUP_LINE

DEAD_LINE

private java.lang.String DEAD_LINE

states

private java.lang.String[] states

expectedActions

private java.lang.String[][] expectedActions
Constructor Detail

TestPriorizedDispatchPlugin

public TestPriorizedDispatchPlugin(Global glob,
                                   java.lang.String testName,
                                   java.lang.String name)
Constructs the TestPriorizedDispatchPlugin object.

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

setUp

protected void setUp()
Sets up the fixture.

We start an own xmlBlaster server in a separate thread, it is configured to load our demo dispatch plugin.

Then we connect as a client

Overrides:
setUp in class junit.framework.TestCase

changeStatus

private void changeStatus(java.lang.String oid,
                          java.lang.String state)
Parameters:
The - oid of the status message
state - Choose one of "2M" or "64k"

publish

private void publish(java.lang.String oid,
                     int priority)

subscribe

private void subscribe(java.lang.String oid)

testPriorizedDispatchPlugin

public void testPriorizedDispatchPlugin()
Test all tuples of possibilities


testPriorizedDispatchPluginReconfigure

public void testPriorizedDispatchPluginReconfigure()
Tests to change the plugin configuration and different status message oids.


publishNewConfig

private void publishNewConfig(java.lang.String config)
Change the configuration of the plugin


testPriorizedDispatchPluginOne

public void testPriorizedDispatchPluginOne()
Test the notifySender message 1. subscribe to a message 2. change state to 64k 3. send a message with prio 6 which should trigger a notify PtP message


tearDown

protected void tearDown()
Tears down the fixture.

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

Overrides:
tearDown in class junit.framework.TestCase

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.dispatch.TestPriorizedDispatchPlugin  -logging/org.xmlBlaster.engine.dispatch FINE -logging/org.xmlBlaster.util.dispatch FINE -logging/org.xmlBlaster.engine FINEST
  java -Djava.compiler= junit.textui.TestRunner -noloading org.xmlBlaster.test.dispatch.TestPriorizedDispatchPlugin
 


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.