source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/src/etc/testcases/taskdefs/get.xml@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 1.9 KB
Line 
1<?xml version="1.0"?>
2
3<project name="xxx-test" basedir="." default="test1">
4
5 <target name="test1">
6 <get/>
7 </target>
8
9 <target name="test2">
10 <get src=""/>
11 </target>
12
13 <target name="test3">
14 <get src="" dest=""/>
15 </target>
16
17 <target name="test4">
18 <get src="" dest=""/>
19 </target>
20
21 <target name="test5">
22 <get src="http://www.apache.org/" dest=""/>
23 </target>
24
25 <target name="test6">
26 <get src="http://www.apache.org/" dest="get.tmp"/>
27
28 <fileset id="t6" file="get.tmp" />
29 <pathconvert property="t6" refid="t6" setonempty="false" />
30
31 <fail message="get failed">
32 <condition>
33 <not>
34 <isset property="t6" />
35 </not>
36 </condition>
37 </fail>
38 </target>
39
40 <target name="testUseTimestamp" depends="-90s,-timestamp" />
41
42 <target name="-90s">
43 <property name="off" value="-90" />
44 <property name="unit" value="second" />
45 </target>
46
47 <target name="testUseTomorrow" depends="+1d,-timestamp" />
48
49 <target name="+1d">
50 <property name="off" value="1" />
51 <property name="unit" value="day" />
52 </target>
53
54 <target name="-timestamp">
55 <property name="pat" value="yyyyMMddHHmm" />
56
57 <tstamp>
58 <format property="dt" pattern="${pat}" offset="${off}" unit="${unit}" />
59 </tstamp>
60
61 <touch file="get.tmp" datetime="${dt}" pattern="${pat}" />
62
63 <get src="http://www.apache.org/" dest="get.tmp"
64 usetimestamp="true" verbose="true" />
65
66 <fileset id="ts" file="get.tmp">
67 <date when="equal" datetime="${dt}" pattern="${pat}" />
68 </fileset>
69
70 <pathconvert property="ts" refid="ts" setonempty="false" />
71
72 <fail message="get w/ timestamp should have failed.">
73 <condition>
74 <not>
75 <isset property="ts" />
76 </not>
77 </condition>
78 </fail>
79 </target>
80
81 <target name="cleanup">
82 <delete>
83 <fileset dir="${basedir}" includes="get.tmp" />
84 </delete>
85 </target>
86
87</project>
Note: See TracBrowser for help on using the repository browser.