Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 18416b87f1
181 lines (147 sloc) 6.443 kB
<project name="Resolver" default="dist" >
<property file="build.properties" />
<tstamp prefix="copyright">
<format pattern="yyyy" property="YEAR"/>
</tstamp>
<property name="groupid" value="net.tuis" />
<property name="name" value="resolver" />
<property name="Name" value="Resolver" />
<property name="version" value="0.0.0" />
<property name="year" value="${copyright.YEAR}" />
<property name="junit.jar" value="lib/junit-4.8.2.jar" />
<property name="dist" value="dist" />
<property name="classes" value="${dist}/classes" />
<property name="tests" value="${dist}/tests" />
<property name="jars" value="${dist}/jars" />
<property name="apidocs" value="${dist}/apidocs" />
<property name="coverage" value="${dist}/coverage" />
<property name="test.xml" value="${dist}/test.xml" />
<property name="test.report" value="${dist}/test.report" />
<property name="test.logs" value="${dist}/test.logs" />
<property name="jar.release" value="${jars}/${name}-${version}.jar" />
<property name="jar.source" value="${jars}/${name}-source-${version}.jar" />
<property name="jar.apidoc" value="${jars}/${name}-apidocs-${version}.jar" />
<target name="clean.check">
<available property="wasdist" file="${dist}"/>
</target>
<target name="clean.dist" if="wasdist">
<delete dir="${dist}" failonerror="true" />
</target>
<target name="clean" depends="clean.check, clean.dist"/>
<target name="init">
<mkdir dir="${dist}" />
<mkdir dir="${classes}" />
<mkdir dir="${tests}" />
<mkdir dir="${jars}" />
<mkdir dir="${apidocs}" />
<mkdir dir="${coverage}" />
<mkdir dir="${test.xml}" />
<mkdir dir="${test.report}" />
<mkdir dir="${test.logs}" />
<echo>${Name} ${version} : ${year} - ${copyright.TODAY}</echo>
</target>
<target name="compile" depends="init">
<javac destdir="${classes}" srcdir="src/main" debug="true" optimize="true" includeantruntime="true" />
<jar destfile="${jar.release}">
<fileset dir="${classes}" includes="**" />
<fileset dir="${basedir}" includes="LICENSE, NOTICE" />
<fileset dir="src/main" includes="**/Base64*" />
</jar>
</target>
<target name="test" depends="compile" >
<property name="jettyver" value="8.1.2.v20120308" />
<path id="unit.test.classpath">
<pathelement location="${classes}" />
<pathelement location="src/test" />
<pathelement location="${tests}" />
<pathelement location="${junit.jar}"/>
<pathelement location="lib/jetty/jetty-continuation-${jettyver}.jar" />
<pathelement location="lib/jetty/jetty-http-${jettyver}.jar" />
<pathelement location="lib/jetty/jetty-io-${jettyver}.jar" />
<pathelement location="lib/jetty/jetty-server-${jettyver}.jar" />
<pathelement location="lib/jetty/jetty-util-${jettyver}.jar" />
<pathelement location="lib/jetty/servlet-api-3.0.jar" />
</path>
<javac destdir="${tests}" srcdir="src/test" debug="true" optimize="true"
classpathref="unit.test.classpath" includeantruntime="true"/>
<junit fork="true" forkmode="once" haltonerror="false" haltonfailure="false"
failureproperty="junit.failed" printsummary="true" timeout="100000"
showoutput="true" includeantruntime="true" >
<classpath refid="unit.test.classpath" />
<formatter type="xml"/>
<batchtest haltonerror="false" haltonfailure="false"
failureproperty="junit.failed" todir="${test.xml}" >
<sort>
<name />
<fileset dir="src/test">
<include name="**/Test*.java"/>
</fileset>
</sort>
</batchtest>
</junit>
<junitreport todir="${test.report}">
<fileset dir="${test.xml}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report}"/>
</junitreport>
<property name="port" value="54321" />
<property name="duration" value="35" />
<property name="cachedir" value="${dist}/testcache" />
<parallel failonany="true" >
<!-- Run the HTTP server in one JVM -->
<!--
If it fails it probably means that a single resource
was accessed mmultiple times concurrently.
-->
<java fork="true" failonerror="true" output="${test.logs}/httpserver.log"
classname="net.tuis.resolver.testconcurrent.ResolverTestHTTPServer"
classpathref="unit.test.classpath" args="${port} ${duration}"/>
<!--
cachedir - the Location for the cache data
name - the Name for this Engine
port - the port running the test HTTP server
threads - the number of concurrent threads trying to access the page
refresh - how long (secs) the page should remain unchanged on the server
delay - how long (secs) the server should take to serve the page
duration - how long (secs) the test should run
-->
<java fork="true" failonerror="true" output="${test.logs}/engine.jvm1.log"
classname="net.tuis.resolver.testconcurrent.Engine" classpathref="unit.test.classpath"
args= "${cachedir} JVM_1 ${port} 4 10 3 30"/>
<java fork="true" failonerror="true" output="${test.logs}/engine.jvm2.log"
classname="net.tuis.resolver.testconcurrent.Engine" classpathref="unit.test.classpath"
args= "${cachedir} JVM_2 ${port} 4 10 3 30"/>
<java fork="true" failonerror="true" output="${test.logs}/engine.jvm3.log"
classname="net.tuis.resolver.testconcurrent.Engine" classpathref="unit.test.classpath"
args= "${cachedir} JVM_3 ${port} 4 10 3 30"/>
</parallel>
</target>
<target name="apidoc">
<javadoc packagenames="net.tuis.resolver"
sourcepath="src/main"
destdir="${apidocs}"
author="true"
version="true"
use="true"
splitindex="true"
noindex="false"
windowtitle="${Name} v${version}"
doctitle="${Name} v${version}&lt;br&gt;API Specification"
header="&lt;b&gt;${Name}&lt;br&gt;&lt;font size='-1'&gt;${version}&lt;/font&gt;&lt;/b&gt;"
bottom="Copyright &#169; ${year} Rolf Lear.">
</javadoc>
</target>
<target name="dist" depends="test, apidoc">
<jar destfile="${jar.apidoc}">
<fileset dir="${apidocs}" includes="**" />
</jar>
<jar destfile="${jar.source}">
<fileset dir="src/main" includes="**" />
</jar>
<zip destfile="${dist}/${name}-${version}.zip">
<fileset dir="${jars}" includes="*.jar"/>
<fileset dir="${basedir}" includes="LICENSE, NOTICE" />
</zip>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.