|
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.contrib.filewatcher.TestFileWatcherPlugin
public class TestFileWatcherPlugin
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.TestFilePollerPlugin java junit.swingui.TestRunner -noloading org.xmlBlaster.test.client.TestFilePollerPlugin
I_XmlBlasterAccess
Field Summary | |
---|---|
private Global |
connGlobal
|
private java.lang.String |
dirName
|
private java.lang.String |
dirNameDiscarded
|
private java.lang.String |
dirNameSent
|
private Global |
global
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private java.lang.String |
oid
|
private MsgInterceptor |
updateInterceptor
|
Constructor Summary | |
---|---|
TestFileWatcherPlugin()
|
|
TestFileWatcherPlugin(Global global)
|
Method Summary | |
---|---|
private void |
checkDirs()
|
private void |
checkMoved(java.lang.String name,
boolean absSubPath,
java.lang.String subDirName)
|
private void |
cleanUpDirs()
|
private boolean |
compareContent(byte[] buf1,
byte[] buf2)
|
private void |
delete(java.lang.String filename)
|
private void |
doPublish(I_Info prop,
boolean deliverFirst,
boolean deliverSecond,
boolean absSubPath)
|
private void |
getBaseDir()
|
private java.lang.String |
getConnectQos(Global glob)
|
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.TestFilePollerPlugin |
protected void |
setUp()
Sets up the fixture. |
private void |
singleDump(java.lang.String filename,
int filesize,
java.lang.String lockExt,
long delay,
boolean deliver,
boolean absSubPath,
java.lang.String movedDir)
|
protected void |
tearDown()
Tears down the fixture. |
void |
testDirectories()
Tests the creation of the necessary directories |
void |
testPublishWithMoveAbsolute()
|
void |
testPublishWithMoveRelative()
|
void |
testPublishWithMoveRelativeLockMode()
|
void |
testSimplePublish()
|
void |
testSimplePublishWithFilter()
|
void |
testSimplePublishWithFilterLockMode()
|
void |
testSimplePublishWithFilterRegex()
|
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode about a new message. |
private byte[] |
writeFile(java.lang.String filename,
int size,
java.lang.String lockExt,
long timeToWait)
|
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 java.lang.String dirName
private java.lang.String dirNameSent
private java.lang.String dirNameDiscarded
private MsgInterceptor updateInterceptor
Constructor Detail |
---|
public TestFileWatcherPlugin()
public TestFileWatcherPlugin(Global global)
Method Detail |
---|
private void getBaseDir()
protected void setUp()
setUp
in class junit.framework.TestCase
protected void tearDown()
tearDown
in class junit.framework.TestCase
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
I_Callback
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.
XmlBlasterException
I_XmlBlasterAccess
public void testDirectories()
private void singleDump(java.lang.String filename, int filesize, java.lang.String lockExt, long delay, boolean deliver, boolean absSubPath, java.lang.String movedDir)
private void checkMoved(java.lang.String name, boolean absSubPath, java.lang.String subDirName)
private void doPublish(I_Info prop, boolean deliverFirst, boolean deliverSecond, boolean absSubPath)
public void testSimplePublish()
public void testSimplePublishWithFilter()
public void testSimplePublishWithFilterRegex()
public void testPublishWithMoveAbsolute()
public void testPublishWithMoveRelative()
public void testPublishWithMoveRelativeLockMode()
public void testSimplePublishWithFilterLockMode()
private boolean compareContent(byte[] buf1, byte[] buf2)
private byte[] writeFile(java.lang.String filename, int size, java.lang.String lockExt, long timeToWait)
private void checkDirs()
private java.lang.String getConnectQos(Global glob)
private void delete(java.lang.String filename)
private void cleanUpDirs()
public static void main(java.lang.String[] args)
java -Djava.compiler= junit.textui.TestRunner org.xmlBlaster.test.client.TestFilePollerPlugin
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |