Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 181 lines (147 sloc) 6.443 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
<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>
Something went wrong with that request. Please try again.