| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="test-package"> |
| |
| <property name="test.staging.dir" value="${target.dir}/test-expanded"/> |
| <property name="test.package.dir" value="${test.staging.dir}/${package.basename}"/> |
| <property name="pickup.dir" value="${test.package.dir}/pickup"/> |
| |
| <target name="test-package" |
| description="Runs a test on the packaged build"> |
| <antcall target="unzip.package"/> |
| <antcall target="startup.pre"/> |
| <antcall target="startup"/> |
| <antcall target="startup.post"/> |
| <antcall target="test.do"/> |
| <antcall target="shutdown.pre"/> |
| <antcall target="shutdown"/> |
| <antcall target="shutdown.post"/> |
| </target> |
| |
| <target name="unzip.package"> |
| <delete dir="${test.staging.dir}" quiet="true"/> |
| <mkdir dir="${test.staging.dir}"/> |
| <unzip src="${package.output.file}" dest="${test.staging.dir}"/> |
| <chmod perm="755"> |
| <fileset dir="${test.package.dir}/bin"> |
| <include name="*.sh"/> |
| </fileset> |
| </chmod> |
| <chmod perm="600"> |
| <fileset dir="${test.package.dir}/config"> |
| <include name="org.eclipse.virgo.kernel.jmxremote.access.properties"/> |
| </fileset> |
| </chmod> |
| </target> |
| |
| <target name="startup.pre"/> |
| |
| <target name="startup" depends="shutdown"> |
| <echo message="Starting Up Virgo Server" /> |
| |
| <exec dir="${test.package.dir}" osfamily="unix" spawn="true" executable="bin/startup.sh"/> |
| |
| <exec dir="${test.package.dir}" osfamily="windows" spawn="true" executable="cmd"> |
| <arg line="/c bin\startup.bat" /> |
| </exec> |
| |
| <waitfor maxwait="5" maxwaitunit="minute" timeoutproperty="start.failed"> |
| <http url="http://localhost:8080/"/> |
| </waitfor> |
| <fail if="start.failed" message="Virgo Server start up failed"/> |
| </target> |
| |
| <target name="startup.clean" depends="shutdown"> |
| <echo message="Clean Starting of Virgo Server" /> |
| |
| <exec dir="${test.package.dir}" osfamily="unix" spawn="true" executable="bin/startup.sh"> |
| <arg line="-clean" /> |
| </exec> |
| |
| <exec dir="${test.package.dir}" osfamily="windows" spawn="true" executable="cmd"> |
| <arg line="/c bin\startup.bat" /> |
| <arg line="-clean" /> |
| </exec> |
| |
| <waitfor maxwait="5" maxwaitunit="minute" timeoutproperty="start.failed"> |
| <http url="http://localhost:8080/"/> |
| </waitfor> |
| <fail if="start.failed" message="Virgo Server clean start up failed"/> |
| </target> |
| |
| <target name="startup.post"/> |
| |
| <target name="shutdown.pre"/> |
| |
| <target name="shutdown"> |
| <echo message="Shutting Down Virgo Server" /> |
| |
| <exec dir="${test.package.dir}" osfamily="unix" spawn="true" executable="bin/shutdown.sh"/> |
| <exec dir="${test.package.dir}" osfamily="windows" spawn="true" executable="cmd"> |
| <arg line="/c bin\shutdown.bat" /> |
| </exec> |
| |
| <waitfor maxwait="5" maxwaitunit="minute" timeoutproperty="shutdown.failed"> |
| <not> |
| <http url="http://localhost:8080/"/> |
| </not> |
| </waitfor> |
| <fail if="shutdown.failed" message="Virgo Server shutdown failed"/> |
| </target> |
| |
| <target name="shutdown.post"/> |
| |
| </project> |