xmlBlaster 2.2.0 API

org.xmlBlaster.test.qos
Class TestSubXPathMany

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

public class TestSubXPathMany
extends junit.framework.TestCase

This client tests the method subscribe() with a later publish() with XPath query.

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 -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.qos.TestSubXPathMany
    java -Djava.compiler= junit.swingui.TestRunner -noloading org.xmlBlaster.test.qos.TestSubXPathMany
 

Author:
xmlBlaster@marcelruff.info

Field Summary
private  I_XmlBlasterAccess con1
           
private  I_XmlBlasterAccess con2
           
private  I_XmlBlasterAccess con3
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.StringBuffer messageArrived1
           
private  java.lang.StringBuffer messageArrived2
           
private  java.lang.StringBuffer messageArrived3
           
private  int numReceived1
           
private  int numReceived2
           
private  int numReceived3
           
 
Constructor Summary
TestSubXPathMany(Global glob)
          Constructs the TestSubXPathMany object, used by main.
TestSubXPathMany(java.lang.String name)
          Constructs the TestSubXPathMany object, used by junit.
 
Method Summary
 void doPublish()
          Publish some messages.
 void doSubscribe()
          Subscribe with XPATH.
static void main(java.lang.String[] args)
           java -Dtrace=true -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.qos.TestSubXPathMany java -Djava.compiler= org.xmlBlaster.test.qos.TestSubXPathMany -logging FINE
protected  void setUp()
          Sets up the fixture, connect to xmlBlaster 3 times.
protected  void tearDown()
          Tear down the fixture, erase messages and disconnect from xmlBlaster.
 void testIt()
          TEST: Publish some messages, disconnect client3 subscribe with XPath and check if everything is OK.
private  void waitOnUpdate(long timeout, java.lang.StringBuffer messageArrived)
          Little helper, waits until the variable 'messageArrive' is set or returns when the given timeout occurs.
 
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 final Global glob

log

private static java.util.logging.Logger log

con1

private I_XmlBlasterAccess con1

con2

private I_XmlBlasterAccess con2

con3

private I_XmlBlasterAccess con3

numReceived1

private int numReceived1

messageArrived1

private java.lang.StringBuffer messageArrived1

numReceived2

private int numReceived2

messageArrived2

private java.lang.StringBuffer messageArrived2

numReceived3

private int numReceived3

messageArrived3

private java.lang.StringBuffer messageArrived3
Constructor Detail

TestSubXPathMany

public TestSubXPathMany(java.lang.String name)
Constructs the TestSubXPathMany object, used by junit.


TestSubXPathMany

public TestSubXPathMany(Global glob)
Constructs the TestSubXPathMany object, used by main.

Method Detail

setUp

protected void setUp()
Sets up the fixture, connect to xmlBlaster 3 times.

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tear down the fixture, erase messages and disconnect from xmlBlaster.

Overrides:
tearDown in class junit.framework.TestCase

doSubscribe

public void doSubscribe()
Subscribe with XPATH.


doPublish

public void doPublish()
Publish some messages.


testIt

public void testIt()
TEST: Publish some messages, disconnect client3 subscribe with XPath and check if everything is OK.


waitOnUpdate

private void waitOnUpdate(long timeout,
                          java.lang.StringBuffer messageArrived)
Little helper, waits until the variable 'messageArrive' is set or returns when the given timeout occurs.

Parameters:
timeout - in milliseconds

main

public static void main(java.lang.String[] args)
   java -Dtrace=true -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.qos.TestSubXPathMany
   java -Djava.compiler= org.xmlBlaster.test.qos.TestSubXPathMany -logging FINE
 


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.