|
xmlBlaster 2.1.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.xmlBlaster.test.client.TestStreamMessages
public class TestStreamMessages
This is an interesting example, since it creates a XmlBlaster server instance in the same JVM , but in a separate thread, talking over CORBA with it.
Invoke examples:
java junit.textui.TestRunner -noloading org.xmlBlaster.test.client.TestStreamMessages java junit.swingui.TestRunner -noloading org.xmlBlaster.test.client.TestStreamMessages
I_XmlBlasterAccess| Field Summary | |
|---|---|
private Global |
connGlobal
|
private long |
delay
|
private Global |
global
|
private boolean |
ignoreException
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private byte[] |
msgContent
|
private java.lang.String |
oid
|
private MsgInterceptor |
updateInterceptor
|
| Constructor Summary | |
|---|---|
TestStreamMessages()
|
|
TestStreamMessages(Global global)
|
|
| Method Summary | |
|---|---|
private boolean |
compareContent(byte[] buf1,
byte[] buf2)
|
private byte[] |
createRandomContent(int size)
|
private void |
doPublish(byte[] content,
int maxChunkSize,
boolean doInterrupt,
java.lang.String name)
|
private void |
doPublishJMS(byte[] content,
int maxChunkSize,
boolean doInterrupt,
java.lang.String name)
|
private java.lang.String |
getMemInfo()
|
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.TestStreamMessages |
protected void |
setUp()
Sets up the fixture. |
protected void |
tearDown()
Tears down the fixture. |
void |
testException()
|
void |
testInterruptedRead()
|
void |
testManyBigChunks()
This test is to check that we don't have a problem in the buffer of the Pipes due to large chunks of messages. |
void |
testManyChunks()
|
void |
testManyChunksTwoMessages()
|
void |
testNormalMessage()
|
void |
testSingleChunk()
|
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
java.io.InputStream is,
UpdateQos updateQos)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode about a new 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 |
|---|
private static java.lang.String ME
private Global global
private static java.util.logging.Logger log
private Global connGlobal
private java.lang.String oid
private MsgInterceptor updateInterceptor
private byte[] msgContent
private long delay
private boolean ignoreException
| Constructor Detail |
|---|
public TestStreamMessages()
public TestStreamMessages(Global global)
| Method Detail |
|---|
protected void setUp()
setUp in class junit.framework.TestCaseprotected void tearDown()
tearDown in class junit.framework.TestCaseprivate final java.lang.String getMemInfo()
public java.lang.String update(java.lang.String cbSessionId,
UpdateKey updateKey,
java.io.InputStream is,
UpdateQos updateQos)
throws XmlBlasterException,
java.io.IOException
I_StreamingCallback
update in interface I_StreamingCallbackcbSessionId - 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
XmlBlasterException
java.io.IOExceptionI_XmlBlasterAccess
private void doPublish(byte[] content,
int maxChunkSize,
boolean doInterrupt,
java.lang.String name)
throws XmlBlasterException
XmlBlasterException
private void doPublishJMS(byte[] content,
int maxChunkSize,
boolean doInterrupt,
java.lang.String name)
throws javax.jms.JMSException
javax.jms.JMSExceptionprivate byte[] createRandomContent(int size)
public void testManyChunks()
public void testManyBigChunks()
public void testManyChunksTwoMessages()
public void testSingleChunk()
public void testException()
public void testInterruptedRead()
public void testNormalMessage()
private boolean compareContent(byte[] buf1,
byte[] buf2)
public static void main(java.lang.String[] args)
java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.client.TestStreamMessages
|
xmlBlaster 2.1.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||