xmlBlaster 2.2.0 API

org.xmlBlaster.test.dispatch
Class TestPriorizedDispatchWithLostCallback

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

public class TestPriorizedDispatchWithLostCallback
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.

This tests runs only based on XmlRpc, as with xmlrpc we can easily start/stop the callback server independent from our connection

Invoke examples:
    java junit.textui.TestRunner org.xmlBlaster.test.dispatch.TestPriorizedDispatchWithLostCallback
    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.dispatch.TestPriorizedDispatchWithLostCallback
 

See Also:
PriorizedDispatchPlugin

Field Summary
private  java.lang.String BACKUP_LINE
           
private  I_XmlBlasterAccess con
           
private  ConnectQos connectQos
           
private  java.lang.String DEAD_LINE
           
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  java.lang.String statusOid
           
private  MsgInterceptor updateInterceptor
           
private  MsgInterceptor updateMsgs
           
 
Constructor Summary
TestPriorizedDispatchWithLostCallback(Global glob, java.lang.String testName, java.lang.String name)
          Constructs the TestPriorizedDispatchWithLostCallback object.
 
Method Summary
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 testPriorizedDispatchPluginConnectionState()
          Tests what happens if dispatcher frameworks looses the callback connection to us and starts polling
 
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

connectQos

private ConnectQos connectQos

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

updateInterceptor

private MsgInterceptor updateInterceptor

updateMsgs

private MsgInterceptor updateMsgs

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
Constructor Detail

TestPriorizedDispatchWithLostCallback

public TestPriorizedDispatchWithLostCallback(Global glob,
                                             java.lang.String testName,
                                             java.lang.String name)
Constructs the TestPriorizedDispatchWithLostCallback 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 an XmlRpc client in fail save mode. We need to shutdown and restart the callback server and this is buggy with CORBA.

Overrides:
setUp in class junit.framework.TestCase

publish

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

publishNewConfig

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


subscribe

private void subscribe(java.lang.String oid)

testPriorizedDispatchPluginConnectionState

public void testPriorizedDispatchPluginConnectionState()
Tests what happens if dispatcher frameworks looses the callback connection to us and starts polling


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


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.