remove reliance on Java 7 Path api in tests
authorHenry Story <henry.story@bblfish.net>
Wed, 30 May 2012 18:45:33 +0200
changeset 220 8f546a50e8a1
parent 217 186287f5941a
child 221 19c0f6ea8ad0
remove reliance on Java 7 Path api in tests
src/test/scala/auth/secure_specs.scala
--- a/src/test/scala/auth/secure_specs.scala	Wed May 23 23:02:01 2012 +0200
+++ b/src/test/scala/auth/secure_specs.scala	Wed May 30 18:45:33 2012 +0200
@@ -36,7 +36,6 @@
 import org.apache.http.client.HttpClient
 import javax.net.ssl.{SSLContext, X509TrustManager, KeyManager}
 import util.trySome
-import java.nio.file.Files
 
 /**
  * @author hjs
@@ -132,16 +131,17 @@
 
   lazy val root = {
     outDirBase.mkdirs()
-    val dir = Files.createTempDirectory(outDirBase.toPath, "test_rww_")
+    val dir = File.createTempFile("test_rww_",".dir",outDirBase)
     System.out.println("Temp directory: "+dir.toString)
-    dir.toFile
+    dir.delete() //ugly hack!!, need to delete the temporary file and replace it with a directory
+    dir.mkdirs()
+    dir
   }
 
   lazy val resourceManager = new Filesystem(root, baseURL, lang)(mode)
 
   doBeforeSpec {
-    if (root.exists) root.deleteRecursively()
-    root.mkdir()
+
   }
 
 }