1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.sftp;
12
13 import java.util.Arrays;
14 import java.util.Collection;
15
16 import org.junit.Test;
17 import org.junit.runners.Parameterized.Parameters;
18
19
20
21
22
23
24
25
26
27
28 public class SftpSendReceiveLargeFileFunctionalTestCase extends AbstractSftpTestCase
29 {
30 private static final long TIMEOUT = 600000;
31
32
33 final static int SEND_SIZE = 1024 * 1024 * 200;
34
35 public SftpSendReceiveLargeFileFunctionalTestCase(ConfigVariant variant, String configResources)
36 {
37 super(variant, configResources);
38
39
40 logger.info("Timeout was set to: " + System.getProperty(TEST_TIMEOUT_SYSTEM_PROPERTY, "-1"));
41 System.setProperty(TEST_TIMEOUT_SYSTEM_PROPERTY, "600000");
42 logger.info("Timeout is now set to: " + System.getProperty(TEST_TIMEOUT_SYSTEM_PROPERTY, "-1"));
43 }
44
45 @Parameters
46 public static Collection<Object[]> parameters()
47 {
48 return Arrays.asList(new Object[][]{
49 {ConfigVariant.SERVICE, "mule-send-receive-large-file-test-config-service.xml"},
50 {ConfigVariant.FLOW, "mule-send-receive-large-file-test-config-flow.xml"}});
51 }
52
53 @Override
54 protected void doSetUp() throws Exception
55 {
56 super.doSetUp();
57
58 initEndpointDirectory("inboundEndpoint");
59 }
60
61
62
63
64 @Test
65 public void testSendAndReceiveLargeFile() throws Exception
66 {
67 executeBaseTest("inboundEndpoint", "vm://test.upload", "bigfile.txt", SEND_SIZE, "receiving", TIMEOUT);
68 }
69 }