Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Integration Test and Automate the test #15

Merged
merged 2 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 229 additions & 56 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@
<url>http://wso2.org</url>
<properties>
<connector.name>iso8583</connector.name>
<esb.version>4.9.0</esb.version>
<carbon.mediation.version>4.4.10</carbon.mediation.version>
<org.jpos.version>1.9.6</org.jpos.version>
<commons-cli.version>1.3.1</commons-cli.version>
<org.jdom.version>1.1.3</org.jdom.version>
<carbon.mediation.version>4.6.19</carbon.mediation.version>
<org.testng.version>6.1.1</org.testng.version>
<automation.framework.version>4.4.3</automation.framework.version>
<emma.version>2.1.5320</emma.version>
<carbon.kernel.version>4.4.17</carbon.kernel.version>
<automation.framework.utils.version>4.4.2</automation.framework.utils.version>
<product.ei.version>6.4.0</product.ei.version>
<synapse.version>2.1.7-wso2v19</synapse.version>
<skip-tests>true</skip-tests>
</properties>
<dependencies>
<dependency>
<groupId>org.wso2.carbon.mediation</groupId>
<artifactId>org.wso2.carbon.connector.core</artifactId>
<version>${carbon.mediation.version}</version>
</dependency>
<dependency>
<groupId>org.jpos</groupId>
<artifactId>jpos</artifactId>
Expand All @@ -55,6 +57,126 @@
<artifactId>jdom</artifactId>
<version>${org.jdom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-core</artifactId>
<version>${synapse.version}</version>
</dependency>
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-commons</artifactId>
<version>${synapse.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.connector.core</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.engine</artifactId>
<version>${automation.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.extensions</artifactId>
<version>${automation.framework.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_core</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.admin.client</artifactId>
<version>${automation.framework.utils.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.extensions</artifactId>
<version>${automation.framework.utils.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.utils</artifactId>
<version>${automation.framework.utils.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.tests</artifactId>
<version>${automation.framework.utils.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.mediation</groupId>
<artifactId>org.wso2.carbon.connector.core</artifactId>
<version>${carbon.mediation.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.mediation</groupId>
<artifactId>org.wso2.carbon.mediation.library.stub</artifactId>
<version>${carbon.mediation.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<version>${carbon.kernel.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.test.utils</artifactId>
<version>${automation.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${org.testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.esb.integration</groupId>
<artifactId>integration-base</artifactId>
<version>1.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
<artifactId>org.wso2.ei.samples</artifactId>
<version>${product.ei.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
<artifactId>org.wso2.carbon.integrator.core</artifactId>
<version>${product.ei.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
<artifactId>integration-test-utils</artifactId>
<version>${product.ei.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
<artifactId>automation-extensions</artifactId>
<version>${product.ei.version}</version>
</dependency>

</dependencies>
<scm>
<connection>scm:git:https://github.com/wso2-extensions/esb-connector-iso8583.git</connection>
Expand All @@ -67,14 +189,89 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<version>3.7.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>email-library</id>
<phase>compile</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<finalName>${connector.name}-connector-${version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/assembly/filter.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/assemble-connector.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<inherited>false</inherited>
<configuration>
<skipTests>${skip-tests}</skipTests>
<argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=128m</argLine>
<disableXmlReport>false</disableXmlReport>
<parallel>false</parallel>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<systemProperties>
<property>
<name>framework.resource.location</name>
<value>
${basedir}/src/test/resources/
</value>
</property>
<property>
<name>server.list</name>
<value>
ESB
</value>
</property>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<sec.verifier.dir>${basedir}/target/security-verifier/</sec.verifier.dir>
<maven.test.haltafterfailure>false</maven.test.haltafterfailure>
<carbon.zip>
${basedir}/repository/wso2ei-${product.ei.version}.zip
</carbon.zip>
<instr.file>${basedir}/src/test/resources/instrumentation.txt</instr.file>
<filters.file>${basedir}/src/test/resources/filters.txt</filters.file>
<property>
<name>connector_repo</name>
<value>${basedir}/target</value>
</property>
<property>
<name>connector_name</name>
<value>${connector.name}</value>
</property>
<property>
<name>connector_version</name>
<value>${project.version}</value>
</property>
</systemProperties>
<workingDirectory>${basedir}/target</workingDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
Expand All @@ -96,27 +293,30 @@
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>email-library</id>
<id>copy-emma-dependencies</id>
<phase>compile</phase>
<goals>
<goal>attached</goal>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<finalName>${connector.name}-connector-${version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/assembly/filter.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/assemble-connector.xml</descriptor>
</descriptors>
<outputDirectory>${project.build.directory}/emma</outputDirectory>
<includeTypes>jar</includeTypes>
<includeArtifactIds>emma,
</includeArtifactIds>
</configuration>
</execution>
<execution>
<id>copy-secVerifier</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/security-verifier</outputDirectory>
<includeTypes>aar</includeTypes>
<includeArtifactIds>SecVerifier</includeArtifactIds>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
Expand All @@ -134,39 +334,12 @@
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
<repository>
<id>wso2.releases</id>
<name>WSO2 internal Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
<repository>
<id>wso2.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>WSO2 Release Distribution Repository</name>
<url>http://maven.wso2.org/nexus/service/local/staging/deploy/maven2/</url>
<id>wso2-maven2-repository</id>
<name>WSO2 Maven2 Repository</name>
<url>scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/</url>
</repository>
<snapshotRepository>
<id>wso2.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
Empty file added repository/copy of ESB here.txt
Empty file.
2 changes: 2 additions & 0 deletions repository/esb-connector-iso8583.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
serverHost=localhost
serverPort=5010
50 changes: 50 additions & 0 deletions src/test/INTEGRATION-TEST.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Product: Integration tests for WSO2 ESB ISO8583 connector

Pre-requisites:

- Maven 3.x
- Java 1.8

Tested Platform:

- Ubuntu 14.04
- WSO2 EI 6.4.0
- Java 1.8

Steps to follow in setting integration test.

1. Download EI 6.4.0 from the official website

2. Download the jpos-1.9.4.jar from the http://mvnrepository.com/artifact/org.jpos/jpos/1.9.4 ,
download jdom-1.1.3.jar from http://mvnrepository.com/artifact/org.jdom/jdom/1.1.3 and
download commons-cli-1.3.1.jar from http://mvnrepository.com/artifact/commons-cli/commons-cli/1.3 and then copy the
jars to the <ESB_HOME>/repository/components/lib or <EI_HOME>/lib directory.

3. Compress modified EI as wso2ei-6.4.0.zip and copy that zip file in to location "{ISO8583_CONNECTOR_HOME}/repository/".

4. Obtain the Sample test server from https://github.com/wso2-docs/CONNECTORS/tree/master/ISO8583/ISO8583TestServer.

Clone the JavaTestServer from above link and to run the test server follow the below instructions:

1. Add following jars as an external jars in java build path.
jpos-1.9.0.jar
log4j-1.2.17.jar
commons-cli-1.3.1.jar
jdom-1.1.3.jar
org.osgi.core-4.3.0.jar

2. Update the relative path in log4j.properties for the property "log4j.appender.R.File".

3. Run the main class (mockServer.java)

5. Update the iso8583 (esb-connector-iso8583.properties) properties file at location "{ISO8583_HOME}/repository/" as below.

i) serverHost - Here the host is localhost
ii) serverPort - Here the port is 5010 , The above JavaTestserver will start to listen on that port.

Note : If you wanted to change the above host and port , then you should change the relevant properties in
JavaTestServer as well.

6. Navigate to "<ISO8583_HOME>/" and run the following command.

$ mvn clean install -Dskip-tests=false
Loading