diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-integration/testing/sca/itest/IntegrationTestHelp.html')
-rw-r--r-- | sca-java-1.x/branches/sca-java-integration/testing/sca/itest/IntegrationTestHelp.html | 1293 |
1 files changed, 1293 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/IntegrationTestHelp.html b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/IntegrationTestHelp.html new file mode 100644 index 0000000000..66f84f52c3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/IntegrationTestHelp.html @@ -0,0 +1,1293 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + + <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> + + <meta content="text/css" http-equiv="Content-Style-Type"> + + <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> + + <style media="all" type="text/css"> +@import url("../../../javadoc/css/maven-base.css"); +@import url("../../../javadoc/css/maven-theme.css"); +@import url("../../../javadoc/css/site.css"); + </style> + <link href="../../../javadoc/css/print.css" media="print" rel="stylesheet" type="text/css"> + <title>IntegrationTestFramework - Getting Started</title> + + +</head> + + +<body> + +<div id="bodyColumn"> +<div id="contentBox"> +<div class="section"> +<h2>Itegration Test Framework - Getting started</h2> + +<p>This page will describe what is the integration test framework +and how it can be used to write test cases.</p> + +<p>The Integration Test Framework gives the ability for users to +write +Function Verification Test Cases, which can then be run on a fully +integrated tuscany runtime. Some of the features of the Itest plugin +are auto start and stop of the tuscany runtime, and running the test +cases within the runtime. </p> + +</div> + +<div class="section"> +<h2>Writing Test Cases to run on Tuscany StandAlone</h2> + +You could have a simple test +case as is the example with the propertyTest. Here the application is +simply a jar file that would run on standalone tuscany runtime. In the +pom.xml file, you can specify the following:<br> + +<br> + +</div> + +<a name="setup JDK 5.0"></a> +<div class="section"> +<h2><font><font size="-1"><plugin><br> + + +<groupId>org.apache.tuscany.sca.plugins</groupId><br> + + +<artifactId>tuscany-itest-plugin</artifactId><br> + + +<executions><br> + +<span style="color: rgb(255, 0, 0);"> <span style="color: rgb(255, 255, 0);"> +<span style="color: rgb(255, 0, 0);"><execution></span></span></span><br style="color: rgb(255, 0, 0);"> + +<span style="color: rgb(255, 0, 0);"> +<id>start</id></span><br style="color: rgb(255, 0, 0);"> + +<span style="color: rgb(255, 0, 0);"> +<goals></span><br style="color: rgb(255, 0, 0);"> + +<span style="color: rgb(255, 0, 0);"> +<goal>start</goal></span><br style="color: rgb(255, 0, 0);"> + +<span style="color: rgb(255, 0, 0);"> +</goals></span><br style="color: rgb(255, 0, 0);"> + +<span style="color: rgb(255, 0, 0);"> +</execution></span><br> + + +<span style="color: rgb(0, 128, 0);"><execution></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<id>test</id></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<goals></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<goal>test</goal></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +</goals></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<configuration></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<includes></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +<include>**/*ITest.java</include></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +</includes></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +</configuration></span><br style="color: rgb(0, 128, 0);"> + +<span style="color: rgb(0, 128, 0);"> +</execution></span><br> + + <span style="color: rgb(0, 0, 255);"> +<execution></span><br style="color: rgb(0, 0, 255);"> + +<span style="color: rgb(0, 0, 255);"> +<id>stop</id></span><br style="color: rgb(0, 0, 255);"> + +<span style="color: rgb(0, 0, 255);"> +<goals></span><br style="color: rgb(0, 0, 255);"> + +<span style="color: rgb(0, 0, 255);"> +<goal>stop</goal></span><br style="color: rgb(0, 0, 255);"> + +<span style="color: rgb(0, 0, 255);"> +</goals></span><br style="color: rgb(0, 0, 255);"> + +<span style="color: rgb(0, 0, 255);"> +</execution></span><br> + + +</executions><br> + + </plugin></font></font></h2> + +<br> + +In the above, the code marked in red starts up the tuscany runtime.<br> + +<br> + +And similarly, the code marked in blue stops the tuscany +runtime after the tests are run<br> + +<br> + +The code marked in green runs the actual test cases. Notice that it +does have an <include> filter, to indicate which of the +tests you +want to include. Similarly you can have an <exclude> +filter.<br> + +<br> + +Also, you should have the following code in order to not run these +testcases as part of the regular unit tests in case you have other unit +testcases.<br> + +</div> + +<div class="section"> <a name="Starting the Server"></a> +<h2><font><font size="-1"> + +<plugin><br> + + +<groupId>org.apache.maven.plugins</groupId><br> + + +<artifactId>maven-surefire-plugin</artifactId><br> + + +<configuration><br> + + +<excludes><br> + +<exclude>**/*ITest.java</exclude><br> + + +</excludes><br> + + +</configuration><br> + + +</plugin></font></font></h2> + +To see the code for the test case, please check the propertyTest module.</div> + +<div class="section"> +<h2>Writing Test Cases to test on Apache Tomcat</h2> + +<br> + +You may have your testSuite containing webApps that need to be +deployed on tomcat (For example if you have testcases to test +single or multiple composites). In such a case, you would need to use +the "Maven Cargo Plugin". More information on the plugin itself can be +found here: <a href="http://cargo.codehaus.org/Maven2+plugin">Maven +Cargo Plugin.</a><br> + +<br> + +This plugin can be used to automatically deploy your webApp on a tomcat +server, start the server, run the testcases and stop the server. The +following code illustrates this process.<br> + +<br> + +The Maven Cargo plugin is defined as such in the pom.xml file:<br> + +<br> + +<h2><font><font><font><font><font><font><font><font size="-1"><plugin><br> + + +<groupId>org.codehaus.cargo</groupId><br> + + +<artifactId>cargo-maven2-plugin</artifactId><br> + +</plugin></font></font></font></font></font></font></font></font></h2> + +The following code illustrated starting and stopping the container from +within the cargo plugin. The container is started in a +"pre-integration-test" phase. This ensures that the container is +started well before the actual tests are run which is desired. Also, +the container is stopped in a "post-integration-test" phase, which +ensures that the container is stopped well after the test cases are run.<br> + +<h2><font><font><font><font size="-1"> + + <executions><br> + + +<execution><br> + +<id>start-container</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>start</goal><br> + +</goals><br> + + +</execution><br> + + +<execution><br> + +<id>stop-container</id><br> + +<phase>post-integration-test</phase><br> + +<goals><br> + +<goal>stop</goal><br> + +</goals><br> + + +</execution><br> + + +</executions></font></font></font></font></h2> + +The following code specifies the configuration for the container. +Firstly the configuration of the container itself is specified, by +specifying the container ID and home, which in this case is wherever +tomcat is installed. Next, the configuration to be used within the +container is specified. This would include the home for the container, +which is where all the container (tomcat) core files are copied and +used for the testcases. Also specified, are the webApps which need to +be deployed on the container during this run.<br> + +<br> + +<h2><font><font><font><font><font><font><font><font size="-1"> +<configuration><br> + + +<wait>false</wait><br> + +<br> + + +<!-- Container configuration --><br> + + +<container><br> + +<containerId>tomcat5x</containerId><br> + +<home>${tomcat.dir}</home><br> + + +</container><br> + +<br> + + +<!-- Configuration to use with the container --><br> + + +<configuration><br> + +<home>${project.build.directory}/tomcat5x</home><br> + + + + + + <deployables><br> + + + + + + +<deployable><br> + + + + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + + + + +<artifactId>bindingscomposite</artifactId><br> + + + + + + +<type>war</type><br> + + + + + + +<properties><br> + + + + + + +<context>/testtool</context><br> + + + + + + +</properties><br> + + + + + + +<pingURL>http://localhost:8080/testtool/services</pingURL><br> + + + + + + +</deployable><br> + + + + + + +<deployable><br> + + + + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + + + + +<artifactId>bindingsutility</artifactId><br> + + + + + + +<type>war</type><br> + + + + + + +<properties><br> + + + + + + +<context>/testutil</context><br> + + + + + + +</properties><br> + + + + + + +<pingURL>http://localhost:8080/testutil/services</pingURL><br> + + + + + + +</deployable><br> + + + + + + </deployables><br> + + +</configuration><br> + +<br> + + +</configuration><br> + +</font></font></font></font></font></font></font></font></h2> + +In the above code, for each webApp that is deployed, there is a +<context> property specified, which is the context under +which +the webApp is deployed.<br> + +<br> + +Now the final part of the code below which illustrates the running of +the testcases using the itest plugin:<br> + +<br> + +<h2><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font size="-1"> + <plugin><br> + + +<groupId>org.apache.tuscany.sca.plugins</groupId><br> + + +<artifactId>tuscany-itest-plugin</artifactId><br> + + +<executions><br> + + +<execution><br> + +<id>start</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>start</goal><br> + +</goals><br> + +<configuration><br> + +<applicationScdl><br> + +file:///C:/SDO2/Tuscany/java/testing/sca/itest/bindingsTest/bindingsclient/src/main/resources/META-INF/sca/default.scdl<br> + +</applicationScdl><br> + +<extensions><br> + +<dependency><br> + +<groupId>org.apache.tuscany.sca.services.databinding</groupId><br> + +<artifactId>databinding-sdo</artifactId><br> + +<version>1.0-incubator-SNAPSHOT</version><br> + +</dependency><br> + +<dependency><br> + +<groupId>org.apache.tuscany.sca.services.bindings</groupId><br> + +<artifactId>axis2</artifactId><br> + +<version>1.0-incubator-SNAPSHOT</version><br> + +</dependency><br> + +</extensions><br> + +</configuration><br> + + +</execution><br> + + +<execution><br> + +<id>test</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>test</goal><br> + +</goals><br> + +<configuration><br> + +<includes><br> + +<include>**/*ITest.java</include><br> + +</includes><br> + +</configuration><br> + + +</execution><br> + + +<execution><br> + +<id>stop</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>stop</goal><br> + +</goals><br> + + +</execution><br> + + +</executions><br> + + +</plugin><br> + +</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></h2> + +Notice in the above code, how the execution <start> and +<stop> phase for the testcases is defined as +"pre-integration-test". This is the same phase under which the +container was started. Hence this ensures that the testcases are run +after the container is started, and before it is stopped. In the above +example, we have two composites as webApps being deployed on tomcat. +Since we have multiple scdl files, with the same name, we need to +specify the application scdl file which can done using +<applicationScdl> property. Also, if the testcases +require some +extensions, then they can also be specified as indicated above using +the <extensions> property.<br> + +<br> + +The final pom file for such a test case should be similar to the one +given below: +<h2><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font><font size="-1"> <project +xmlns="http://maven.apache.org/POM/4.0.0" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br> + + +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 +http://maven.apache.org/maven-v4_0_0.xsd"><br> + + +<modelVersion>4.0.0</modelVersion><br> + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + +<artifactId>bindingsclient</artifactId><br> + + +<packaging>jar</packaging><br> + + +<version>SNAPSHOT</version><br> + + <name>SCA FVT +Bindings Test Tool JSP Client</name><br> + +<br> + + +<properties><br> + + +<tomcat.dir>C:/Apache/Tomcat +5.5</tomcat.dir><br> + + +</properties><br> + +<br> + + <dependencies><br> + + + <dependency><br> + + + + +<groupId>junit</groupId><br> + + + + +<artifactId>junit</artifactId><br> + + + + +<version>3.8.1</version><br> + + + + +<scope>test</scope><br> + + + </dependency><br> + + + <dependency><br> + + + + <groupId>org.osoa</groupId><br> + + + + <artifactId>sca-api-r0.95</artifactId><br> + + + + <version>1.0-incubator-SNAPSHOT</version><br> + + + + <scope>provided</scope><br> + + + </dependency><br> + + <br> + + + <dependency><br> + + + +<groupId>org.apache.tuscany.sca.services.bindings</groupId><br> + + + +<artifactId>axis2</artifactId><br> + + + +<version>1.0-incubator-SNAPSHOT</version><br> + + + </dependency><br> + + + <dependency><br> + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + +<artifactId>bindingscomposite</artifactId><br> + + + +<version>SNAPSHOT</version><br> + + + +<type>war</type><br> + + + +<scope>provided</scope><br> + + + </dependency> <br> + + + <dependency><br> + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + +<artifactId>bindingsutility</artifactId><br> + + + +<version>SNAPSHOT</version><br> + + + +<type>war</type><br> + + + +<scope>provided</scope><br> + + + </dependency> <br> + + + <dependency><br> + + + + +<groupId>org.apache.tuscany.sca</groupId><br> + + + +<artifactId>test</artifactId><br> + + + + +<version>1.0-incubator-SNAPSHOT</version><br> + + + </dependency><br> + + <br> + + <br> + + </dependencies><br> + +<br> + +<br> + +<br> + + <br> + + <build><br> + + +<defaultGoal>install</defaultGoal><br> + + <plugins><br> + + + +<plugin><br> + + + +<groupId>org.apache.maven.plugins</groupId><br> + + + +<artifactId>maven-compiler-plugin</artifactId><br> + + + +<configuration><br> + + + +<source>1.5</source><br> + + + +<target>1.5</target><br> + + + +<showDeprecation>true</showDeprecation><br> + + + +<compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument><br> + + + +</configuration><br> + + + +</plugin><br> + + + +<plugin><br> + + +<groupId>org.codehaus.cargo</groupId><br> + + +<artifactId>cargo-maven2-plugin</artifactId><br> + + +<executions><br> + + +<execution><br> + +<id>start-container</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>start</goal><br> + +</goals><br> + + +</execution><br> + + +<execution><br> + +<id>stop-container</id><br> + +<phase>post-integration-test</phase><br> + +<goals><br> + +<goal>stop</goal><br> + +</goals><br> + + +</execution><br> + + +</executions><br> + +<br> + + +<configuration><br> + + +<wait>false</wait><br> + +<br> + + +<!-- Container configuration --><br> + + +<container><br> + +<containerId>tomcat5x</containerId><br> + +<home>${tomcat.dir}</home><br> + +<!-- <br> + +<zipUrlInstaller><br> + +<url>http://www.orionserver.com/distributions/orion2.0.5.zip</url><br> + +<installDir>${java.io.tmpdir}/cargoinstalls</installDir><br> + +</zipUrlInstaller><br> + +--><br> + +<br> + + +</container><br> + +<br> + + +<!-- Configuration to use with the container --><br> + + +<configuration><br> + +<home>${project.build.directory}/tomcat5x</home><br> + + + + + + <deployables><br> + + + + + + +<deployable><br> + + + + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + + + + +<artifactId>bindingscomposite</artifactId><br> + + + + + + +<type>war</type><br> + + + + + + +<properties><br> + + + + + + +<context>/testtool</context><br> + + + + + + +</properties><br> + + + + + + +<pingURL>http://localhost:8080/testtool/services</pingURL><br> + + + + + + +</deployable><br> + + + + + + +<deployable><br> + + + + + + +<groupId>org.apache.tuscany.testing.bindingstest</groupId><br> + + + + + + +<artifactId>bindingsutility</artifactId><br> + + + + + + +<type>war</type><br> + + + + + + +<properties><br> + + + + + + +<context>/testutil</context><br> + + + + + + +</properties><br> + + + + + + +<pingURL>http://localhost:8080/testutil/services</pingURL><br> + + + + + + +</deployable><br> + + + + + + </deployables><br> + + +</configuration><br> + +<br> + + +</configuration><br> + + +</plugin> + <br> + + +<plugin><br> + + +<groupId>org.apache.tuscany.sca.plugins</groupId><br> + + +<artifactId>tuscany-itest-plugin</artifactId><br> + + +<executions><br> + + +<execution><br> + +<id>start</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>start</goal><br> + +</goals><br> + +<configuration><br> + +<applicationScdl><br> + +file:///C:/SDO2/Tuscany/java/testing/sca/itest/bindingsTest/bindingsclient/src/main/resources/META-INF/sca/default.scdl<br> + +</applicationScdl><br> + +<extensions><br> + +<dependency><br> + +<groupId>org.apache.tuscany.sca.services.databinding</groupId><br> + +<artifactId>databinding-sdo</artifactId><br> + +<version>1.0-incubator-SNAPSHOT</version><br> + +</dependency><br> + +<dependency><br> + +<groupId>org.apache.tuscany.sca.services.bindings</groupId><br> + +<artifactId>axis2</artifactId><br> + +<version>1.0-incubator-SNAPSHOT</version><br> + +</dependency><br> + +</extensions><br> + +</configuration><br> + + +</execution><br> + + +<execution><br> + +<id>test</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>test</goal><br> + +</goals><br> + +<configuration><br> + +<includes><br> + +<include>**/*ITest.java</include><br> + +</includes><br> + +</configuration><br> + + +</execution><br> + + +<execution><br> + +<id>stop</id><br> + +<phase>pre-integration-test</phase><br> + +<goals><br> + +<goal>stop</goal><br> + +</goals><br> + + +</execution><br> + + +</executions><br> + + +</plugin><br> + + + <plugin><br> + + + + +<groupId>org.apache.maven.plugins</groupId><br> + + + + +<artifactId>maven-surefire-plugin</artifactId><br> + + + +<configuration><br> + + + + +<excludes><br> + + + + +<exclude>**/*ITest.java</exclude><br> + + + + +</excludes><br> + + + +</configuration><br> + + + </plugin><br> + + </plugins><br> + + </build><br> + + <br> + +</project></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></h2> + +</div> + +<div class="section"> +<h2>Getting Help</h2> + +<p>First place to look is at the Tuscany FAQ at <a href="http://incubator.apache.org/tuscany/faq.html" target="_blank">http://incubator.apache.org/tuscany/faq.html</a> +</p> + +<p>Any problem with this release can be reported to the Tuscany <a href="http://incubator.apache.org/tuscany/mail-lists.html" target="_blank">mailing lists</a> or create a JIRA +issue at <a href="http://issues.apache.org/jira/browse/Tuscany" target="_blank">http://issues.apache.org/jira/browse/Tuscany</a>.</p> + +<p></p> + +<table class="bodyTable"> + + <tbody> + + <tr class="a"> + + <td> + <p>Thank you for your interest in Tuscany.</p> + + <strong><em>-The Tuscany Development Team</em></strong> + <p></p> + + </td> + + </tr> + + </tbody> +</table> + +<p></p> + +</div> + +</div> + +</div> + +</body> +</html> |