blob: a0533f096822ebe64ebeaa7c269d57e5e881858b [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="antunit"
xmlns:au="antlib:org.apache.ant.antunit"
xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
xmlns:cmp="antlib:org.apache.ant.compress">
<import file="pack200-base.xml" />
<target name="testRealTest" depends="setUp">
<cmp:pack200 destfile="${output}/test.pack"
src="${input}/test.jar"/>
<au:assertLogContains text="Building: test.pack"/>
<au:assertFileExists file="${output}/test.pack"/>
</target>
<target name="testRealTestWithResource" depends="setUp">
<cmp:pack200 destfile="${output}/test.pack">
<file file="${input}/test.jar"/>
</cmp:pack200>
<au:assertLogContains text="Building: test.pack"/>
<au:assertFileExists file="${output}/test.pack"/>
</target>
<target name="testDateCheck" depends="setUp">
<sleep seconds="2"/>
<touch file="${input}/test.pack"/>
<cmp:pack200 destfile="${input}/test.pack"
src="${input}/test.jar"/>
<au:assertLogContains text="Nothing to do: test.pack is up to date."/>
</target>
<target name="testNestedTask" depends="setUp">
<cmp:pack200 destfile="${output}/test.pack">
<cmp:zip>
<cmp:cpiofileset src="../resources/asf-logo.gif.bin.cpio"
includes="asf-logo.gif"/>
</cmp:zip>
</cmp:pack200>
<au:assertFileExists file="${output}/test.pack"/>
<au:assertTrue>
<cond:islastmodified datetime="2009-07-31-20:11:14 +0200"
pattern="yyyy-MM-dd-HH:mm:ss Z">
<cmp:zipentry name="asf-logo.gif">
<cmp:pack200resource>
<file file="${output}/test.pack"/>
</cmp:pack200resource>
</cmp:zipentry>
</cond:islastmodified>
</au:assertTrue>
</target>
<target name="testTempFileStrategy" depends="setUp">
<cmp:pack200 src="${input}/test.jar"
destfile="${output}/test.pack"
pack200strategy="temp-file"/>
<au:assertLogContains text="Building: test.pack"/>
<au:assertFileExists file="${output}/test.pack"/>
</target>
<target name="testProperties" depends="setUp">
<cmp:pack200 src="${input}/test.jar"
destfile="${output}/test.pack">
<property key="pack.effort" value="9"/>
</cmp:pack200>
<au:assertLogContains text="Building: test.pack"/>
<au:assertFileExists file="${output}/test.pack"/>
</target>
<target name="testNestingOfPackTasks" depends="setUp">
<cmp:gzip destfile="${output}/test.pack.gz">
<cmp:pack200 src="../resources/asf-logo.gif.zip"/>
</cmp:gzip>
<au:assertLogContains text="Building: test.pack.gz"/>
<au:assertFileExists file="${output}/test.pack.gz"/>
</target>
</project>