Created
October 12, 2011 13:16
-
-
Save svacas/1281201 to your computer and use it in GitHub Desktop.
BMUnit test using Mule 3.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(BMUnitRunner.class) | |
public class FtpErrorTestCase extends AbstractFtpServerTestCase | |
{ | |
public FtpErrorTestCase() | |
{ | |
super(ConfigVariant.FLOW, "ftp-message-requester-test.xml"); | |
} | |
@BMRule(name = "throw ftp exception", | |
targetClass = "FTPClient", | |
targetMethod = "retrieveFile(String, OutputStream)", | |
condition = "true", | |
action = "throw new org.apache.commons.net.ftp.FTPConnectionClosedException(\"by byteman\")") | |
@Test(expected = MuleException.class) | |
public void testFtpServiceNotAvailable() throws Exception | |
{ | |
createFileOnFtpServer("test.txt"); | |
MuleClient client = new MuleClient(muleContext); | |
client.request(getMuleFtpEndpoint(), getTimeout()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment