1   /*
2    * $Id: FtpNamespaceHandlerTestCase.java 11156 2008-03-04 14:06:30Z acooke $
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  package org.mule.transport.ftp;
11  
12  import org.mule.tck.FunctionalTestCase;
13  import org.mule.transport.file.DummyFilenameParser;
14  import org.mule.transport.file.FilenameParser;
15  import org.mule.transport.ftp.FtpConnector;
16  
17  public class FtpNamespaceHandlerTestCase extends FunctionalTestCase
18  {
19      protected String getConfigResources()
20      {
21          return "ftp-namespace-config.xml";
22      }
23  
24      public void testConfig() throws Exception
25      {
26          FtpConnector c = (FtpConnector)muleContext.getRegistry().lookupConnector("ftpConnector");
27          assertNotNull(c);
28  
29          assertEquals("abc", c.getOutputPattern());
30          assertEquals(1234, c.getPollingFrequency());
31          assertEquals(false, c.isBinary());
32          assertEquals(false, c.isPassive());
33          assertEquals(false, c.isValidateConnections());
34          assertEquals(FTPConnectorTestCase.TestFtpConnectionFactory.class.getName(), c.getConnectionFactoryClass());
35  
36          FilenameParser parser = c.getFilenameParser();
37          assertTrue(parser.getClass().getName(), c.getFilenameParser() instanceof DummyFilenameParser);
38  
39          assertTrue(c.isConnected());
40          assertTrue(c.isStarted());
41      }
42  
43  }