Browse Source

(disabled) tests for PR 45944

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@702138 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
96b385b6c1
2 changed files with 65 additions and 0 deletions
  1. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  2. +63
    -0
      src/tests/antunit/taskdefs/copy-test.xml

+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -567,8 +567,10 @@ public class Copy extends Task {
}
}
}

private void iterateOverBaseDirs(
HashSet baseDirs, HashMap dirsByBasedir, HashMap filesByBasedir) {

Iterator iter = baseDirs.iterator();
while (iter.hasNext()) {
File f = (File) iter.next();


+ 63
- 0
src/tests/antunit/taskdefs/copy-test.xml View File

@@ -0,0 +1,63 @@
<?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">
<import file="../antunit-base.xml" />

<target name="-fileResourceSetup">
<mkdir dir="${input}"/>
<mkdir dir="${output}"/>
<touch file="${input}/file.txt"/>
</target>

<target name="xtestCopyFile" depends="-fileResourceSetup">
<au:assertFileDoesntExist file="${output}/file.txt"/>
<copy todir="${output}">
<file file="${input}/file.txt"/>
</copy>
<au:assertFileExists file="${output}/file.txt"/>
</target>

<target name="xtestCopyFileInResources" depends="-fileResourceSetup">
<au:assertFileDoesntExist file="${output}/file.txt"/>
<copy todir="${output}">
<resources>
<file file="${input}/file.txt"/>
</resources>
</copy>
<au:assertFileExists file="${output}/file.txt"/>
</target>

<target name="testCopyFileFlatten" depends="-fileResourceSetup">
<au:assertFileDoesntExist file="${output}/file.txt"/>
<copy todir="${output}" flatten="true">
<file file="${input}/file.txt"/>
</copy>
<au:assertFileExists file="${output}/file.txt"/>
</target>

<target name="testCopyFileInResourcesFlatten" depends="-fileResourceSetup">
<au:assertFileDoesntExist file="${output}/file.txt"/>
<copy todir="${output}" flatten="true">
<resources>
<file file="${input}/file.txt"/>
</resources>
</copy>
<au:assertFileExists file="${output}/file.txt"/>
</target>

</project>

Loading…
Cancel
Save