Tuscany End User Sample Testing
Initial Setup
Most of the following only needs to be done once
unless noted otherwise.
- Be sure JAVA_HOME variable is pointing to a Java JDK directory.
- Follow the steps to build Tuscany DAS Companyweb sample application from DAS Java Developer Guide.
- Change directory
to java/das/samples/testing/tomcat.
- Download
Tomcat Core 6.0.xx zip
for Windows or tar.gz for Linux from Apache
Tomcat.
- You can place the tomcat distribution in your java/samples/das/testing/tomcat directory or, alternatively, you can create/edit {user home}/build.properties to
change the property tuscany.acceptance.tomcat.zipped to tell the build
environment where the tomcat distribution zip file is located.
- You may have to edit build.xml to change the property tuscany.acceptance.tomcat.version
to match the xx
to the specific version that you downloaded.
Running
In
the java/das/samples/testing/tomcat
directory run maven:
mvn
Explanation
Maven does
the following:
- Unpacks the
Tomcat distribution into the target directory to ensure a pristine
environment.
- It adds the appropriate Tuscany and it
dependencies jars into Tomcat (for more details)
- Does
the necessary changes
to Tomcat's configuration as required. (for more details)
- Deploys
Tuscany's DAS sample war files into Tomcat.
- Starts
Tomcat (You should see another window running Tomcat)
- Begins
running HTML unit tests that should closely match running the samples
as a user would.
If all goes well at the end you
should see:
[INFO] ----------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ----------------------------------------------------------------------------
[INFO] Tuscany Testing in Tomcat .............................. SUCCESS [0.961s]
[INFO] Tuscany Testing Tomcat DAS Sample - Companyweb ......... SUCCESS [1:09.771s]
[INFO] Tuscany Testing Ajax DAS Web Sample .................... SUCCESS [47.458s]
[INFO] ----------------------------------------------------------------------------
[INFO] ----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ----------------------------------------------------------------------------
[INFO] Total time: 1 minute 59 seconds
[INFO] Finished at: Sun Jun 10 01:23:19 VET 2007
[INFO] Final Memory: 9M/17M
[INFO] ----------------------------------------------------------------------------
Cleanup
Close
the Tomcat window and issue mvn clean
.Note
Because the html unit tests execute multiple user actions that change the contents of the database tables, is recommended
that you always run these tests in a clean environment (after a mvn clean),
otherwise you may experience failure on some tests as the expected result data might have been affected by previous test runs.