|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.custommonkey.xmlunit.XMLTestCase org.xmlBlaster.test.topic.TestTopicLifeCycle
public class TestTopicLifeCycle
Here we test some state transitions of a topic.
We traverse the possible transitions of a topic (TopicHandler.java)
as described in requirement engine.message.lifecycle by sending some expiring messages (see
state transition brackets in requirement)
Please see individual test for a description
Invoke examples:
java junit.textui.TestRunner org.xmlBlaster.test.topic.TestTopicLifeCycle java junit.swingui.TestRunner -noloading org.xmlBlaster.test.topic.TestTopicLifeCycle
TopicHandler
Field Summary | |
---|---|
private long |
blockUpdateTime
|
private I_XmlBlasterAccess |
con
|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
publishOid
|
private java.lang.String |
senderContent
|
private int |
serverPort
|
private EmbeddedXmlBlaster |
serverThread
|
private boolean |
startEmbedded
|
private SubscribeReturnQos |
subscribeReturnQos
|
private MsgInterceptor |
updateInterceptor
|
private java.lang.String |
xpath
|
private java.lang.String |
xpathTag
|
Fields inherited from interface org.custommonkey.xmlunit.XSLTConstants |
---|
XSLT_END, XSLT_IDENTITY_TEMPLATE, XSLT_START, XSLT_STRIP_WHITESPACE, XSLT_XML_OUTPUT_NOINDENT |
Fields inherited from interface org.custommonkey.xmlunit.XMLConstants |
---|
CLOSE_NODE, END_CDATA, END_COMMENT, END_PROCESSING_INSTRUCTION, OPEN_END_NODE, OPEN_START_NODE, START_CDATA, START_COMMENT, START_DOCTYPE, START_PROCESSING_INSTRUCTION, XML_DECLARATION, XMLNS_PREFIX, XPATH_ATTRIBUTE_IDENTIFIER, XPATH_CHARACTER_NODE_IDENTIFIER, XPATH_COMMENT_IDENTIFIER, XPATH_NODE_INDEX_END, XPATH_NODE_INDEX_START, XPATH_PROCESSING_INSTRUCTION_IDENTIFIER, XPATH_SEPARATOR |
Constructor Summary | |
---|---|
TestTopicLifeCycle(Global glob,
java.lang.String testName)
Constructs the TestTopicLifeCycle object. |
Method Summary | |
---|---|
private java.lang.String |
getDump()
Retrieve a dump of xmlBlaster to analyse |
static void |
main(java.lang.String[] args)
Invoke: java org.xmlBlaster.test.topic.TestTopicLifeCycle -startEmbedded false |
EraseReturnQos[] |
sendErase(boolean forceDestroy)
|
void |
sendExpiringMsg(boolean initializeTopic,
long topicDestroyDelay,
long msgLifeTime)
Publish an almost volatile message. |
java.lang.String |
sendExpiringXPathMsg(long topicDestroyDelay,
long msgLifeTime)
Publish an almost volatile XPATH message. |
protected void |
setUp()
Sets up the fixture. |
void |
subscribeMsg()
Subscribe a volatile message. |
java.lang.String |
subscribeXPathMsg()
Subscribe topics with XPATH. |
static junit.framework.Test |
suite()
Method is used by TestRunner to load these tests |
protected void |
tearDown()
Tears down the fixture. |
void |
testExpiry()
THIS IS THE TEST |
void |
testForcedErased()
THIS IS THE TEST Transitions [1] -> [4] -> [10] |
void |
testSoftErased()
THIS IS THE TEST Transitions [1] -> [4] -> [7] -> [12] |
void |
testSubscribeVolatile()
THIS IS THE TEST Transitions [1] -> [4] -> [6] -> [11] |
void |
testUnconfiguredErased()
THIS IS THE TEST Transitions [1] -> [9] |
void |
testUnconfiguredSubscribeSubscribe()
THIS IS THE TEST Transitions [1] -> [13] -> [9] |
void |
testUnconfiguredUnSubscribe()
THIS IS THE TEST Transitions [1] -> [9] (by unSubscribe) |
void |
testUnreferencedAlive()
THIS IS THE TEST |
void |
testVolatile()
THIS IS THE TEST |
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 org.custommonkey.xmlunit.XMLTestCase |
---|
assertNodeTestPasses, assertNodeTestPasses, assertNotXpathExists, assertNotXpathExists, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLIdentical, assertXMLIdentical, assertXMLIdentical, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLValid, assertXMLValid, assertXMLValid, assertXMLValid, assertXpathEvaluatesTo, assertXpathEvaluatesTo, assertXpathExists, assertXpathExists, assertXpathNotExists, assertXpathNotExists, assertXpathsEqual, assertXpathsEqual, assertXpathsEqual, assertXpathsEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, compareXML, compareXML, compareXML, compareXML, compareXML, setControlParser, setIgnoreWhitespace, setTestParser |
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 |
---|
private Global glob
private static java.util.logging.Logger log
private I_XmlBlasterAccess con
private java.lang.String senderContent
private java.lang.String publishOid
private final java.lang.String xpathTag
private final java.lang.String xpath
private SubscribeReturnQos subscribeReturnQos
private long blockUpdateTime
private EmbeddedXmlBlaster serverThread
private int serverPort
private boolean startEmbedded
private MsgInterceptor updateInterceptor
Constructor Detail |
---|
public TestTopicLifeCycle(Global glob, java.lang.String testName)
testName
- The name used in the test suiteloginName
- The name to login to the xmlBlasterMethod Detail |
---|
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown()
tearDown
in class junit.framework.TestCase
public EraseReturnQos[] sendErase(boolean forceDestroy)
public void sendExpiringMsg(boolean initializeTopic, long topicDestroyDelay, long msgLifeTime)
public java.lang.String sendExpiringXPathMsg(long topicDestroyDelay, long msgLifeTime)
public void subscribeMsg()
public java.lang.String subscribeXPathMsg()
public void unSubscribeMsg()
private java.lang.String getDump()
public void testExpiry()
We traverse the transitions
Start -[2]-> ALIVE (3 sec) -[6]-> UNREFERENCED (3 sec) -[11]-> DEADas described in requirement engine.message.lifecycle by sending some expiring messages (see state transition brackets in requirement)
public void testUnreferencedAlive() throws java.lang.Exception
We traverse the transitions
Start -[2]-> ALIVE (3 sec) -[6]-> UNREFERENCED (3 sec) -[5]-> ALIVE (3 sec) -[11]-> DEADas described in requirement engine.message.lifecycle by sending some expiring messages (see state transition brackets in requirement)
java.lang.Exception
public void testVolatile()
We traverse the transitions
Start -[2]-> ALIVE (0 sec) -[6]-> UNREFERENCED (0 sec) -[11]-> DEADas described in requirement engine.message.lifecycle by sending some expiring messages (see state transition brackets in requirement)
Please see individual test for a description
public void testSubscribeVolatile()
public void testUnconfiguredSubscribeSubscribe()
public void testSoftErased()
public void testForcedErased()
public void testUnconfiguredErased()
public void testUnconfiguredUnSubscribe()
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
update
in interface I_Callback
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 namecontent
- The arrived message content. This is your payload.I_Callback.update(String, UpdateKey, byte[], UpdateQos)
public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |