source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/src/etc/testcases/taskdefs/optional/replaceregexp.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.7 KB
Line 
1<project name="test" default="def" basedir=".">
2 <property name="tmpregexp" value="tmpregexp"/>
3 <target name="def">
4 <fail>This build file should only be run from within the testcase</fail>
5 </target>
6
7 <target name="setup">
8 <copy file="replaceregexp.properties" tofile="test.properties" />
9 </target>
10
11 <target name="setup-nl">
12 <copy file="replaceregexp2.properties" tofile="test.properties" />
13 </target>
14
15 <target name="testReplace" depends="setup">
16 <replaceregexp file="test.properties" byline="true">
17 <regexp pattern="Old(.*)=(.*)" />
18 <substitution expression="NewProp=\1\2" />
19 </replaceregexp>
20 </target>
21 <!-- use in conjunction with testDirectoryDateDoesNotChange to make sure something will happen -->
22 <target name="touchDirectory">
23 <mkdir dir="${tmpregexp}"/>
24 <copy file="replaceregexp.properties" tofile="${tmpregexp}/test.properties" />
25 <sleep seconds="2"/>
26 </target>
27 <target name="testDirectoryDateDoesNotChange">
28 <replaceregexp file="${tmpregexp}/test.properties" byline="true">
29 <regexp pattern="foo" />
30 <substitution expression="bar"/>
31 </replaceregexp>
32 </target>
33
34 <target name="testDontAddNewline1" depends="setup-nl">
35 <replaceregexp file="test.properties" byline="false">
36 <regexp pattern="Old(.*)=(.*)" />
37 <substitution expression="NewProp=\1\2" />
38 </replaceregexp>
39 </target>
40
41 <target name="testDontAddNewline2" depends="setup-nl">
42 <replaceregexp file="test.properties" byline="true">
43 <regexp pattern="Old(.*)=(.*)" />
44 <substitution expression="NewProp=\1\2" />
45 </replaceregexp>
46 </target>
47
48 <target name="cleanup">
49 <delete file="test.properties" />
50 <delete dir="${tmpregexp}" quiet="true"/>
51 </target>
52
53</project>
54
Note: See TracBrowser for help on using the repository browser.