You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/09/11 15:59:51 UTC
svn commit: r694254 - in /ant/core/trunk/src:
main/org/apache/tools/ant/DirectoryScanner.java
main/org/apache/tools/ant/taskdefs/Copy.java
main/org/apache/tools/ant/types/AbstractFileSet.java
tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
Author: bodewig
Date: Thu Sep 11 06:59:41 2008
New Revision: 694254
URL: http://svn.apache.org/viewvc?rev=694254&view=rev
Log:
fix tests broken by changed exception message of svn revision 685593
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Copy.java
ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java?rev=694254&r1=694253&r2=694254&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java Thu Sep 11 06:59:41 2008
@@ -171,6 +171,7 @@
};
public static final int MAX_LEVELS_OF_SYMLINKS = 1;
+ public static final String DOES_NOT_EXIST_POSTFIX = " does not exist.";
/** Helper. */
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
@@ -834,8 +835,9 @@
} else {
if (!basedir.exists()) {
if (errorOnMissingDir) {
- illegal = new IllegalStateException(
- "basedir " + basedir + " does not exist.");
+ illegal = new IllegalStateException("basedir "
+ + basedir
+ + DOES_NOT_EXIST_POSTFIX);
} else {
// Nothing to do - basedir does not exist
return;
@@ -1100,7 +1102,7 @@
String[] newfiles = list(dir);
if (newfiles == null) {
if (!dir.exists()) {
- throw new BuildException(dir + " doesn't exist.");
+ throw new BuildException(dir + DOES_NOT_EXIST_POSTFIX);
} else if (!dir.isDirectory()) {
throw new BuildException(dir + " is not a directory.");
} else {
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Copy.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Copy.java?rev=694254&r1=694253&r2=694254&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Copy.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Copy.java Thu Sep 11 06:59:41 2008
@@ -434,7 +434,8 @@
ds = fs.getDirectoryScanner(getProject());
} catch (BuildException e) {
if (failonerror
- || !getMessage(e).endsWith(" not found.")) {
+ || !getMessage(e).endsWith(DirectoryScanner
+ .DOES_NOT_EXIST_POSTFIX)) {
throw e;
} else {
log("Warning: " + getMessage(e), Project.MSG_ERR);
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java?rev=694254&r1=694253&r2=694254&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java Thu Sep 11 06:59:41 2008
@@ -446,7 +446,8 @@
}
if (!dir.exists() && errorOnMissingDir) {
throw new BuildException(dir.getAbsolutePath()
- + " does not exist.");
+ + DirectoryScanner
+ .DOES_NOT_EXIST_POSTFIX);
}
if (!dir.isDirectory() && dir.exists()) {
throw new BuildException(dir.getAbsolutePath()
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java?rev=694254&r1=694253&r2=694254&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java Thu Sep 11 06:59:41 2008
@@ -153,7 +153,7 @@
public void testMissingDirBail() {
expectBuildException("testMissingDirBail", "not-there doesn't exist");
- assertTrue(getBuildException().getMessage().endsWith(" not found."));
+ assertTrue(getBuildException().getMessage().endsWith(" does not exist."));
}
public void testFileResourcePlain() {