xmlBlaster 2.2.0 API

org.xmlBlaster.test.qos
Class TestErase

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

public class TestErase
extends junit.framework.TestCase
implements I_Callback

This client tests if it receives message erase events.

Invoke examples:

    java junit.textui.TestRunner -noloading org.xmlBlaster.test.qos.TestErase
    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.qos.TestErase
 

See Also:
update requirement

Field Summary
private  I_XmlBlasterAccess con
           
private  java.lang.String contentMime
           
private  Global glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  MsgUnit msgUnit
           
private  java.lang.String oidExact
           
private  java.lang.String oidXpath
           
private  java.lang.String publishOid
           
private  java.lang.String subscribeId
           
private  MsgInterceptor updateInterceptor
           
 
Constructor Summary
TestErase(Global glob, java.lang.String testName)
          Constructs the TestErase object.
 
Method Summary
private  void connect()
           
private  void erase()
           
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.qos.TestErase
private  void publish()
          TEST: Construct a message and publish it.
protected  void setUp()
          Sets up the fixture.
private  void subscribe(boolean exact)
          Subscribe three times to same message.
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
          Tears down the fixture.
 void testEraseEvent()
          TEST: Subscribe to a message, publish it, erase it and check if we are notified about the erased message
 void testXPathEraseEvent()
          TEST: Subscribe to a message, publish it, erase it and check if we are notified about the erased message
private  void unSubscribe()
          unSubscribe three times to same message.
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          This is the callback method invoked from xmlBlaster delivering us a new asynchronous message.
 
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

glob

private final Global glob

log

private static java.util.logging.Logger log

subscribeId

private java.lang.String subscribeId

oidExact

private java.lang.String oidExact

oidXpath

private java.lang.String oidXpath

msgUnit

private MsgUnit msgUnit

publishOid

private java.lang.String publishOid

con

private I_XmlBlasterAccess con

contentMime

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

updateInterceptor

private MsgInterceptor updateInterceptor
Constructor Detail

TestErase

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

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

setUp

protected void setUp()
Sets up the fixture.

Connect to xmlBlaster and login

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

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

Overrides:
tearDown in class junit.framework.TestCase

subscribe

private void subscribe(boolean exact)
Subscribe three times to same message.

The returned subscribeId is checked


publish

private void publish()
TEST: Construct a message and publish it.

The returned publishOid is checked


unSubscribe

private void unSubscribe()
unSubscribe three times to same message.


erase

private void erase()

connect

private void connect()

testEraseEvent

public void testEraseEvent()
                    throws java.lang.Exception
TEST: Subscribe to a message, publish it, erase it and check if we are notified about the erased message

Throws:
java.lang.Exception

testXPathEraseEvent

public void testXPathEraseEvent()
                         throws java.lang.Exception
TEST: Subscribe to a message, publish it, erase it and check if we are notified about the erased message

Throws:
java.lang.Exception

update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message.

Specified by:
update in interface I_Callback
Parameters:
cbSessionId - The session ID specified by the client which registered the callback. You can specify a cbSessionId during connection (with ConnectQos) and this is bounced back here so you can authenticate the message.
updateKey - The arrived key containing the topic name
content - The arrived message content. This is your payload.
See Also:
I_Callback.update(String, UpdateKey, byte[], UpdateQos)

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)
Deprecated. Use the TestRunner from the testsuite to run it:

   java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.qos.TestErase

Invoke: java org.xmlBlaster.test.qos.TestErase


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.