| Line 1... |
Line 1... |
| 1 |
<project name="ant-junitee">
|
1 |
<project name="ant-junitee">
|
| 2 |
|
2 |
|
| 3 |
<description>
|
3 |
<description>
|
| 4 |
Example usage:
|
4 |
Example usage:
|
| 5 |
<!--
|
5 |
<!--
|
| 6 |
<run-junitee-tests jar="${basedir}/build/jar/myejb.jar" appxml="${basedir}/src/etc/application.xml">
|
6 |
<run-junitee-tests jar="myejb.jar" appxml="${basedir}/src/etc/application.xml" testserver="mytestserver">
|
| 7 |
<junitee-war>
|
7 |
<junitee-war>
|
| 8 |
<classes dir="${basedir}/build/classes/test">
|
8 |
<classes dir="${basedir}/build/classes/test">
|
| 9 |
<include name="**/*Test.class"/>
|
9 |
<include name="**/*Test.class"/>
|
| 10 |
</classes>
|
10 |
</classes>
|
| 11 |
<testcases dir="${basedir}/build/classes/test">
|
11 |
<testcases dir="${basedir}/build/classes/test">
|
| Line 14... |
Line 14... |
| 14 |
</junitee-war>
|
14 |
</junitee-war>
|
| 15 |
</run-junitee-tests>
|
15 |
</run-junitee-tests>
|
| 16 |
-->
|
16 |
-->
|
| 17 |
|
17 |
|
| 18 |
</description>
|
18 |
</description>
|
| 19 |
|
19 |
|
| 20 |
<!-- Note: The following are from jakarta-cactus 13.1.7.cots. This section needs to
|
20 |
<!-- Note: The following are from jakarta-cactus 13.1.7.cots. This section needs to
|
| 21 |
be kept up to date with the associated version of jakarta-cactus -->
|
21 |
be kept up to date with the associated version of jakarta-cactus -->
|
| 22 |
<taskdef resource="cactus.tasks">
|
22 |
<taskdef resource="cactus.tasks">
|
| 23 |
<classpath>
|
23 |
<classpath>
|
| 24 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/cactus-1.7.jar"/>
|
24 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/cactus-1.7.jar"/>
|
| 25 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/cactus-ant-1.7.jar"/>
|
25 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/cactus-ant-1.7.jar"/>
|
| 26 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/commons-httpclient-2.0.2.jar"/>
|
26 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/commons-httpclient-2.0.2.jar"/>
|
| 27 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/commons-logging-1.0.4.jar"/>
|
27 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/commons-logging-1.0.4.jar"/>
|
| 28 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/aspectjrt-1.2.1.jar"/>
|
28 |
<pathelement location="${using.jakarta-cactus.basedir}/jar/aspectjrt-1.2.1.jar"/>
|
| 29 |
<pathelement location="${using.junit.basedir}/jar/junit.jar"/>
|
29 |
<pathelement location="${using.junit.basedir}/jar/junit.jar"/>
|
| 30 |
<pathelement location="${using.ant-junit.basedir}/jar/ant-junit.jar"/>
|
30 |
<pathelement location="${using.ant-junit.basedir}/jar/ant-junit.jar"/>
|
| 31 |
</classpath>
|
31 |
</classpath>
|
| 32 |
</taskdef>
|
32 |
</taskdef>
|
| 33 |
|
33 |
|
| 34 |
<taskdef name="junitee" classname="org.junitee.anttask.JUnitEETask">
|
34 |
<taskdef name="junitee" classname="org.junitee.anttask.JUnitEETask">
|
| 35 |
<classpath>
|
35 |
<classpath>
|
| 36 |
<pathelement location="${using.junitee.basedir}/jar/junitee-anttask.jar"/>
|
36 |
<pathelement location="${using.junitee.basedir}/jar/junitee-anttask.jar"/>
|
| 37 |
</classpath>
|
37 |
</classpath>
|
| 38 |
</taskdef>
|
38 |
</taskdef>
|
| Line 46... |
Line 46... |
| 46 |
<macrodef name="run-junitee-tests">
|
46 |
<macrodef name="run-junitee-tests">
|
| 47 |
|
47 |
|
| 48 |
<attribute name="jar" default="${ant.project.name}.jar"/>
|
48 |
<attribute name="jar" default="${ant.project.name}.jar"/>
|
| 49 |
<attribute name="war" default="unit-test.war"/>
|
49 |
<attribute name="war" default="unit-test.war"/>
|
| 50 |
<attribute name="appxml" default="${basedir}/src/etc/application.xml"/>
|
50 |
<attribute name="appxml" default="${basedir}/src/etc/application.xml"/>
|
| - |
|
51 |
<attribute name="testserver" default="${ant.project.name}"/>
|
| 51 |
<element name="junitee-war"/>
|
52 |
<element name="junitee-war"/>
|
| 52 |
<element name="dependencies" optional="true"/>
|
53 |
<element name="dependencies" optional="true"/>
|
| 53 |
|
54 |
|
| 54 |
<sequential>
|
55 |
<sequential>
|
| 55 |
|
56 |
|
| Line 81... |
Line 82... |
| 81 |
inheritAll = "false"
|
82 |
inheritAll = "false"
|
| 82 |
inheritRefs = "false">
|
83 |
inheritRefs = "false">
|
| 83 |
|
84 |
|
| 84 |
<reference refid = "using.junitee.path"/>
|
85 |
<reference refid = "using.junitee.path"/>
|
| 85 |
<reference refid = "using.jakarta-cactus.path"/>
|
86 |
<reference refid = "using.jakarta-cactus.path"/>
|
| 86 |
<property name = "using.junitee.basedir" value="${using.junitee.basedir}"/>
|
87 |
<property name = "using.junitee.basedir" value="${using.junitee.basedir}"/>
|
| 87 |
<property name = "test.project.name" value="${ant.project.name}"/>
|
88 |
<property name = "test.project.name" value="${ant.project.name}"/>
|
| - |
|
89 |
<property name = "test.server" value="@{testserver}"/>
|
| 88 |
<property name = "env" environment="env" value="env"/>
|
90 |
<property name = "env" environment="env" value="env"/>
|
| 89 |
|
91 |
|
| 90 |
</ant>
|
92 |
</ant>
|
| 91 |
|
93 |
|
| 92 |
</sequential>
|
94 |
</sequential>
|
| 93 |
</macrodef>
|
95 |
</macrodef>
|
| Line 104... |
Line 106... |
| 104 |
-->
|
106 |
-->
|
| 105 |
<target name="-junitee-deploy">
|
107 |
<target name="-junitee-deploy">
|
| 106 |
<echo message="DEPLOYING: ${deployment.filename}"/>
|
108 |
<echo message="DEPLOYING: ${deployment.filename}"/>
|
| 107 |
<echo message="DEPLOYING TO: ${deployment.location}"/>
|
109 |
<echo message="DEPLOYING TO: ${deployment.location}"/>
|
| 108 |
<copy file="${basedir}/build/jar/${test.project.name}-junitee.ear"
|
110 |
<copy file="${basedir}/build/jar/${test.project.name}-junitee.ear"
|
| 109 |
todir="${env.JBOSS_HOME}/server/${test.project.name}/deploy"/>
|
111 |
todir="${env.JBOSS_HOME}/server/${test.server}/deploy"/>
|
| 110 |
|
112 |
|
| 111 |
<java jar="${env.JBOSS_HOME}/bin/run.jar" fork="true" taskname="jboss">
|
113 |
<java jar="${env.JBOSS_HOME}/bin/run.jar" fork="true" taskname="jboss">
|
| 112 |
<arg value="-c" />
|
114 |
<arg value="-c" />
|
| 113 |
<arg value="${test.project.name}" />
|
115 |
<arg value="${test.server}" />
|
| 114 |
</java>
|
116 |
</java>
|
| 115 |
</target>
|
117 |
</target>
|
| 116 |
|
118 |
|
| 117 |
<!--
|
119 |
<!--
|
| 118 |
- Stop unit test deployment
|
120 |
- Stop unit test deployment
|
| 119 |
-->
|
121 |
-->
|
| 120 |
<target name="-junitee-undeploy">
|
122 |
<target name="-junitee-undeploy">
|
| 121 |
|
123 |
|
| 122 |
<echo message="Undeploying ${env.JBOSS_HOME}/server/${test.project.name}/deploy/${test.project.name}-junitee.ear"/>
|
124 |
<echo message="Undeploying ${env.JBOSS_HOME}/server/${test.server}/deploy/${test.project.name}-junitee.ear"/>
|
| 123 |
<delete file="${env.JBOSS_HOME}/server/${test.project.name}/deploy/${test.project.name}-junitee.ear"/>
|
125 |
<delete file="${env.JBOSS_HOME}/server/${test.server}/deploy/${test.project.name}-junitee.ear"/>
|
| 124 |
|
126 |
|
| 125 |
<!-- This doesn't quite work yet...
|
127 |
<!-- This doesn't quite work yet...
|
| 126 |
<java jar="${env.JBOSS_HOME}/bin/shutdown.jar" fork="true">
|
128 |
<java jar="${env.JBOSS_HOME}/bin/shutdown.jar" fork="true">
|
| 127 |
<arg value="-s localhost"/>
|
129 |
<arg value="-s localhost"/>
|
| 128 |
<classpath>
|
130 |
<classpath>
|