| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="smoke-test" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:s="antlib:org.springframework.build"> |
| |
| <property name="console.port" value="2401"/> |
| <property name="test.bundle" value="src/test/resources/test-bundle"/> |
| |
| <target name="smoke-test" description="Runs a smoke test on the OSGi Launcher"> |
| <antcall target="startup"/> |
| <antcall target="shutdown"/> |
| </target> |
| |
| <target name="startup"> |
| <ivy:cachepath resolveId="osgi.classpath" pathid="osgi.classpath" organisation="org.eclipse.virgo.mirrored" |
| module="org.eclipse.osgi" revision="${org.eclipse.osgi}" conf="runtime" type="jar" inline="true"/> |
| |
| <ivy:cachepath resolveId="parser.launcher.classpath" pathid="parser.launcher.classpath" organisation="org.eclipse.virgo.util" |
| module="org.eclipse.virgo.util.parser.launcher" revision="${org.eclipse.virgo.util}" conf="runtime" type="jar" inline="true"/> |
| |
| <echo message="Starting Up OSGi Launcher" /> |
| <java classname="org.eclipse.virgo.test.launcher.Launcher" fork="true" spawn="true"> |
| <arg value="-Fosgi.console=${console.port}"/> |
| <arg value="-Fosgi.console.enable.builtin=true"/> |
| |
| <arg value="-Fosgi.configuration.area=target"/> |
| <arg value="-B${test.bundle}"/> |
| <classpath> |
| <pathelement location="${jar.output.file}"/> |
| <path refid="osgi.classpath"/> |
| <path refid="parser.launcher.classpath"/> |
| </classpath> |
| </java> |
| |
| <waitfor maxwait="5" maxwaitunit="minute" timeoutproperty="start.failed"> |
| <socket server="localhost" port="${console.port}" /> |
| </waitfor> |
| <fail if="start.failed" message="OSGi Launcher start up failed"/> |
| </target> |
| |
| <target name="shutdown" depends="telnet.init"> |
| <echo message="Shutting down OSGi Launcher" /> |
| <s:telnet server="localhost" port="${console.port}" timeout="5"> |
| <write echo="false">exit</write> |
| </s:telnet> |
| </target> |
| |
| <target name="telnet.init" depends="ivy.init"> |
| <ivy:cachepath resolveId="spring.ant.classpath" pathid="spring.ant.classpath" |
| organisation="org.springframework.build" module="org.springframework.build.ant" |
| revision="${org.springframework.build.ant.version}" conf="runtime" type="jar" inline="true" |
| log="download-only"/> |
| <ivy:cachepath resolveId="common-net.classpath" pathid="common-net.classpath" organisation="org.apache.commons" |
| module="com.springsource.org.apache.commons.net" revision="${org.apache.commons}" |
| conf="runtime" type="jar" inline="true" log="download-only"/> |
| <taskdef resource="org/springframework/build/ant/antlib.xml" uri="antlib:org.springframework.build"> |
| <classpath> |
| <path refid="spring.ant.classpath"/> |
| <path refid="common-net.classpath"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| </project> |