org.mule.transport.ftp
Class AbstractFtpServerTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.mule.tck.AbstractMuleTestCase
              extended by org.mule.tck.FunctionalTestCase
                  extended by org.mule.transport.ftp.AbstractFtpServerTestCase
All Implemented Interfaces:
junit.framework.Test, TestCaseWatchdogTimeoutHandler, MuleFtplet.Callback
Direct Known Subclasses:
FtpEncodingFunctionalTestCase, FtpFunctionalTestCase, FtpMessageDispatcherTestCase, FtpMessageRequesterTestCase, FtpStreamingTestCase

public abstract class AbstractFtpServerTestCase
extends FunctionalTestCase
implements MuleFtplet.Callback

Abstract FTP test class. Sets up the ftp server and starts/stops it during the test lifecycle.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mule.tck.AbstractMuleTestCase
AbstractMuleTestCase.TestInfo
 
Field Summary
static java.lang.String FTP_SERVER_BASE_DIR
           
protected  org.apache.ftpserver.ftplet.Ftplet ftplet
          Subclasses can overwrite Ftplet that will be registered when creating the server.
static java.lang.String TEST_MESSAGE
           
 
Fields inherited from class org.mule.tck.AbstractMuleTestCase
callbackCalled, CLASSNAME_ANNOTATIONS_CONFIG_BUILDER, DEFAULT_MULE_TEST_TIMEOUT_SECS, IGNORED_DOT_MULE_DIRS, LOCK_TIMEOUT, logger, muleContext, numPorts, ports, PROPERTY_MULE_TEST_TIMEOUT, RECEIVE_TIMEOUT, testTimeoutSecs
 
Constructor Summary
AbstractFtpServerTestCase(int port)
           
AbstractFtpServerTestCase(int port, int timeout)
           
AbstractFtpServerTestCase(java.lang.String ftpHost, int port, int timeout)
           
 
Method Summary
protected  void createFileOnFtpServer(java.lang.String fileName)
           
protected  void doSetUp()
          Exactly the same a AbstractMuleTestCase.setUp() in normal JUnit test cases.
protected  void doTearDown()
          Exactly the same a AbstractMuleTestCase.tearDown() in normal JUnit test cases.
 void fileMoveCompleted()
           
 void fileUploadCompleted()
           
 FTPTestClient getFtpClient()
           
 java.lang.String getMuleFtpEndpoint()
          Return the endpoint denoted by the ftp configuration
protected  int getTimeout()
           
protected  void startServer()
           
protected  void stopServer()
           
 
Methods inherited from class org.mule.tck.FunctionalTestCase
getBuilder, getComponent, getComponent, getConfigResources, getFunctionalTestComponent, loadResource, loadResourceAsString
 
Methods inherited from class org.mule.tck.AbstractMuleTestCase
addBuilders, checkPorts, configureMuleContext, createMuleContext, createObject, createObject, createTestInfo, createWatchdog, disposeManager, findFreePorts, getConfigurationResources, getPorts, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestEventContext, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEvent, getTestInboundEvent, getTestInboundEvent, getTestInfo, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTimeoutSecs, getTestTransactedInboundEndpoint, getTestTransformer, getTriggerableMessageSource, getTriggerableMessageSource, giveTheTestSomeTimeToCleanUpAndThenKillIt, handleTimeout, initialiseObject, initTestTimeoutSecs, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isDisposeManagerPerSuite, isExcluded, isGracefulShutdown, isOffline, isPortFree, isStartContext, registerTestMethod, run, runBare, setDisposeManagerPerSuite, setFailOnTimeout, setName, setStartContext, setUp, suitePostTearDown, suitePreSetUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runTest, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEST_MESSAGE

public static final java.lang.String TEST_MESSAGE
See Also:
Constant Field Values

FTP_SERVER_BASE_DIR

public static final java.lang.String FTP_SERVER_BASE_DIR
See Also:
Constant Field Values

ftplet

protected org.apache.ftpserver.ftplet.Ftplet ftplet
Subclasses can overwrite Ftplet that will be registered when creating the server.

Constructor Detail

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(java.lang.String ftpHost,
                                 int port,
                                 int timeout)

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(int port,
                                 int timeout)

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(int port)
Method Detail

startServer

protected void startServer()
                    throws java.lang.Exception
Throws:
java.lang.Exception

stopServer

protected void stopServer()
                   throws java.lang.Exception
Throws:
java.lang.Exception

doSetUp

protected void doSetUp()
                throws java.lang.Exception
Description copied from class: AbstractMuleTestCase
Exactly the same a AbstractMuleTestCase.setUp() in normal JUnit test cases. this is called before a test method has been called.

Overrides:
doSetUp in class AbstractMuleTestCase
Throws:
java.lang.Exception - if something fails that should halt the testcase

doTearDown

protected void doTearDown()
                   throws java.lang.Exception
Description copied from class: AbstractMuleTestCase
Exactly the same a AbstractMuleTestCase.tearDown() in normal JUnit test cases. this is called after a test method has been called.

Overrides:
doTearDown in class AbstractMuleTestCase
Throws:
java.lang.Exception - if something fails that should halt the testcase

getTimeout

protected int getTimeout()

getFtpClient

public FTPTestClient getFtpClient()

getMuleFtpEndpoint

public java.lang.String getMuleFtpEndpoint()
Return the endpoint denoted by the ftp configuration


createFileOnFtpServer

protected void createFileOnFtpServer(java.lang.String fileName)
                              throws java.io.IOException
Throws:
java.io.IOException

fileUploadCompleted

public void fileUploadCompleted()
Specified by:
fileUploadCompleted in interface MuleFtplet.Callback

fileMoveCompleted

public void fileMoveCompleted()
Specified by:
fileMoveCompleted in interface MuleFtplet.Callback


Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.