Browse Source

clean up test files/dirs

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@782934 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
120dcf4e55
3 changed files with 19 additions and 6 deletions
  1. +2
    -1
      src/tests/antunit/taskdefs/manifest-test.xml
  2. +7
    -5
      src/tests/antunit/taskdefs/retry-test.xml
  3. +10
    -0
      src/tests/junit/org/apache/tools/ant/types/DirSetTest.java

+ 2
- 1
src/tests/antunit/taskdefs/manifest-test.xml View File

@@ -20,11 +20,12 @@

<import file="../antunit-base.xml" />

<property name="file" location="${output}test.mf"/>
<property name="file" location="${output}/test.mf"/>

<target name="test8IsAllowed"
description="https://issues.apache.org/bugzilla/show_bug.cgi?id=45675"
>
<mkdir dir="${output}"/>
<manifest file="${file}">
<attribute name="attrib8" value="test attribute"/>
</manifest>


+ 7
- 5
src/tests/antunit/taskdefs/retry-test.xml View File

@@ -18,9 +18,13 @@
<project name="retry-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml"/>

<target name="test-fail-and-retry">
<target name="setUp">
<property name="i" value="3"/>
<property name="dest" value="${java.io.tmpdir}/dest"/>
<mkdir dir="${output}"/>
<property name="dest" value="${output}/dest"/>
</target>

<target name="test-fail-and-retry" depends="setUp">
<!-- just in case this ever becomes a legit url... -->
<property name="src" value="http://iojasodjojaosdj"/>
<au:expectfailure expectedmessage="Task [get] failed after [${i}] attempts; giving up">
@@ -31,9 +35,7 @@
<au:assertLogContains text="Attempt [1]: error occurred; retrying..."/>
</target>

<target name="test-success">
<property name="i" value="3"/>
<property name="dest" value="${java.io.tmpdir}/dest"/>
<target name="test-success" depends="setUp">
<retry retrycount="${i}">
<touch file="${dest}"/>
</retry>


+ 10
- 0
src/tests/junit/org/apache/tools/ant/types/DirSetTest.java View File

@@ -64,6 +64,7 @@ public class DirSetTest extends AbstractFileSetTest {

public void testToString() throws Exception {
File tmp = File.createTempFile("DirSetTest", "");
try {
tmp.delete();
File a = new File(tmp, "a");
a.mkdirs();
@@ -78,6 +79,15 @@ public class DirSetTest extends AbstractFileSetTest {
ds.setDir(tmp);
ds.setIncludes("b/");
assertEquals("b;b" + File.separator + "c", ds.toString());
} finally {
new File(tmp, "a/x").delete();
new File(tmp, "a").delete();
new File(tmp, "b/c/x").delete();
new File(tmp, "b/c").delete();
new File(tmp, "b/x").delete();
new File(tmp, "b").delete();
tmp.delete();
}
}

}

Loading…
Cancel
Save