View Javadoc

1   /*
2    * $Id: SftpNamespaceHandlerTestCase.java 22450 2011-07-19 08:20:41Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.sftp;
12  
13  import org.mule.tck.junit4.FunctionalTestCase;
14  
15  import org.junit.Test;
16  
17  import static org.junit.Assert.assertEquals;
18  import static org.junit.Assert.assertNotNull;
19  import static org.junit.Assert.assertTrue;
20  
21  public class SftpNamespaceHandlerTestCase extends FunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "sftp-namespace-config.xml";
28      }
29  
30      @Test
31      public void testSftpConfig() throws Exception
32      {
33          SftpConnector c = (SftpConnector) muleContext.getRegistry().lookupConnector("sftpConnector");
34          assertNotNull(c);
35          assertTrue(c.isConnected());
36          assertTrue(c.isStarted());
37          assertTrue(c.isAutoDelete());
38          assertEquals(c.getPollingFrequency(), 15000);
39          assertEquals(1234, c.getFileAge());
40          assertEquals("uploading", c.getTempDirOutbound());
41          assertEquals(42, c.getMaxConnectionPoolSize());
42      }
43  }