org.mule.transport.ftp
Class AbstractFtpServerTestCase

java.lang.Object
  extended by org.mule.tck.junit4.AbstractMuleTestCase
      extended by org.mule.tck.junit4.AbstractMuleContextTestCase
          extended by org.mule.tck.junit4.FunctionalTestCase
              extended by org.mule.tck.AbstractServiceAndFlowTestCase
                  extended by org.mule.transport.ftp.AbstractFtpServerTestCase
All Implemented Interfaces:
MuleFtplet.Callback
Direct Known Subclasses:
FtpEncodingFunctionalTestCase, FtpFunctionalTestCase, FtpMessageDispatcherTestCase, FtpMessageRequesterTestCase, FtpStreamingTestCase, InboundMessageLossTestCase

public abstract class AbstractFtpServerTestCase
extends AbstractServiceAndFlowTestCase
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.AbstractServiceAndFlowTestCase
AbstractServiceAndFlowTestCase.ConfigVariant
 
Field Summary
 DynamicPort dynamicPort
           
static 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 String TEST_MESSAGE
           
 
Fields inherited from class org.mule.tck.AbstractServiceAndFlowTestCase
configResources, variant
 
Fields inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase
callbackCalled, CLASSNAME_ANNOTATIONS_CONFIG_BUILDER, IGNORED_DOT_MULE_DIRS, LOCK_TIMEOUT, muleContext, RECEIVE_TIMEOUT
 
Fields inherited from class org.mule.tck.junit4.AbstractMuleTestCase
DEFAULT_TEST_TIMEOUT_SECS, globalTimeout, logger, name, TEST_TIMEOUT_SYSTEM_PROPERTY
 
Constructor Summary
AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant, String configResources)
           
AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant, String configResources, int timeout)
           
AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant, String configResources, String ftpHost, int timeout)
           
 
Method Summary
protected  void createFileOnFtpServer(String fileName)
           
protected  void createFtpServerDir(String directoryName)
           
protected  void doSetUp()
          Enables the adding of extra behavior on the set up stage of a test right after the creation of the mule context in AbstractMuleContextTestCase.setUpMuleContext().
protected  void doTearDown()
          Enables the adding of extra behavior on the tear down stage of a test before the mule context is disposed in AbstractMuleContextTestCase.disposeContextPerTest().
protected  boolean fileExists(String fileName)
           
 void fileMoveCompleted()
           
 void fileUploadCompleted()
           
 FTPTestClient getFtpClient()
           
 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.AbstractServiceAndFlowTestCase
doSetUpForFlow, doSetUpForService, getConfigResources, getTestHeader
 
Methods inherited from class org.mule.tck.junit4.FunctionalTestCase
clearFlowAssertions, getBuilder, getComponent, getComponent, getFlowConstruct, getFunctionalTestComponent, loadResource, loadResourceAsString, stopFlowConstruct, testFlow, testFlow
 
Methods inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase
addBuilders, configureMuleContext, createMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, getConfigurationResources, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestEventContext, getTestEventUsingFlow, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTransactedInboundEndpoint, getTestTransformer, getTriggerableMessageSource, getTriggerableMessageSource, initialiseObject, isDisposeContextPerClass, isGracefulShutdown, isStartContext, setDisposeContextPerClass, setStartContext, setUpMuleContext
 
Methods inherited from class org.mule.tck.junit4.AbstractMuleTestCase
clearExcludedFlag, clearRequestContext, createTestTimeoutRule, getTestTimeoutSecs, getTimeoutSystemProperty, initializeMuleTest, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isExcluded, isFailOnTimeout, isOffline, isTestIncludedInExclusionFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_MESSAGE

public static final String TEST_MESSAGE
See Also:
Constant Field Values

FTP_SERVER_BASE_DIR

public static final 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.


dynamicPort

public DynamicPort dynamicPort
Constructor Detail

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant,
                                 String configResources,
                                 String ftpHost,
                                 int timeout)

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant,
                                 String configResources,
                                 int timeout)

AbstractFtpServerTestCase

public AbstractFtpServerTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant,
                                 String configResources)
Method Detail

startServer

protected void startServer()
                    throws Exception
Throws:
Exception

stopServer

protected void stopServer()
                   throws Exception
Throws:
Exception

doSetUp

protected void doSetUp()
                throws Exception
Description copied from class: AbstractMuleContextTestCase
Enables the adding of extra behavior on the set up stage of a test right after the creation of the mule context in AbstractMuleContextTestCase.setUpMuleContext().

Under normal circumstances this method could be replaced by a @Before annotated method.

Overrides:
doSetUp in class AbstractServiceAndFlowTestCase
Throws:
Exception - if something fails that should halt the test case

doTearDown

protected void doTearDown()
                   throws Exception
Description copied from class: AbstractMuleContextTestCase
Enables the adding of extra behavior on the tear down stage of a test before the mule context is disposed in AbstractMuleContextTestCase.disposeContextPerTest().

Under normal circumstances this method could be replace with a @After annotated method.

Overrides:
doTearDown in class AbstractMuleContextTestCase
Throws:
Exception - if something fails that should halt the testcase

createFtpServerDir

protected void createFtpServerDir(String directoryName)

getTimeout

protected int getTimeout()

getFtpClient

public FTPTestClient getFtpClient()

getMuleFtpEndpoint

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


createFileOnFtpServer

protected void createFileOnFtpServer(String fileName)
                              throws IOException
Throws:
IOException

fileExists

protected boolean fileExists(String fileName)

fileUploadCompleted

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

fileMoveCompleted

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


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