ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/types MapperTest.java
Date Tue, 08 Jan 2002 09:46:27 GMT
bodewig     02/01/08 01:46:26

  Modified:    .        build.xml
               src/etc/testcases/taskdefs copydir.xml delete.xml filter.xml
                        jar.xml zip.xml
               src/etc/testcases/taskdefs/optional/antlr antlr.xml
               src/etc/testcases/types mapper.xml
               src/testcases/org/apache/tools/ant/taskdefs CopydirTest.java
                        DeleteTest.java FilterTest.java JarTest.java
               src/testcases/org/apache/tools/ant/taskdefs/optional
                        ANTLRTest.java TraXLiaisonTest.java
                        XalanLiaisonTest.java
               src/testcases/org/apache/tools/ant/types MapperTest.java
  Log:
  Move responsibility for cleanup to the test themselves.
  
  Revision  Changes    Path
  1.222     +0 -10     jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.221
  retrieving revision 1.222
  diff -u -r1.221 -r1.222
  --- build.xml	7 Jan 2002 17:06:28 -0000	1.221
  +++ build.xml	8 Jan 2002 09:46:26 -0000	1.222
  @@ -929,16 +929,6 @@
         </batchtest>
   
       </junit>
  -
  -    <!-- clean up again -->
  -    <delete dir="${tests.etc.dir}/taskdefs/optional/antlr/antlr.tmp" />
  -    <delete dir="${tests.etc.dir}/taskdefs/taskdefs.tmp" />
  -    <delete dir="${tests.etc.dir}/taskdefs.tmp" />
  -    <delete file="${tests.etc.dir}/taskdefs/tmp.jar" />
  -    <delete dir="${tests.etc.dir}/types/copytest" />
  -    <!-- generated by testcases in jvm dir -->
  -    <delete file="${user.dir}/xalan1-redirect-out.tmp" />
  -    <delete file="${user.dir}/xalan2-redirect-out.tmp" />
     </target>
   
     <target name="run-single-test" if="testcase" depends="compile-tests">
  
  
  
  1.3       +4 -0      jakarta-ant/src/etc/testcases/taskdefs/copydir.xml
  
  Index: copydir.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/copydir.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- copydir.xml	18 Dec 2000 15:43:52 -0000	1.2
  +++ copydir.xml	8 Jan 2002 09:46:26 -0000	1.3
  @@ -30,4 +30,8 @@
                dest="template.xml"/>
     </target>
   
  +  <target name="cleanup">
  +    <delete dir="../taskdefs.tmp" />
  +  </target>
  +
   </project>
  
  
  
  1.3       +3 -6      jakarta-ant/src/etc/testcases/taskdefs/delete.xml
  
  Index: delete.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/delete.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- delete.xml	18 Dec 2000 15:43:53 -0000	1.2
  +++ delete.xml	8 Jan 2002 09:46:26 -0000	1.3
  @@ -12,17 +12,14 @@
       <delete file="taskdefs.tmp"/>
     </target>
   
  -  <target name="test3">
  -    <copydir src="." 
  -             dest="taskdefs.tmp"/>
  -    <delete dir="taskdefs.tmp/ant.xml"/>
  -  </target>
  -
     <target name="test4">
       <copydir src="." 
                dest="taskdefs.tmp"/>
       <delete dir="taskdefs.tmp"/>
     </target>
   
  +  <target name="cleanup">
  +    <delete dir="taskdefs.tmp" />
  +  </target>
   
   </project>
  
  
  
  1.5       +4 -0      jakarta-ant/src/etc/testcases/taskdefs/filter.xml
  
  Index: filter.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/filter.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- filter.xml	18 Dec 2000 15:43:54 -0000	1.4
  +++ filter.xml	8 Jan 2002 09:46:26 -0000	1.5
  @@ -42,4 +42,8 @@
       </copy>
     </target>
   
  +  <target name="cleanup">
  +    <delete dir="taskdefs.tmp" />
  +  </target>
  +
   </project>
  
  
  
  1.4       +4 -2      jakarta-ant/src/etc/testcases/taskdefs/jar.xml
  
  Index: jar.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/jar.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jar.xml	7 Jan 2002 06:21:49 -0000	1.3
  +++ jar.xml	8 Jan 2002 09:46:26 -0000	1.4
  @@ -21,8 +21,6 @@
     </target>
   
     <target name="test4">
  -   <!-- delete the tmp.jar or the next test will fail -->
  -   <delete file="tmp.jar"/>
      <jar
       	destfile="tmp.jar"
   	basedir="."
  @@ -37,6 +35,10 @@
   	basedir="."
   	includes="jar.xml"
       />
  +  </target>
  +
  +  <target name="cleanup">
  +    <delete file="tmp.jar" />
     </target>
   
   </project>
  
  
  
  1.7       +1 -0      jakarta-ant/src/etc/testcases/taskdefs/zip.xml
  
  Index: zip.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/zip.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- zip.xml	7 Jan 2002 06:21:49 -0000	1.6
  +++ zip.xml	8 Jan 2002 09:46:26 -0000	1.7
  @@ -68,6 +68,7 @@
       <delete file="test6.zip"/>
       <delete file="inner7.zip"/>
       <delete file="test7.zip"/>
  +    <delete file="test8.zip"/>
       <delete file="asf-logo.gif.zip"/>
     </target>
   </project>
  
  
  
  1.4       +4 -8      jakarta-ant/src/etc/testcases/taskdefs/optional/antlr/antlr.xml
  
  Index: antlr.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/optional/antlr/antlr.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- antlr.xml	30 Aug 2001 13:26:36 -0000	1.3
  +++ antlr.xml	8 Jan 2002 09:46:26 -0000	1.4
  @@ -10,21 +10,15 @@
     </target>
   
     <target name="test2">
  -    <!-- delete the tmp directory, it may exists if a previous ANTLR test
  -         failed.  This in turn will cause this test to fail, as it tests
  -         the build exception when the outputdirectory is invalid. -->
  -    <deltree dir="${tmp.dir}"/>
       <antlr target="antlr.g" outputdirectory="${tmp.dir}"/>
     </target>
   
     <target name="test3">
  -    <deltree dir="${tmp.dir}"/>
       <mkdir dir="${tmp.dir}"/>
       <antlr target="antlr.g" outputdirectory="${tmp.dir}"/>
     </target>
   
     <target name="test4">
  -    <deltree dir="${tmp.dir}"/>
       <mkdir dir="${tmp.dir}"/>
       <antlr target="java.g" outputdirectory="${tmp.dir}"/>
       <antlr target="java.tree.g" outputdirectory="${tmp.dir}"/>
  @@ -35,8 +29,6 @@
     </target>
   
     <target name="test6">
  -    <deltree dir="${tmp.dir}"/>
  -    <!-- This tmp.dir needs to be deleted by the build file which executes this test.
-->
       <mkdir dir="${tmp.dir}"/>
       <antlr target="java.g" outputdirectory="${tmp.dir}" />
       <antlr dir="${tmp.dir}"
  @@ -48,5 +40,9 @@
     <target name="test7">
       <antlr target="antlr.xml"/>
     </target>    
  +
  +  <target name="cleanup">
  +    <delete dir="${tmp.dir}" />
  +  </target>
   
   </project>
  
  
  
  1.3       +4 -1      jakarta-ant/src/etc/testcases/types/mapper.xml
  
  Index: mapper.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/types/mapper.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mapper.xml	2 Mar 2001 15:57:47 -0000	1.2
  +++ mapper.xml	8 Jan 2002 09:46:26 -0000	1.3
  @@ -3,7 +3,6 @@
   <project name="copy-test" basedir="." default="test1">
   
     <target name="test1">
  -    <delete dir="copytest" />
       <mkdir dir="copytest" />
       <copy todir="copytest">
         <fileset dir="../../../main">
  @@ -14,6 +13,10 @@
         </fileset>
         <mapper type="flatten" />
       </copy>
  +  </target>
  +
  +  <target name="cleanup">
  +    <delete dir="copytest" />
     </target>
   
   </project>
  
  
  
  1.6       +4 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CopydirTest.java
  
  Index: CopydirTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CopydirTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CopydirTest.java	14 Nov 2001 12:25:30 -0000	1.5
  +++ CopydirTest.java	8 Jan 2002 09:46:26 -0000	1.6
  @@ -70,6 +70,10 @@
           configureProject("src/etc/testcases/taskdefs/copydir.xml");
       }
       
  +    public void tearDown() {
  +        executeTarget("cleanup");
  +    }
  +    
       public void test1() { 
           expectBuildException("test1", "required argument not specified");
       }
  
  
  
  1.5       +4 -5      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java
  
  Index: DeleteTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeleteTest.java	14 Nov 2001 12:25:30 -0000	1.4
  +++ DeleteTest.java	8 Jan 2002 09:46:26 -0000	1.5
  @@ -69,6 +69,10 @@
           configureProject("src/etc/testcases/taskdefs/delete.xml");
       }
   
  +    public void tearDown() {
  +        executeTarget("cleanup");
  +    }
  +    
       public void test1() { 
           expectBuildException("test1", "required argument not specified");
       }
  @@ -76,11 +80,6 @@
       public void test2() { 
           executeTarget("test2");
       }
  -
  -    // delete now handles files *and* directories --SB
  -//    public void test3() { 
  -//        expectBuildException("test3", "Not a directory");
  -//    }
   
       public void test4() { 
           executeTarget("test4");
  
  
  
  1.6       +4 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/FilterTest.java
  
  Index: FilterTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/FilterTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FilterTest.java	14 Nov 2001 12:25:30 -0000	1.5
  +++ FilterTest.java	8 Jan 2002 09:46:26 -0000	1.6
  @@ -74,6 +74,10 @@
           configureProject("src/etc/testcases/taskdefs/filter.xml");
       }
   
  +    public void tearDown() {
  +        executeTarget("cleanup");
  +    }
  +    
       public void test1() { 
           expectBuildException("test1", "required argument missing");
       }
  
  
  
  1.7       +4 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java
  
  Index: JarTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JarTest.java	14 Nov 2001 13:40:53 -0000	1.6
  +++ JarTest.java	8 Jan 2002 09:46:26 -0000	1.7
  @@ -74,6 +74,10 @@
           configureProject("src/etc/testcases/taskdefs/jar.xml");
       }
   
  +    public void tearDown() {
  +        executeTarget("cleanup");
  +    }
  +    
       public void test1() {
           expectBuildException("test1", "required argument not specified");
       }
  
  
  
  1.7       +4 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java
  
  Index: ANTLRTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ANTLRTest.java	15 Dec 2001 18:53:39 -0000	1.6
  +++ ANTLRTest.java	8 Jan 2002 09:46:26 -0000	1.7
  @@ -81,6 +81,10 @@
           configureProject(TASKDEFS_DIR + "antlr.xml");
       }
   
  +    public void tearDown() {
  +        executeTarget("cleanup");
  +    }
  +    
       public void test1() {
           expectBuildException("test1", "required argument, target, missing");
       }
  
  
  
  1.4       +7 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
  
  Index: TraXLiaisonTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TraXLiaisonTest.java	16 Nov 2001 21:40:59 -0000	1.3
  +++ TraXLiaisonTest.java	8 Jan 2002 09:46:26 -0000	1.4
  @@ -69,6 +69,13 @@
           super(name);
       }
   
  +    public void tearDown() {
  +        File f = new File("xalan2-redirect-out.tmp");
  +        if (f.exists()) {
  +            f.delete();
  +        }
  +    }
  +
       public XSLTLiaison createLiaison() throws Exception {
           return new TraXLiaison();
       }
  
  
  
  1.3       +7 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java
  
  Index: XalanLiaisonTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanLiaisonTest.java	18 Aug 2001 14:59:40 -0000	1.2
  +++ XalanLiaisonTest.java	8 Jan 2002 09:46:26 -0000	1.3
  @@ -68,6 +68,13 @@
           super(name);
       }
   
  +    public void tearDown() {
  +        File f = new File("xalan1-redirect-out.tmp");
  +        if (f.exists()) {
  +            f.delete();
  +        }
  +    }
  +
       protected XSLTLiaison createLiaison() throws Exception {
           return new XalanLiaison();
       }
  
  
  
  1.6       +10 -2     jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java
  
  Index: MapperTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MapperTest.java	14 Nov 2001 12:25:31 -0000	1.5
  +++ MapperTest.java	8 Jan 2002 09:46:26 -0000	1.6
  @@ -178,8 +178,12 @@
   
       public void testCopyTaskWithTwoFilesets() {
           TaskdefForCopyTest t = new TaskdefForCopyTest("test1");
  -        t.setUp();
  -        t.test1();
  +        try {
  +            t.setUp();
  +            t.test1();
  +        } finally {
  +            t.tearDown();
  +        }
       }
   
       private class TaskdefForCopyTest extends BuildFileTest {
  @@ -189,6 +193,10 @@
   
           public void setUp() { 
               configureProject("src/etc/testcases/types/mapper.xml");
  +        }
  +
  +        public void tearDown() {
  +            executeTarget("cleanup");
           }
   
           public void test1() { 
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message