xmlBlaster 2.2.0 API

org.xmlBlaster.test.client
Class TestPtPDispatch

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

public class TestPtPDispatch
extends junit.framework.TestCase

Invoke examples:

   java junit.textui.TestRunner -noloading org.xmlBlaster.test.client.TestPtPDispatch
   java junit.swingui.TestRunner -noloading org.xmlBlaster.test.client.TestPtPDispatch
 

See Also:
I_XmlBlasterAccess

Field Summary
private  int counter
           
private  PtPDestination[] destinations
           
private  Global glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  int numDestinations
           
private  java.lang.String subjectName
           
private static long TIMEOUT
           
 
Constructor Summary
TestPtPDispatch(Global glob, java.lang.String testName)
           
TestPtPDispatch(java.lang.String testName)
           
 
Method Summary
private  void checkWithoutPublish(PtPDestination dest, boolean wantsPtP, int expected, long delay)
          Does a connect, waits for updates, compares the number of updates with the expected and makes a disconnect.
private  void checkWithReconnect(int dest, boolean wantsPtP, int expected, long delay)
           
private  void cleanup()
           
private  void doPublish(int destNum, boolean forceQueuing, boolean expectEx, int[] counts, long timeout, boolean persistent, java.lang.String contentPrefix)
           
static void main(java.lang.String[] args)
          Deprecated. Use the TestRunner from the testsuite to run it:

   java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.client.TestPtPDispatch
private  void noQueuingNoOverflow(boolean isPersistent, java.lang.String msgPrefix)
          5 messages are sent
private  void noQueuingOverflow(boolean isPersistent, java.lang.String msgPrefix)
          12 messages are sent
private  void prepare(boolean shutdownCb)
           
private  void queuingNoOverflow(boolean isPersistent, java.lang.String msgPrefix)
          5 messages are sent
private  void queuingOverflow(boolean isPersistent, java.lang.String msgPrefix)
          12 messages are sent
protected  void setUp()
          Sets up the fixture.
private  void subjectQueueNoOverflow(boolean isPersistent, java.lang.String msgPrefix)
           
protected  void tearDown()
          Tears down the fixture.
 void testNoQueuingNoOverflowPersistent()
          TEST:
 void testNoQueuingNoOverflowTransient()
          TEST:
 void testNoQueuingOverflowPersistent()
          TEST:
 void testNoQueuingOverflowTransient()
          TEST:
 void testQueuingNoOverflowPersistent()
          TEST:
 void testQueuingNoOverflowTransient()
          TEST:
 void testQueuingOverflowPersistent()
           
 void testQueuingOverflowTransient()
           
 void testSubjectQueueNoOverflowPersistent()
           
 void testSubjectQueueNoOverflowTransient()
           
 void testSubjectQueueOverflowPersistent()
           
 void testSubjectQueueOverflowTransient()
           
 
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

ME

private static java.lang.String ME

TIMEOUT

private static final long TIMEOUT
See Also:
Constant Field Values

glob

private Global glob

log

private static java.util.logging.Logger log

destinations

private PtPDestination[] destinations

numDestinations

private int numDestinations

counter

private int counter

subjectName

private java.lang.String subjectName
Constructor Detail

TestPtPDispatch

public TestPtPDispatch(java.lang.String testName)

TestPtPDispatch

public TestPtPDispatch(Global glob,
                       java.lang.String testName)
Method Detail

setUp

protected void setUp()
Sets up the fixture.

Connect to xmlBlaster and login

Overrides:
setUp in class junit.framework.TestCase

prepare

private void prepare(boolean shutdownCb)

cleanup

private void cleanup()

tearDown

protected void tearDown()
Tears down the fixture.

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

Overrides:
tearDown in class junit.framework.TestCase

doPublish

private void doPublish(int destNum,
                       boolean forceQueuing,
                       boolean expectEx,
                       int[] counts,
                       long timeout,
                       boolean persistent,
                       java.lang.String contentPrefix)
Parameters:
destNum - the number of the destination int the destinations array for which the message is intended. If you want to send it to the subject (i.e. no specific session) you pass a negative value.
forceQueuing - if true it will force queuing (refering to the destination).
expectEx - true if you expect an exception here, false otherwise.
counts - an int[] containing the expected amount of updates for each destination. NOTE this has to be filled out even if you expect an

checkWithReconnect

private void checkWithReconnect(int dest,
                                boolean wantsPtP,
                                int expected,
                                long delay)

checkWithoutPublish

private void checkWithoutPublish(PtPDestination dest,
                                 boolean wantsPtP,
                                 int expected,
                                 long delay)
Does a connect, waits for updates, compares the number of updates with the expected and makes a disconnect.

Parameters:
dest - the destination to use (to check)
expected - the number of updates expected after a connect
delay - the time in ms to wait between connect and check

noQueuingNoOverflow

private void noQueuingNoOverflow(boolean isPersistent,
                                 java.lang.String msgPrefix)
5 messages are sent


testNoQueuingNoOverflowTransient

public void testNoQueuingNoOverflowTransient()
TEST:


testNoQueuingNoOverflowPersistent

public void testNoQueuingNoOverflowPersistent()
TEST:


noQueuingOverflow

private void noQueuingOverflow(boolean isPersistent,
                               java.lang.String msgPrefix)
12 messages are sent


testNoQueuingOverflowTransient

public void testNoQueuingOverflowTransient()
TEST:


testNoQueuingOverflowPersistent

public void testNoQueuingOverflowPersistent()
TEST:


queuingNoOverflow

private void queuingNoOverflow(boolean isPersistent,
                               java.lang.String msgPrefix)
5 messages are sent


testQueuingNoOverflowTransient

public void testQueuingNoOverflowTransient()
TEST:


testQueuingNoOverflowPersistent

public void testQueuingNoOverflowPersistent()
TEST:


queuingOverflow

private void queuingOverflow(boolean isPersistent,
                             java.lang.String msgPrefix)
12 messages are sent


testQueuingOverflowTransient

public void testQueuingOverflowTransient()

testQueuingOverflowPersistent

public void testQueuingOverflowPersistent()

subjectQueueNoOverflow

private void subjectQueueNoOverflow(boolean isPersistent,
                                    java.lang.String msgPrefix)

testSubjectQueueNoOverflowTransient

public void testSubjectQueueNoOverflowTransient()

testSubjectQueueNoOverflowPersistent

public void testSubjectQueueNoOverflowPersistent()

testSubjectQueueOverflowTransient

public void testSubjectQueueOverflowTransient()

testSubjectQueueOverflowPersistent

public void testSubjectQueueOverflowPersistent()

main

public static void main(java.lang.String[] args)
Deprecated. Use the TestRunner from the testsuite to run it:

   java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.client.TestPtPDispatch

Invoke: java org.xmlBlaster.test.client.TestPtPDispatch


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.