git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@693791 13f79535-47bb-0310-9956-ffa450edef68master
@@ -806,17 +806,16 @@ public class DirectoryScanner | |||||
if (!basedir.exists()) { | if (!basedir.exists()) { | ||||
if (errorOnMissingDir) { | if (errorOnMissingDir) { | ||||
illegal = new IllegalStateException( | illegal = new IllegalStateException( | ||||
"basedir " + basedir + " does not exist"); | |||||
"basedir " + basedir + " does not exist."); | |||||
} else { | } else { | ||||
// Nothing to do - basedir does not exist | // Nothing to do - basedir does not exist | ||||
return; | return; | ||||
} | } | ||||
} | |||||
if (!basedir.isDirectory()) { | |||||
} else if (!basedir.isDirectory()) { | |||||
illegal = new IllegalStateException("basedir " | illegal = new IllegalStateException("basedir " | ||||
+ basedir | + basedir | ||||
+ " is not a" | + " is not a" | ||||
+ " directory"); | |||||
+ " directory."); | |||||
} | } | ||||
if (illegal != null) { | if (illegal != null) { | ||||
throw illegal; | throw illegal; | ||||
@@ -434,7 +434,7 @@ public abstract class AbstractFileSet extends DataType | |||||
} | } | ||||
if (!dir.exists() && errorOnMissingDir) { | if (!dir.exists() && errorOnMissingDir) { | ||||
throw new BuildException(dir.getAbsolutePath() | throw new BuildException(dir.getAbsolutePath() | ||||
+ " not found."); | |||||
+ " does not exist."); | |||||
} | } | ||||
if (!dir.isDirectory() && dir.exists()) { | if (!dir.isDirectory() && dir.exists()) { | ||||
throw new BuildException(dir.getAbsolutePath() | throw new BuildException(dir.getAbsolutePath() | ||||
@@ -15,7 +15,9 @@ | |||||
See the License for the specific language governing permissions and | See the License for the specific language governing permissions and | ||||
limitations under the License. | limitations under the License. | ||||
--> | --> | ||||
<project xmlns:au="antlib:org.apache.ant.antunit" default="all"> | |||||
<project xmlns:au="antlib:org.apache.ant.antunit" default="antunit"> | |||||
<import file="../antunit-base.xml"/> | |||||
<target name="test-fileset-missing-dir"> | <target name="test-fileset-missing-dir"> | ||||
<path id="missing.path.id"> | <path id="missing.path.id"> | ||||
@@ -30,6 +32,15 @@ | |||||
</au:assertTrue> | </au:assertTrue> | ||||
</target> | </target> | ||||
<target name="test-fileset-missing-dir-exception"> | |||||
<mkdir dir="${output}"/> | |||||
<au:expectfailure expectedmessage="not present does not exist"> | |||||
<copy todir="${output}"> | |||||
<fileset dir="not present" /> | |||||
</copy> | |||||
</au:expectfailure> | |||||
</target> | |||||
<target name="test-fileset-with-if"> | <target name="test-fileset-with-if"> | ||||
<fileset id="this.xml" dir="."> | <fileset id="this.xml" dir="."> | ||||
<include if="trigger.include" name="fileset-test.xml"/> | <include if="trigger.include" name="fileset-test.xml"/> | ||||
@@ -53,10 +64,4 @@ | |||||
<au:assertLogContains text="fileset-test.xml"/> | <au:assertLogContains text="fileset-test.xml"/> | ||||
</target> | </target> | ||||
<target name="all"> | |||||
<au:antunit> | |||||
<fileset dir="${basedir}" includes="fileset-test.xml"/> | |||||
<au:plainlistener/> | |||||
</au:antunit> | |||||
</target> | |||||
</project> | </project> |