|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.tck.junit4.AbstractMuleTestCase org.mule.tck.junit4.AbstractMuleContextTestCase org.mule.tck.junit4.FunctionalTestCase org.mule.tck.AbstractServiceAndFlowTestCase org.mule.transport.sftp.AbstractSftpTestCase
public abstract class AbstractSftpTestCase
Nested Class Summary | |
---|---|
class |
AbstractSftpTestCase.DispatchParameters
Helper class for dynamic assignment of parameters to the method dispatchAndWaitForDelivery() Only inboundEndpoint and outboundEndpoint are mandatory, the rest of the parameters are optional. |
Nested classes/interfaces inherited from class org.mule.tck.AbstractServiceAndFlowTestCase |
---|
AbstractServiceAndFlowTestCase.ConfigVariant |
Field Summary | |
---|---|
protected static String |
FILENAME
|
protected static String |
INBOUND_ENDPOINT_DIR
|
protected static Map<String,String> |
MESSAGE_PROPERTIES
|
protected static String |
OUTBOUND_ENDPOINT_DIR
|
DynamicPort |
port
|
protected SftpClient |
sftpClient
|
protected SftpServer |
sftpServer
|
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, TEST_MESSAGE |
Fields inherited from class org.mule.tck.junit4.AbstractMuleTestCase |
---|
DEFAULT_TEST_TIMEOUT_SECS, globalTimeout, logger, name, TEST_TIMEOUT_SYSTEM_PROPERTY |
Constructor Summary | |
---|---|
AbstractSftpTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant,
String configResources)
|
Method Summary | |
---|---|
protected void |
assertFilesInEndpoint(MuleClient muleClient,
String endpointName,
String expectedFile)
Asserts that only the expectedFile is found on the path that the endpointName use, where filenames can be expressed as a regular expression. |
protected void |
assertFilesInEndpoint(MuleClient muleClient,
String endpointName,
String[] expectedFiles)
Asserts that only the expectedFiles are found on the path that the endpointName use, where filenames can be expressed as a regular expression. |
protected void |
assertFilesInEndpoint(MuleClient muleClient,
String endpointName,
String subDirectory,
String expectedFile)
Asserts that only the expectedFile is found on the sub directory subDirectory under the path that endpointName use, where filenames can be expressed as a regular expression. |
protected void |
assertFilesInEndpoint(MuleClient muleClient,
String endpointName,
String subDirectory,
String[] expectedFiles)
Asserts that only the expectedFiles are found on the sub directory subDirectory under the path that endpointName use, where filenames can be expressed as a regular expression. |
protected void |
assertFilesInLocalFilesystem(String path,
String expectedFile)
Asserts that only the expectedFile is found on the path path, where filenames can be expressed as a regular expression. |
protected void |
assertFilesInLocalFilesystem(String path,
String[] expectedFiles)
Asserts that only the expectedFiles are found on the path path, where filenames can be expressed as a regular expression. |
protected void |
assertNoFilesInEndpoint(MuleClient muleClient,
String endpointName)
Asserts that no files are found on the path that the endpointName use. |
protected void |
assertNoFilesInEndpoint(MuleClient muleClient,
String endpointName,
String subDirectory)
Asserts that no files are found on the sub directory subDirectory under the path that endpointName use. |
protected void |
assertNoFilesInLocalFilesystem(String path)
Asserts that there are no files found on the path path. |
void |
before()
|
void |
checkConnectors()
Check that all of the connectors are running. |
protected void |
createRemoteDirectory(MuleClient muleClient,
String endpointName,
String directoryName)
Creates the directoryName under the endpoint path |
protected void |
dispatchAndWaitForDelivery(AbstractSftpTestCase.DispatchParameters p)
Helper method for initiating a test and wait for the test to complete. |
protected Exception |
dispatchAndWaitForException(AbstractSftpTestCase.DispatchParameters p,
String expectedFailingConnector)
|
protected Exception |
dispatchAndWaitForException(AbstractSftpTestCase.DispatchParameters p,
String expectedFailingConnector,
String serviceName)
Helper method for initiating a test and wait for an exception to be caught by the sftp-connector. |
protected void |
executeBaseAssertionsAfterCall(int sendSize,
int receivedSize)
To be overridden by the test-classes if required |
protected void |
executeBaseAssertionsBeforeCall()
To be overridden by the test-classes if required |
protected void |
executeBaseTest(String inputEndpointName,
String sendUrl,
String filename,
int size,
String receivingTestComponentName,
long timeout)
Base method for executing tests... |
protected void |
executeBaseTest(String inputEndpointName,
String sendUrl,
String filename,
int size,
String receivingTestComponentName,
long timeout,
String expectedFailingConnector)
|
protected void |
executeBaseTest(String inputEndpointName,
String sendUrl,
String filename,
int size,
String receivingTestComponentName,
long timeout,
String expectedFailingConnector,
String serviceName)
Base method for executing tests... |
protected String |
getAddressByEndpoint(MuleClient muleClient,
String endpointName)
|
protected ImmutableEndpoint |
getImmutableEndpoint(MuleClient muleClient,
String endpointName)
|
protected String |
getPathByEndpoint(MuleClient muleClient,
SftpClient sftpClient,
String endpointName)
|
protected SftpClient |
getSftpClient(MuleClient muleClient,
String endpointName)
Returns a SftpClient that is logged in to the sftp server that the endpoint is configured against. |
protected SftpClient |
getSftpClient(String host,
int port,
String user,
String password)
Returns a SftpClient that is logged in to the sftp server that the endpoint is configured against. |
protected EndpointURI |
getUriByEndpointName(MuleClient muleClient,
String endpointName)
|
protected void |
initEndpointDirectories(String[] serviceNames,
String[] endpointNames)
Initiates a list of sftp-endpoint-directories. |
protected void |
initEndpointDirectory(String endpointName)
Ensures that the directory exists and is writable by deleting the directory and then recreate it. |
protected void |
recursiveDelete(MuleClient muleClient,
SftpClient sftpClient,
String endpointName,
String relativePath)
Deletes a directory with all its files and sub-directories. |
protected void |
recursiveDeleteInLocalFilesystem(File parent)
|
protected void |
remoteChmod(MuleClient muleClient,
SftpClient sftpClient,
String endpointName,
int permissions)
|
protected boolean |
verifyFileExists(SftpClient sftpClient,
EndpointURI endpointURI,
String file)
Checks if the file exists on the server |
protected boolean |
verifyFileExists(SftpClient sftpClient,
String path,
String file)
|
Methods inherited from class org.mule.tck.AbstractServiceAndFlowTestCase |
---|
doSetUp, 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.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 |
---|
protected static final Map<String,String> MESSAGE_PROPERTIES
protected static String INBOUND_ENDPOINT_DIR
protected static String OUTBOUND_ENDPOINT_DIR
protected static final String FILENAME
public DynamicPort port
protected SftpServer sftpServer
protected SftpClient sftpClient
Constructor Detail |
---|
public AbstractSftpTestCase(AbstractServiceAndFlowTestCase.ConfigVariant variant, String configResources)
Method Detail |
---|
protected void recursiveDelete(MuleClient muleClient, SftpClient sftpClient, String endpointName, String relativePath) throws IOException
muleClient
- endpointName
- relativePath
-
IOException
protected void createRemoteDirectory(MuleClient muleClient, String endpointName, String directoryName) throws IOException
IOException
protected EndpointURI getUriByEndpointName(MuleClient muleClient, String endpointName) throws IOException
IOException
protected String getAddressByEndpoint(MuleClient muleClient, String endpointName)
muleClient
- endpointName
-
protected String getPathByEndpoint(MuleClient muleClient, SftpClient sftpClient, String endpointName)
protected SftpClient getSftpClient(MuleClient muleClient, String endpointName) throws IOException
IOException
protected SftpClient getSftpClient(String host, int port, String user, String password) throws IOException
IOException
protected boolean verifyFileExists(SftpClient sftpClient, EndpointURI endpointURI, String file) throws IOException
IOException
protected boolean verifyFileExists(SftpClient sftpClient, String path, String file) throws IOException
IOException
protected void executeBaseTest(String inputEndpointName, String sendUrl, String filename, int size, String receivingTestComponentName, long timeout) throws Exception
Exception
protected void executeBaseTest(String inputEndpointName, String sendUrl, String filename, int size, String receivingTestComponentName, long timeout, String expectedFailingConnector) throws Exception
Exception
protected void executeBaseTest(String inputEndpointName, String sendUrl, String filename, int size, String receivingTestComponentName, long timeout, String expectedFailingConnector, String serviceName) throws Exception
Exception
protected void executeBaseAssertionsBeforeCall()
protected void executeBaseAssertionsAfterCall(int sendSize, int receivedSize)
protected ImmutableEndpoint getImmutableEndpoint(MuleClient muleClient, String endpointName) throws IOException
IOException
protected void remoteChmod(MuleClient muleClient, SftpClient sftpClient, String endpointName, int permissions) throws com.jcraft.jsch.SftpException
com.jcraft.jsch.SftpException
protected void initEndpointDirectories(String[] serviceNames, String[] endpointNames) throws Exception
serviceNames
- endpointNames
-
Exception
protected void initEndpointDirectory(String endpointName) throws MuleException, IOException, com.jcraft.jsch.SftpException
endpointName
-
MuleException
IOException
com.jcraft.jsch.SftpException
protected void dispatchAndWaitForDelivery(AbstractSftpTestCase.DispatchParameters p)
p
- where inboundEndpoint and outboundEndpoint are mandatory, @see
DispatchParameters for details.protected Exception dispatchAndWaitForException(AbstractSftpTestCase.DispatchParameters p, String expectedFailingConnector)
protected Exception dispatchAndWaitForException(AbstractSftpTestCase.DispatchParameters p, String expectedFailingConnector, String serviceName)
p
- where sftpConnector and inboundEndpoint are mandatory, @see
DispatchParameters for details.protected void recursiveDeleteInLocalFilesystem(File parent) throws IOException
IOException
protected void assertNoFilesInLocalFilesystem(String path) throws IOException
path
- The path in the local filesystem to check
IOException
- Exceptionprotected void assertNoFilesInEndpoint(MuleClient muleClient, String endpointName) throws IOException
muleClient
- MuleClientendpointName
- The endpoint name
IOException
- Exceptionprotected void assertNoFilesInEndpoint(MuleClient muleClient, String endpointName, String subDirectory) throws IOException
muleClient
- MuleClientendpointName
- The endpoint namesubDirectory
- The sub directory
IOException
- Exceptionprotected void assertFilesInLocalFilesystem(String path, String expectedFile) throws IOException
path
- The path in the local filesystem to checkexpectedFile
- Expected file
IOException
- Exceptionprotected void assertFilesInLocalFilesystem(String path, String[] expectedFiles) throws IOException
path
- The path in the local filesystem to checkexpectedFiles
- Expected files
IOException
- Exceptionprotected void assertFilesInEndpoint(MuleClient muleClient, String endpointName, String expectedFile) throws IOException
muleClient
- MuleClientendpointName
- The endpoint nameexpectedFile
- Expected file
IOException
- Exceptionprotected void assertFilesInEndpoint(MuleClient muleClient, String endpointName, String[] expectedFiles) throws IOException
muleClient
- MuleClientendpointName
- The endpoint nameexpectedFiles
- Expected files
IOException
- Exceptionprotected void assertFilesInEndpoint(MuleClient muleClient, String endpointName, String subDirectory, String expectedFile) throws IOException
muleClient
- MuleClientendpointName
- The endpoint namesubDirectory
- The sub directoryexpectedFile
- Expected files
IOException
- Exceptionprotected void assertFilesInEndpoint(MuleClient muleClient, String endpointName, String subDirectory, String[] expectedFiles) throws IOException
muleClient
- MuleClientendpointName
- The endpoint namesubDirectory
- The sub directoryexpectedFiles
- Expected files
IOException
- Exceptionpublic void checkConnectors()
public void before() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |