xmlBlaster 2.2.0 API

org.xmlBlaster.test.topic
Class TestTopicHistory

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

public class TestTopicHistory
extends junit.framework.TestCase
implements I_Callback

Here we test access to history messages of a topic.

Invoke examples:

    java junit.textui.TestRunner org.xmlBlaster.test.topic.TestTopicHistory

    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.topic.TestTopicHistory
 

See Also:
The engine.message.lifecycle requirement, TopicHandler

Field Summary
private  long blockUpdateTime
           
private  I_XmlBlasterAccess con
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  int numReceived
           
private  java.lang.String publishOid
           
private  java.lang.String senderContent
           
private  int serverPort
           
private  EmbeddedXmlBlaster serverThread
           
private  boolean startEmbedded
           
private  SubscribeReturnQos subscribeReturnQos
           
 
Constructor Summary
TestTopicHistory(Global glob, java.lang.String testName)
          Constructs the TestTopicHistory object.
 
Method Summary
 void createTopic(java.lang.String keyOid, TopicProperty topicProperty)
          Create a topic.
static void main(java.lang.String[] args)
          Invoke: java org.xmlBlaster.test.topic.TestTopicHistory -startEmbedded false
 EraseReturnQos[] sendErase(boolean forceDestroy)
           
 void sendExpiringMsg(boolean initializeTopic, long topicDestroyDelay, long msgLifeTime)
          Publish an almost volatile message.
protected  void setUp()
          Sets up the fixture.
 void subscribeMsg()
          Subscribe a volatile message.
static junit.framework.Test suite()
          Method is used by TestRunner to load these tests
protected  void tearDown()
          Tears down the fixture.
 void testHistory()
           
 void unSubscribeMsg()
          unSubscribe a 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

glob

private final Global glob

log

private static java.util.logging.Logger log

con

private I_XmlBlasterAccess con

senderContent

private java.lang.String senderContent

publishOid

private java.lang.String publishOid

subscribeReturnQos

private SubscribeReturnQos subscribeReturnQos

blockUpdateTime

private long blockUpdateTime

serverThread

private EmbeddedXmlBlaster serverThread

serverPort

private int serverPort

startEmbedded

private boolean startEmbedded

numReceived

private int numReceived
Constructor Detail

TestTopicHistory

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

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

setUp

protected void setUp()
Sets up the fixture.

Creates a CORBA connection and does a login.
- One connection for the sender client

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

cleaning up .... logout

Overrides:
tearDown in class junit.framework.TestCase

sendErase

public EraseReturnQos[] sendErase(boolean forceDestroy)

createTopic

public void createTopic(java.lang.String keyOid,
                        TopicProperty topicProperty)
Create a topic.


sendExpiringMsg

public void sendExpiringMsg(boolean initializeTopic,
                            long topicDestroyDelay,
                            long msgLifeTime)
Publish an almost volatile message.


subscribeMsg

public void subscribeMsg()
Subscribe a volatile message.


unSubscribeMsg

public void unSubscribeMsg()
unSubscribe a message.


testHistory

public void testHistory()

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)
Invoke: java org.xmlBlaster.test.topic.TestTopicHistory -startEmbedded false


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.