Skip to content

Instantly share code, notes, and snippets.

@d1rtym0nk3y
Created October 16, 2013 10:14
Show Gist options
  • Save d1rtym0nk3y/7005600 to your computer and use it in GitHub Desktop.
Save d1rtym0nk3y/7005600 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="magepye" basedir="." default="main">
<property file="tests/properties/${BUILD_HOST}.properties" />
<property file="tests/properties/default.properties" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${test.mxunitdir}/ant/lib/mxunit-ant.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="tests/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<target name="init">
<property name="BUILD_HOST" value="local" />
<echo message="BUILD_HOST is ${BUILD_HOST}" />
<echo message="Attempting to include properties/${BUILD_HOST}.properties for any property overrides. Then including properties/default.properties for default props"/>
<echoproperties prefix="test" />
<tstamp />
<delete dir="${test.outputdir}" />
<mkdir dir="${test.xmldir}" />
<mkdir dir="${test.htmldir}" />
<mkdir dir="${test.logdir}" />
</target>
<target name="main" depends="init,start-server">
<antcall target="runtests" />
<antcall target="junitreport" />
</target>
<target name="runtests">
<mxunittask server="${test.server.host}" port="${test.server.port}" outputdir="${test.xmldir}" verbose="true">
<directory runner="/tests/HttpAntRunner.cfc" path="${test.dir}" recurse="true" componentPath="${test.cfcpath}" />
</mxunittask>
</target>
<target name="junitreport">
<echo message="publishing test results to ${test.htmldir}"/>
<junitreport todir="${test.htmldir}">
<fileset dir="${test.xmldir}">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${test.htmldir}" styledir="${test.mxunitdir}/ant/xsl"/>
</junitreport>
</target>
<target name="start-server">
<echo message="Starting Winstone server...." />
<echo message="Output sent to ${test.logdir}/winstone.out" />
<parallel>
<daemons>
<exec executable="java" output="${test.logdir}/winstone.out">
<arg line="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xms512m -Xmx4096m -Xss8m -XX:MaxPermSize=128m -XX:+UseCompressedOops -XX:+UseG1GC -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -javaagent:app/lib/newrelic/newrelic.jar -Dnewrelic.environment=development -javaagent:webroot/WEB-INF/lib/railo-inst-1.2.jar -jar webroot/WEB-INF/lib/winstone-0.9.10.jar --ajp13Port=-1 --httpPort=${test.server.port} --directoryListings=false --simulateModUniqueId=true --webroot=webroot" />
</exec>
</daemons>
</parallel>
<echo message="Waiting ${test.server.timeout}s for Winstone to reply on http://${test.server.host}:${test.server.port}" />
<waitfor maxwait="${test.server.timeout}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="failed">
<http url="http://${test.server.host}:${test.server.port}"/>
</waitfor>
<fail if="failed" message="Winstone didn't start in ${test.server.timeout}s, check ${test.logdir}/winstone.out for details" />
<echo message="Done" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment