View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.sftp;
8   
9   import org.junit.Test;
10  
11  /**
12   * Test the sizeCheck feature.
13   */
14  public class SftpQuartzRequesterFunctionalTestCase extends AbstractSftpTestCase
15  {
16  
17      private static final long TIMEOUT = 20000;
18  
19      // Size of the generated stream - 2 Mb
20      final static int SEND_SIZE = 1024 * 1024 * 2;
21  
22      @Override
23      protected String getConfigResources()
24      {
25          return "mule-sftp-quartzRequester-test-config.xml";
26      }
27  
28      @Override
29      protected void doSetUp() throws Exception
30      {
31          super.doSetUp();
32  
33          // In this test we need to get the outboundEndpoint instead of the inbound
34          initEndpointDirectory("outboundEndpoint");
35      }
36  
37      /**
38       * Test a quarts based requester
39       */
40      @Test
41      public void testQuartzRequester() throws Exception
42      {
43          // TODO. Add some tests specific to sizeCheck, i.e. create a very large file
44          // and ensure that the sizeChec prevents the inbound enpoint to read the file
45          // during creation of it
46  
47          executeBaseTest("inboundEndpoint", "vm://test.upload", FILE_NAME, SEND_SIZE, "receiving", TIMEOUT);
48      }
49  }