Lines 17-22
Link Here
|
17 |
|
17 |
|
18 |
package org.apache.tools.ant.taskdefs; |
18 |
package org.apache.tools.ant.taskdefs; |
19 |
|
19 |
|
|
|
20 |
import java.io.File; |
21 |
import java.io.IOException; |
22 |
|
20 |
import org.apache.tools.ant.BuildException; |
23 |
import org.apache.tools.ant.BuildException; |
21 |
import org.apache.tools.ant.BuildFileTest; |
24 |
import org.apache.tools.ant.BuildFileTest; |
22 |
import org.apache.tools.ant.Location; |
25 |
import org.apache.tools.ant.Location; |
Lines 109-113
Link Here
|
109 |
"Did not see build exception", |
112 |
"Did not see build exception", |
110 |
false); |
113 |
false); |
111 |
} |
114 |
} |
112 |
} |
|
|
113 |
|
115 |
|
|
|
116 |
public void testSymlinkedImports() throws Exception { |
117 |
String ln = "/usr/bin/ln"; |
118 |
if (!new File(ln).exists()) { |
119 |
ln = "/bin/ln"; |
120 |
} |
121 |
if (!new File(ln).exists()) { |
122 |
// Running on Windows or something, so skip it. |
123 |
return; |
124 |
} |
125 |
String symlink = "src/etc/testcases/taskdefs/import/symlinks/d3b"; |
126 |
if (Runtime.getRuntime().exec(new String[] {ln, "-s", "d3a", symlink}).waitFor() != 0) { |
127 |
throw new IOException("'" + ln + " -s d3a " + symlink + "' failed"); |
128 |
} |
129 |
try { |
130 |
configureProject( |
131 |
"src/etc/testcases/taskdefs/import/symlinks/d1/p1.xml"); |
132 |
assertPropertyEquals("ant.file.p2", new File("src/etc/testcases/taskdefs/import/symlinks/d2/p2.xml").getAbsolutePath()); |
133 |
assertPropertyEquals("ant.file.p3", new File("src/etc/testcases/taskdefs/import/symlinks/d3b/p3.xml").getAbsolutePath()); |
134 |
} finally { |
135 |
new File(symlink).delete(); |
136 |
} |
137 |
} |
138 |
|
139 |
} |