Browse Source

use Touch#addConfigured(Mapper) rather than add(Mapper) as the mapper is

used in the method


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277213 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
fd1350c42a
3 changed files with 40 additions and 1 deletions
  1. +32
    -0
      src/etc/testcases/taskdefs/touch.xml
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Touch.java
  3. +7
    -0
      src/testcases/org/apache/tools/ant/taskdefs/TouchTest.java

+ 32
- 0
src/etc/testcases/taskdefs/touch.xml View File

@@ -83,6 +83,38 @@


</target> </target>


<target name="testExplicitMappedFileset">
<touch file="touchtest" millis="${mappermillis}" />
<touch>
<fileset file="touchtest" />
<mapper>
<compositemapper>
<globmapper from="*" to="*foo" />
<globmapper from="*" to="*bar" />
</compositemapper>
</mapper>
</touch>

<fail>
<condition>
<not>
<and>
<isfileselected file="touchtest">
<selector refid="map.selector" />
</isfileselected>
<isfileselected file="touchtestfoo">
<selector refid="map.selector" />
</isfileselected>
<isfileselected file="touchtestbar">
<selector refid="map.selector" />
</isfileselected>
</and>
</not>
</condition>
</fail>

</target>

<target name="testMappedFilelist"> <target name="testMappedFilelist">
<touch millis="${mappermillis}"> <touch millis="${mappermillis}">
<filelist dir="." files="idonotexist" /> <filelist dir="." files="idonotexist" />


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Touch.java View File

@@ -168,7 +168,7 @@ public class Touch extends Task {
* @param mapper the <code>Mapper</code> to add. * @param mapper the <code>Mapper</code> to add.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public void addMapper(Mapper mapper) {
public void addConfiguredMapper(Mapper mapper) {
add(mapper.getImplementation()); add(mapper.getImplementation());
} }




+ 7
- 0
src/testcases/org/apache/tools/ant/taskdefs/TouchTest.java View File

@@ -109,6 +109,13 @@ public class TouchTest extends BuildFileTest {
executeTarget("testMappedFileset"); executeTarget("testMappedFileset");
} }


/**
* test the explicit mapped file set
*/
public void testExplicitMappedFileset() {
executeTarget("testExplicitMappedFileset");
}

/** /**
* test the mapped file list * test the mapped file list
*/ */


Loading…
Cancel
Save