|
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.xmlBlaster.test.topic.TestReferenceCount
public class TestReferenceCount
Tests the correct reference counting for persistent messages after recovery.
1. Start xmlBlaster server 2. Publish two messages 3. Subscribe to message and block in callback 4. Kill server and clients 5. Restart server 6. Start same subscriber - it will receive the message from 3. 7. Start another subscriber: we expect an update If the reference counter is not properly set on recovery test 7. will fail.Invoke examples:
java junit.textui.TestRunner org.xmlBlaster.test.topic.TestReferenceCount java junit.swingui.TestRunner -noloading org.xmlBlaster.test.topic.TestReferenceCount
Nested Class Summary | |
---|---|
(package private) class |
TestReferenceCount.Client
|
Field Summary | |
---|---|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private java.lang.String |
oid
|
private int |
serverPort
|
private EmbeddedXmlBlaster |
serverThread
|
Constructor Summary | |
---|---|
TestReferenceCount(Global glob,
java.lang.String testName)
Constructs the TestReferenceCount object. |
|
TestReferenceCount(java.lang.String testName)
|
Method Summary | |
---|---|
private TestReferenceCount.Client |
doConnect(java.lang.String loginName,
I_Callback cb)
Create a new connection |
private void |
doErase(I_XmlBlasterAccess con)
Erase the message. |
private void |
doPublish(I_XmlBlasterAccess con)
Construct a message and publish it persistent. |
private void |
doSubscribe(I_XmlBlasterAccess con)
Subscribe to message. |
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.topic.TestReferenceCount |
void |
reachedAlive(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode if the connection was established. |
void |
reachedAliveSync(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
Invoked when the dispatcher goes to synch again after having delivered entries which where in the queue when the state changed to ALIVE. |
void |
reachedDead(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from XmlBlasterAccess informing the client that the connection was lost (i.e. |
void |
reachedPolling(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from XmlBlasterAccess informing the client that the connection state has changed to POLLING. |
protected void |
setUp()
Sets up the fixture. |
static junit.framework.Test |
suite()
Method is used by TestRunner to load these tests |
protected void |
tearDown()
Tears down the fixture. |
void |
testReferenceCount()
Test as described in class javadoc. |
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 static java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private int serverPort
private EmbeddedXmlBlaster serverThread
private java.lang.String oid
Constructor Detail |
---|
public TestReferenceCount(java.lang.String testName)
public TestReferenceCount(Global glob, java.lang.String testName)
testName
- The name used in the test suiteMethod Detail |
---|
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown()
tearDown
in class junit.framework.TestCase
private TestReferenceCount.Client doConnect(java.lang.String loginName, I_Callback cb)
loginName
- The login namecb
- The callback handle or nullprivate void doSubscribe(I_XmlBlasterAccess con)
private void doPublish(I_XmlBlasterAccess con)
private void doErase(I_XmlBlasterAccess con)
public void testReferenceCount()
public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
reachedAlive
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public void reachedAliveSync(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
I_ConnectionStateListener
reachedAliveSync
in interface I_ConnectionStateListener
oldState
- is always ALIVE.public void reachedPolling(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
I_ConnectionStateListener
reachedPolling
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public void reachedDead(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
I_ConnectionStateListener
reachedDead
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public static junit.framework.Test suite()
public static void main(java.lang.String[] args)
java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.topic.TestReferenceCount
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |