make tests use a real temp directory
authorStefan Bodewig <bodewig@apache.org>
Sun, 27 Jul 2014 10:47:59 +0000 (12:47 +0200)
committerStefan Bodewig <bodewig@apache.org>
Sun, 27 Jul 2014 10:47:59 +0000 (12:47 +0200)
src/etc/testcases/abstractsvntask.xml
src/etc/testcases/changelog.xml
src/etc/testcases/revisiondiff.xml
src/etc/testcases/tagdiff.xml
src/tests/junit/org/apache/ant/svn/AbstractSvnTaskTest.java
src/tests/junit/org/apache/ant/svn/SvnChangeLogTaskTest.java
src/tests/junit/org/apache/ant/svn/SvnRevisionDiffTest.java
src/tests/junit/org/apache/ant/svn/SvnTagDiffTest.java

index 61d9d39..2876fe2 100644 (file)
@@ -20,7 +20,7 @@
 <project name="abstractsvntask-test" basedir="../../../" 
          default="all" xmlns:svn="antlib:org.apache.ant.svn">
 
-  <property name="tmpdir" value="tmpdir"/>
+  <property name="tmpdir" value="${java.io.tmpdir}/svnantlib"/>
   <property name="trunkdir" value="${tmpdir}/trunk"/>
   <property name="file" value="build.xml"/>
 
index 7c624b0..b186000 100644 (file)
@@ -20,7 +20,7 @@
 <project name="changelog-test" basedir="../../../" 
          default="log" xmlns:svn="antlib:org.apache.ant.svn">
 
-  <property name="tmpdir" value="tmpdir"/>
+  <property name="tmpdir" value="${java.io.tmpdir}/svnantlib"/>
   <property name="trunkdir" value="${tmpdir}/trunk"/>
 
   <target name="setup">
index d7cdbcd..2db3fb8 100644 (file)
@@ -20,7 +20,7 @@
 <project name="revisiondiff-test" basedir="../../../" 
          default="diff" xmlns:svn="antlib:org.apache.ant.svn">
 
-  <property name="tmpdir" value="tmpdir"/>
+  <property name="tmpdir" value="${java.io.tmpdir}/svnantlib"/>
   <property name="trunkdir" value="${tmpdir}/trunk"/>
 
   <target name="dir-prep">
index 3c2b850..26a8bad 100644 (file)
@@ -21,7 +21,7 @@
          default="diff-with-implicit-trunk"
          xmlns:svn="antlib:org.apache.ant.svn">
 
-  <property name="tmpdir" value="tmpdir"/>
+  <property name="tmpdir" value="${java.io.tmpdir}/svnantlib"/>
   <property 
     name="baseURL"
     value="http://svn.apache.org/repos/asf/ant/antlibs/antunit/"/>
index 5716ee1..e6a1627 100644 (file)
@@ -46,7 +46,8 @@ public class AbstractSvnTaskTest extends BuildFileTest {
     }
 
     public void testRevisionAttribute() {
-        File f = getProject().resolveFile("tmpdir/trunk/build.xml");
+        String tmpDir = getProject().getProperty("tmpdir");
+        File f = getProject().resolveFile(tmpDir + "/trunk/build.xml");
         assertTrue("starting empty", !f.exists());
 
         // used to be
index d385190..67408da 100644 (file)
@@ -75,8 +75,9 @@ public class SvnChangeLogTaskTest extends BuildFileTest {
     private String executeTargetAndReadLogFully(String target) 
         throws IOException {
         executeTarget(target);
+        String tmpDir = getProject().getProperty("tmpdir");
         FileReader r = new FileReader(getProject()
-                                      .resolveFile("tmpdir/log.xml"));
+                                      .resolveFile(tmpDir + "/log.xml"));
         try {
             return FileUtils.readFully(r);
         } finally {
index b08f373..a82409e 100644 (file)
@@ -60,8 +60,9 @@ public class SvnRevisionDiffTest extends BuildFileTest {
     private String executeTargetAndReadLogFully(String target) 
         throws IOException {
         executeTarget(target);
+        String tmpDir = getProject().getProperty("tmpdir");
         FileReader r = new FileReader(getProject()
-                                      .resolveFile("tmpdir/diff.xml"));
+                                      .resolveFile(tmpDir + "/diff.xml"));
         try {
             return FileUtils.readFully(r);
         } finally {
index aa47066..c3002a0 100644 (file)
@@ -67,8 +67,9 @@ public class SvnTagDiffTest extends BuildFileTest {
     private String executeTargetAndReadLogFully(String target) 
         throws IOException {
         executeTarget(target);
+        String tmpDir = getProject().getProperty("tmpdir");
         FileReader r = new FileReader(getProject()
-                                      .resolveFile("tmpdir/diff.xml"));
+                                      .resolveFile(tmpDir + "/diff.xml"));
         try {
             return FileUtils.readFully(r);
         } finally {