xmlBlaster 2.1.0 API

org.xmlBlaster.test.contrib.filewatcher
Class TestFileWriter

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.contrib.filewatcher.TestFileWriter
All Implemented Interfaces:
junit.framework.Test

public class TestFileWriter
extends junit.framework.TestCase

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.TestFileWriter
   java junit.swingui.TestRunner -noloading org.xmlBlaster.test.client.TestFileWriter
 

See Also:
I_XmlBlasterAccess

Nested Class Summary
private  class TestFileWriter.PluginProperties
           
 
Field Summary
private  java.lang.String baseDirName
           
private  Global global
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  java.lang.String oid
           
private  java.lang.String pollerDirName
           
private  java.lang.String pollerDirNameDiscarded
           
private  java.lang.String pollerDirNameSent
           
private  FileWriter receiver
           
private  java.lang.String writerDirName
           
private  java.lang.String writerTmpDirName
           
 
Constructor Summary
TestFileWriter()
           
TestFileWriter(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, java.lang.String filename)
           
private  void delete(java.lang.String filename)
           
private  void doPublish(I_Info prop, boolean deliverFirst, boolean deliverSecond, boolean absSubPath)
           
private  void doWait(long delay)
           
private  void getBaseDir()
           
(package private)  long getChecksum(java.io.InputStream is)
           
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.TestFileWriter
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()
           
private  byte[] writeFile(java.lang.String filename, int size, java.lang.String lockExt)
           
 
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

ME

private static java.lang.String ME

global

private Global global

log

private static java.util.logging.Logger log

oid

private java.lang.String oid

baseDirName

private java.lang.String baseDirName

pollerDirName

private java.lang.String pollerDirName

pollerDirNameSent

private java.lang.String pollerDirNameSent

pollerDirNameDiscarded

private java.lang.String pollerDirNameDiscarded

writerDirName

private java.lang.String writerDirName

writerTmpDirName

private java.lang.String writerTmpDirName

receiver

private FileWriter receiver
Constructor Detail

TestFileWriter

public TestFileWriter()

TestFileWriter

public TestFileWriter(Global global)
Method Detail

getBaseDir

private void getBaseDir()

setUp

protected void setUp()
Sets up the fixture.

Connect to xmlBlaster and login

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

cleaning up .... erase() the previous message OID and logout

Overrides:
tearDown in class junit.framework.TestCase

testDirectories

public void testDirectories()
Tests the creation of the necessary directories


singleDump

private void singleDump(java.lang.String filename,
                        int filesize,
                        java.lang.String lockExt,
                        long delay,
                        boolean deliver,
                        boolean absSubPath,
                        java.lang.String movedDir)

checkMoved

private void checkMoved(java.lang.String name,
                        boolean absSubPath,
                        java.lang.String subDirName)

doWait

private void doWait(long delay)

doPublish

private void doPublish(I_Info prop,
                       boolean deliverFirst,
                       boolean deliverSecond,
                       boolean absSubPath)

testSimplePublish

public void testSimplePublish()

testSimplePublishWithFilter

public void testSimplePublishWithFilter()

testSimplePublishWithFilterRegex

public void testSimplePublishWithFilterRegex()

testPublishWithMoveAbsolute

public void testPublishWithMoveAbsolute()

testPublishWithMoveRelative

public void testPublishWithMoveRelative()

testPublishWithMoveRelativeLockMode

public void testPublishWithMoveRelativeLockMode()

testSimplePublishWithFilterLockMode

public void testSimplePublishWithFilterLockMode()

getChecksum

long getChecksum(java.io.InputStream is)
           throws java.io.IOException
Throws:
java.io.IOException

compareContent

private boolean compareContent(byte[] buf1,
                               java.lang.String filename)

writeFile

private byte[] writeFile(java.lang.String filename,
                         int size,
                         java.lang.String lockExt)

checkDirs

private void checkDirs()

getConnectQos

private java.lang.String getConnectQos(Global glob)

delete

private void delete(java.lang.String filename)

cleanUpDirs

private void cleanUpDirs()

main

public 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.TestFileWriter

Invoke: java org.xmlBlaster.test.client.TestFileWriter


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.