You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/12/01 08:45:11 UTC
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs RecorderTest.java
bodewig 2004/11/30 23:45:11
Modified: src/etc/testcases/taskdefs recorder.xml
src/testcases/org/apache/tools/ant/taskdefs
RecorderTest.java
Log:
Please don't modify my working copy during tests, otherwise I'm going to commit changed files by accident
Revision Changes Path
1.2 +12 -7 ant/src/etc/testcases/taskdefs/recorder.xml
Index: recorder.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/recorder.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- recorder.xml 5 Nov 2004 12:34:27 -0000 1.1
+++ recorder.xml 1 Dec 2004 07:45:11 -0000 1.2
@@ -1,20 +1,25 @@
<?xml version="1.0"?>
<project name="recorder-test" default="all" basedir=".">
- <property name="recdir" location="recorder"/>
+ <property name="recin" location="recorder"/>
+ <property name="recdir" location="recorder-out"/>
<target name="all" depends="noappend,append,restart,deleterestart"/>
<target name="prepare">
- <fixcrlf srcdir="${recdir}" includes="*.result"/>
+ <mkdir dir="${recdir}"/>
+ <copy toDir="${recdir}">
+ <fileset dir="${recin}"/>
+ </copy>
+ <fixcrlf srcdir="${recdir}"/>
</target>
-
<target name="noappend">
<copy file="${recdir}/rectest2.result" tofile="${recdir}/rectest1.log"/>
<record name="${recdir}/rectest1.log" action="start" />
<echo message="some message1"/>
<record name="${recdir}/rectest1.log" action="stop" />
+ <fixcrlf srcdir="${recdir}" includes="*.log"/>
</target>
<target name="append">
@@ -22,6 +27,7 @@
<record name="${recdir}/rectest2.log" append="true" action="start"/>
<echo message="some message2"/>
<record name="${recdir}/rectest2.log" action="stop"/>
+ <fixcrlf srcdir="${recdir}" includes="*.log"/>
</target>
<target name="restart">
@@ -32,6 +38,7 @@
<record name="${recdir}/rectest3.log" action="start"/>
<echo message="some message3"/>
<record name="${recdir}/rectest3.log" action="stop"/>
+ <fixcrlf srcdir="${recdir}" includes="*.log"/>
</target>
<target name="deleterestart">
@@ -43,14 +50,12 @@
<record name="${recdir}/rectest4.log" action="start"/>
<echo message="some message3"/>
<record name="${recdir}/rectest4.log" action="stop"/>
+ <fixcrlf srcdir="${recdir}" includes="*.log"/>
</target>
<target name="cleanup">
- <delete file="${recdir}/rectest1.log"/>
- <delete file="${recdir}/rectest2.log"/>
- <delete file="${recdir}/rectest3.log"/>
- <delete file="${recdir}/rectest4.log"/>
+ <delete dir="${recdir}"/>
</target>
</project>
1.2 +23 -9 ant/src/testcases/org/apache/tools/ant/taskdefs/RecorderTest.java
Index: RecorderTest.java
===================================================================
RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/RecorderTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RecorderTest.java 5 Nov 2004 12:34:28 -0000 1.1
+++ RecorderTest.java 1 Dec 2004 07:45:11 -0000 1.2
@@ -27,6 +27,8 @@
*/
public class RecorderTest extends BuildFileTest {
+ private static final String REC_DIR = "recorder-out";
+
public RecorderTest(String name) {
super(name);
}
@@ -43,29 +45,41 @@
public void testNoAppend() throws IOException {
FileUtils fileUtils = FileUtils.newFileUtils();
executeTarget("noappend");
- assertTrue(fileUtils.contentEquals(project.resolveFile("recorder/rectest1.result"),
- project.resolveFile("recorder/rectest1.log")));
+ assertTrue(fileUtils
+ .contentEquals(project.resolveFile(REC_DIR
+ + "rectest1.result"),
+ project.resolveFile(REC_DIR
+ + "rectest1.log")));
}
public void testAppend() throws IOException {
FileUtils fileUtils = FileUtils.newFileUtils();
executeTarget("append");
- assertTrue(fileUtils.contentEquals(project.resolveFile("recorder/rectest2.result"),
- project.resolveFile("recorder/rectest2.log")));
+ assertTrue(fileUtils
+ .contentEquals(project.resolveFile(REC_DIR
+ + "rectest2.result"),
+ project.resolveFile(REC_DIR
+ + "rectest2.log")));
}
public void testRestart() throws IOException {
FileUtils fileUtils = FileUtils.newFileUtils();
executeTarget("restart");
- assertTrue(fileUtils.contentEquals(project.resolveFile("recorder/rectest3.result"),
- project.resolveFile("recorder/rectest3.log")));
+ assertTrue(fileUtils
+ .contentEquals(project.resolveFile(REC_DIR
+ + "rectest3.result"),
+ project.resolveFile(REC_DIR
+ + "rectest3.log")));
}
public void testDeleteRestart() throws IOException {
FileUtils fileUtils = FileUtils.newFileUtils();
executeTarget("deleterestart");
- assertTrue(fileUtils.contentEquals(project.resolveFile("recorder/rectest4.result"),
- project.resolveFile("recorder/rectest4.log")));
+ assertTrue(fileUtils
+ .contentEquals(project.resolveFile(REC_DIR
+ + "rectest4.result"),
+ project.resolveFile(REC_DIR
+ + "rectest4.log")));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org