| 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
| 2 |
<!DOCTYPE project [ |
| 3 |
<!ENTITY properties SYSTEM "file:../../xmls/properties.xml"> |
| 4 |
<!ENTITY paths SYSTEM "file:../../xmls/path_refs.xml"> |
| 5 |
<!ENTITY taskdefs SYSTEM "file:../../xmls/taskdefs.xml"> |
| 6 |
<!ENTITY taskdefs_post_compile SYSTEM "file:../../xmls/taskdefs_post_compile.xml"> |
| 7 |
<!ENTITY targets SYSTEM "file:../../xmls/targets.xml"> |
| 8 |
]> |
| 9 |
|
| 10 |
<!-- =================================================================== |
| 11 |
<description> |
| 12 |
Test/Sample Component file for Axis |
| 13 |
|
| 14 |
Notes: |
| 15 |
This is a build file for use with the Jakarta Ant build tool. |
| 16 |
|
| 17 |
Prerequisites: |
| 18 |
|
| 19 |
jakarta-ant from http://jakarta.apache.org |
| 20 |
|
| 21 |
Build Instructions: |
| 22 |
To compile |
| 23 |
ant <target> |
| 24 |
To execute |
| 25 |
ant <target> |
| 26 |
|
| 27 |
Author: |
| 28 |
|
| 29 |
Copyright: |
| 30 |
Copyright (c) 2002-2003 Apache Software Foundation. |
| 31 |
</description> |
| 32 |
==================================================================== --> |
| 33 |
|
| 34 |
<project name="httpunit" default="default" basedir="."> |
| 35 |
<description> |
| 36 |
Test a Web application with HttpUnit. Based on example code in |
| 37 |
Java Development with Ant, Hatcher and Loughran, 2001. |
| 38 |
Customised for Axis by Steve Loughran. |
| 39 |
1. Needs XSLT support from Xalan to generate the reports. |
| 40 |
2. To run a single test, set testcase=the name of the test. |
| 41 |
3. default URL is http://localhost:8080/axis ; set the |
| 42 |
axis.url property to target a different system or port. |
| 43 |
</description> |
| 44 |
|
| 45 |
<!-- BEGIN TOPLEVEL DECLARATIONS --> |
| 46 |
|
| 47 |
<property name="axis.home" location="../.." /> |
| 48 |
<property name="componentName" value="test/httpunit" /> |
| 49 |
<property name="component.home" location="${axis.home}/${componentName}" /> |
| 50 |
|
| 51 |
<!-- Load the application specific settings --> |
| 52 |
<!-- #Project specific props --> |
| 53 |
<property file="build.properties"/> |
| 54 |
|
| 55 |
|
| 56 |
&properties; |
| 57 |
&paths; |
| 58 |
&taskdefs; |
| 59 |
&taskdefs_post_compile; |
| 60 |
&targets; |
| 61 |
|
| 62 |
|
| 63 |
<!-- ========================================================== --> |
| 64 |
<!-- Test settings --> |
| 65 |
<!-- ========================================================== --> |
| 66 |
|
| 67 |
|
| 68 |
<target name="copy"/> |
| 69 |
|
| 70 |
<target name="deploy"/> |
| 71 |
|
| 72 |
<target name="run" /> |
| 73 |
|
| 74 |
<target name="undeploy"/> |
| 75 |
|
| 76 |
|
| 77 |
<path id="test.compile.classpath"> |
| 78 |
<path refid="classpath"/> |
| 79 |
</path> |
| 80 |
|
| 81 |
<path id="test.classpath"> |
| 82 |
<path refid="test.compile.classpath"/> |
| 83 |
<pathelement location="${test.classes.dir}"/> |
| 84 |
</path> |
| 85 |
<!-- END TOPLEVEL DECLARATIONS --> |
| 86 |
|
| 87 |
<!-- Public Targets --> |
| 88 |
|
| 89 |
<target name="default" |
| 90 |
depends="compile" |
| 91 |
description="compile the tests" |
| 92 |
/> |
| 93 |
|
| 94 |
<!-- cleanup target --> |
| 95 |
<target name="clean" description="cleanup"/> |
| 96 |
|
| 97 |
<target name="all" depends="compile,test" |
| 98 |
description="compile and run the tests"/> |
| 99 |
|
| 100 |
<!-- init configures things --> |
| 101 |
<target name="init" depends="setenv"> |
| 102 |
<condition property="execute.httpunit"> |
| 103 |
<and> |
| 104 |
<isset property="httpunit.present"/> |
| 105 |
<istrue value="${httpunit.enabled}"/> |
| 106 |
</and> |
| 107 |
</condition> |
| 108 |
<echo> |
| 109 |
httpunit.present=${httpunit.present} |
| 110 |
httpunit.enabled = ${httpunit.enabled} |
| 111 |
execute.httpunit=${execute.httpunit} |
| 112 |
</echo> |
| 113 |
<mkdir dir="${test.classes.dir}" /> |
| 114 |
<mkdir dir="${test.data.dir}" /> |
| 115 |
</target> |
| 116 |
|
| 117 |
<!-- compile the java sources using the compilation classpath --> |
| 118 |
<target name="compile" depends="init" if="execute.httpunit"> |
| 119 |
<javac destdir="${test.classes.dir}" |
| 120 |
debug="${build.debug}" |
| 121 |
nowarn="${nowarn}" |
| 122 |
debuglevel="${debuglevel}" |
| 123 |
includeAntRuntime="false" |
| 124 |
fork="${javac.fork}" |
| 125 |
srcdir="${axis.home}"> |
| 126 |
<classpath refid="test.compile.classpath"/> |
| 127 |
<include name="${componentName}/*.java"/> |
| 128 |
<include name="test/AxisTestBase.java"/> |
| 129 |
</javac> |
| 130 |
</target> |
| 131 |
|
| 132 |
<!-- this is our test suite for httpunit --> |
| 133 |
|
| 134 |
<target name="run-test" |
| 135 |
depends="compile" |
| 136 |
if="execute.httpunit" |
| 137 |
description="test axis on a server" > |
| 138 |
<junit printsummary="false" |
| 139 |
errorProperty="test.failed" |
| 140 |
failureProperty="test.failed" |
| 141 |
haltonfailure="false" |
| 142 |
fork="true"> |
| 143 |
<classpath |
| 144 |
refid="test.classpath"/> |
| 145 |
<sysproperty key="test.functional.webapp.url" |
| 146 |
value="${test.functional.webapp.url}"/> |
| 147 |
<formatter type="xml"/> |
| 148 |
<formatter type="brief" usefile="false"/> |
| 149 |
<test name="${testcase}" if="testcase"/> |
| 150 |
<batchtest todir="${test.reports.dir}" unless="testcase"> |
| 151 |
<fileset dir="${build.dir}/classes" |
| 152 |
includes="test/httpunit/*Tests.class" |
| 153 |
excludesfile="${axis.home}/junit-exclude-tests.txt"/> |
| 154 |
</batchtest> |
| 155 |
</junit> |
| 156 |
</target> |
| 157 |
|
| 158 |
<!-- generate any test reports and fail, if needed --> |
| 159 |
<target name="test" depends="run-test" > |
| 160 |
<fail if="test.failed">Tests Failed</fail> |
| 161 |
</target> |
| 162 |
|
| 163 |
</project> |
| 164 |
|