Skip to content

Instantly share code, notes, and snippets.

@svacas
Created August 1, 2011 03:25
Show Gist options
  • Save svacas/1117522 to your computer and use it in GitHub Desktop.
Save svacas/1117522 to your computer and use it in GitHub Desktop.
@RunWith(BMUnitRunner.class)
public class FtpErrorTestCase extends AbstractFtpServerTestCase
{
@Override
protected String getConfigResources()
{
return "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