Browse Source

example for implementing PR 18656

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@799302 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
a123ff4d3e
1 changed files with 28 additions and 0 deletions
  1. +28
    -0
      src/tests/antunit/taskdefs/move-test.xml

+ 28
- 0
src/tests/antunit/taskdefs/move-test.xml View File

@@ -31,4 +31,32 @@
<au:assertPropertySet name="myproperty" message="abc was not renamed aBc"/> <au:assertPropertySet name="myproperty" message="abc was not renamed aBc"/>
</target> </target>


<target name="test-regex-mapper"
description="https://issues.apache.org/bugzilla/show_bug.cgi?id=18656">
<mkdir dir="${input}/AAA/foo"/>
<touch file="${input}/AAA/foo/bar.txt"/>
<mkdir dir="${input}/foo/AAA"/>
<touch file="${input}/foo/bar.txt"/>
<touch file="${input}/foo/AAA/bar.txt"/>
<mkdir dir="${input}/foo/bar"/>
<touch file="${input}/foo/bar/AAA.txt"/>
<touch file="${input}/foo/bar/baz.txt"/>

<mkdir dir="${output}"/>

<move todir="${output}">
<fileset dir="${input}"/>
<firstmatchmapper>
<regexpmapper from="(.*)AAA(.*)" to="\1BBB\2"/>
<identitymapper/>
</firstmatchmapper>
</move>

<au:assertFileExists file="${output}/BBB/foo/bar.txt"/>
<au:assertFileExists file="${output}/foo/bar.txt"/>
<au:assertFileExists file="${output}/foo/BBB/bar.txt"/>
<au:assertFileExists file="${output}/foo/bar/BBB.txt"/>
<au:assertFileExists file="${output}/foo/bar/baz.txt"/>
</target>

</project> </project>

Loading…
Cancel
Save