INT-1614 added more tests for FTPS based adapter, coverage is at 80%

This commit is contained in:
Oleg Zhurakousky
2010-11-16 12:00:40 -05:00
parent f0d344ab57
commit 54b2f7dc42
2 changed files with 19 additions and 70 deletions

View File

@@ -90,76 +90,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<!-- <xsd:attribute name="username" type="xsd:string" use="required"/>-->
<!-- <xsd:attribute name="remote-directory" type="xsd:string" use="required"/>-->
<!-- <xsd:attribute name="host" type="xsd:string" use="required"/>-->
<!-- <xsd:attribute name="password" type="xsd:string" use="required"/>-->
<xsd:attribute name="charset" type="xsd:string" default="UTF-8"/>
<!-- <xsd:attribute name="port" type="xsd:int" default="22"/>-->
<!-- <xsd:attribute name="client-mode" default="active-local-data-connection-mode" use="optional" >-->
<!-- <xsd:annotation>-->
<!-- <xsd:documentation><![CDATA[-->
<!-- the FTP Client-Mode-->
<!---->
<!-- /***-->
<!-- * A constant indicating the FTP session is expecting all transfers-->
<!-- * to occur between the client (local) and server and that the server-->
<!-- * should connect to the client's data port to initiate a data transfer.-->
<!-- * This is the default data connection mode when and FTPClient instance-->
<!-- * is created.-->
<!-- ***/-->
<!-- ACTIVE_LOCAL_DATA_CONNECTION_MODE = 0-->
<!---->
<!-- /***-->
<!-- * A constant indicating the FTP session is expecting all transfers-->
<!-- * to occur between two remote servers and that the server-->
<!-- * the client is connected to should connect to the other server's-->
<!-- * data port to initiate a data transfer.-->
<!-- ***/-->
<!-- ACTIVE_LOCAL_DATA_CONNECTION_MODE = 1-->
<!---->
<!-- /***-->
<!-- * A constant indicating the FTP session is expecting all transfers-->
<!-- * to occur between the client (local) and server and that the server-->
<!-- * is in passive mode, requiring the client to connect to the-->
<!-- * server's data port to initiate a transfer.-->
<!-- ***/-->
<!-- PASSIVE_LOCAL_DATA_CONNECTION_MODE = 2-->
<!---->
<!-- /***-->
<!-- * A constant indicating the FTP session is expecting all transfers-->
<!-- * to occur between two remote servers and that the server-->
<!-- * the client is connected to is in passive mode, requiring the other-->
<!-- * server to connect to the first server's data port to initiate a data-->
<!-- * transfer.-->
<!-- ***/-->
<!-- PASSIVE_REMOTE_DATA_CONNECTION_MODE = 3-->
<!---->
<!-- ]]></xsd:documentation>-->
<!-- </xsd:annotation>-->
<!-- <xsd:simpleType>-->
<!-- <xsd:restriction base="xsd:NMTOKEN">-->
<!-- <xsd:enumeration value="active-local-data-connection-mode"/>-->
<!-- <xsd:enumeration value="active-remote-data-connection-mode"/>-->
<!-- <xsd:enumeration value="passive-local-data-connection-mode"/>-->
<!-- <xsd:enumeration value="passive-remote-data-connection-mode"/>-->
<!-- </xsd:restriction>-->
<!-- </xsd:simpleType>-->
<!-- </xsd:attribute>-->
<!-- <xsd:attribute name="file-type" default="binary-file-type" use="optional">-->
<!-- <xsd:annotation>-->
<!-- <xsd:documentation><![CDATA[-->
<!-- Binary, ASCII, or EBDIC. Binary's a good default-->
<!-- ]]></xsd:documentation>-->
<!-- </xsd:annotation>-->
<!-- <xsd:simpleType>-->
<!-- <xsd:restriction base="xsd:NMTOKEN">-->
<!-- <xsd:enumeration value="ebcdic-file-type"/>-->
<!-- <xsd:enumeration value="ascii-file-type"/>-->
<!-- <xsd:enumeration value="binary-file-type"/>-->
<!-- </xsd:restriction>-->
<!-- </xsd:simpleType>-->
<!-- </xsd:attribute>-->
</xsd:complexType>
</xsd:schema>

View File

@@ -7,6 +7,13 @@
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd">
<bean id="keyManager" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="javax.net.ssl.KeyManager"/>
</bean>
<bean id="trustManager" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="javax.net.ssl.TrustManager"/>
</bean>
<bean id="ftpClientFactory" class="org.springframework.integration.ftp.client.DefaultFtpsClientFactory">
<property name="host" value="localhost"/>
<property name="port" value="22"/>
@@ -15,8 +22,19 @@
<property name="clientMode" value="1"/>
<property name="fileType" value="2"/>
<property name="remoteWorkingDirectory" value="foo/bar"/>
<property name="useClientMode" value="true"/>
<property name="cipherSuites" value="a,b.c"/>
<property name="keyManager" ref="keyManager"/>
<property name="protocol" value="SSL"/>
<property name="trustManager" ref="trustManager"/>
<property name="prot" value="P"/>
<property name="needClientAuth" value="true"/>
<property name="authValue" value="oleg"/>
<property name="sessionCreation" value="true"/>
<property name="protocols" value="SSL, TLS"/>
<property name="implicit" value="true"/>
</bean>
<int-ftp:outbound-channel-adapter id="ftpOutbound"
channel="ftpChannel"
client-factory="ftpClientFactory"