Package org.ikasan.testharness.flow.ftp
Class FtpRule
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.ikasan.testharness.flow.ftp.FtpRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class FtpRule extends org.junit.rules.ExternalResourceFtpSystemRule is a helper class to allow FTP testing.- Author:
- Ikasan Development Team
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafter()Override to tear down your specific external resource.protected voidbefore()Override to set up your specific external resource.java.lang.StringgetBaseDir()org.mockftpserver.fake.filesystem.FileSystemEntrygetFile(java.lang.String fileName)intgetPort()voidputFile(java.lang.String fileName, java.lang.String content)voidstart()Start the fakeFtpServer.voidstop()Stop the fakeFtpServer.
-
-
-
Method Detail
-
putFile
public void putFile(java.lang.String fileName, java.lang.String content) throws java.lang.Exception- Throws:
java.lang.Exception
-
getFile
public org.mockftpserver.fake.filesystem.FileSystemEntry getFile(java.lang.String fileName) throws java.lang.Exception- Throws:
java.lang.Exception
-
getPort
public int getPort()
-
getBaseDir
public java.lang.String getBaseDir()
-
start
public void start()
Start the fakeFtpServer. The ssh will normally be started by JUnit using the before() method. This method allows the sshd to be started manually to support advanced testing scenarios.
-
stop
public void stop()
Stop the fakeFtpServer. Remove all temp files from the baseDir The fakeFtpServer demon will normally be stopped by JUnit using the after() method. This method allows the sshd to be stopped manually to support advanced testing scenarios.
-
before
protected void before() throws java.lang.ThrowableOverride to set up your specific external resource.- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
java.lang.Throwable- if setup fails (which will disableafter
-
after
protected void after()
Override to tear down your specific external resource.- Overrides:
afterin classorg.junit.rules.ExternalResource
-
-