diff --git a/src/test/java/org/caosdb/CaosDBTestClass.java b/src/test/java/org/caosdb/CaosDBTestClass.java
deleted file mode 100644
index 06133b3de0d02cd6f8c87e73ae4a6fbd1219f433..0000000000000000000000000000000000000000
--- a/src/test/java/org/caosdb/CaosDBTestClass.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * ** header v3.0
- * This file is a part of the CaosDB Project.
- *
- * Copyright (C) 2018 Research Group Biomedical Physics,
- * Max-Planck-Institute for Dynamics and Self-Organization Göttingen
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- * ** end header
- */
-package org.caosdb;
-
-import java.io.File;
-import java.io.IOException;
-import org.apache.commons.io.FileUtils;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-
-public class CaosDBTestClass {
-
-  public static final File TEST_DIR = new File(".TEST_DIR");
-
-  @BeforeAll
-  public static final void setupAll() throws IOException {
-    TEST_DIR.mkdirs();
-    FileUtils.forceDeleteOnExit(TEST_DIR);
-  }
-
-  @AfterAll
-  public static final void teardownAll() {}
-}
diff --git a/src/test/java/org/caosdb/server/scripting/TestServerSideScriptingCaller.java b/src/test/java/org/caosdb/server/scripting/TestServerSideScriptingCaller.java
index da6ecb1cda0abb2254b6c69351f63b5c7c6d5af9..0d37928231f139b40b9c3c17d6753fac7368b233 100644
--- a/src/test/java/org/caosdb/server/scripting/TestServerSideScriptingCaller.java
+++ b/src/test/java/org/caosdb/server/scripting/TestServerSideScriptingCaller.java
@@ -32,13 +32,13 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import org.apache.commons.io.FileUtils;
-import org.caosdb.CaosDBTestClass;
 import org.caosdb.server.CaosDBException;
 import org.caosdb.server.CaosDBServer;
 import org.caosdb.server.ServerProperties;
@@ -53,26 +53,27 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
 
-public class TestServerSideScriptingCaller extends CaosDBTestClass {
+public class TestServerSideScriptingCaller {
 
-  public static File testFolder =
-      TEST_DIR.toPath().resolve("serverSideScriptingCallerTestFolder").toFile();
-  public static File testFile = testFolder.toPath().resolve("TestFile").toFile();
-  public static File testExecutable = testFolder.toPath().resolve("TestScript").toFile();
+  public static File testFolder = null;
+  public static File testFile = null;
+  public static File testExecutable = null;
   final Map<String, String> emptyEnv = new HashMap<String, String>();
 
   @BeforeAll
   public static void setupTestFolder() throws IOException {
+    testFolder = Files.createTempDirectory(".TestDir_ServerSideScripting").toFile();
     CaosDBServer.initServerProperties();
     CaosDBServer.getServerProperties()
         .setProperty(
             ServerProperties.KEY_SERVER_SIDE_SCRIPTING_BIN_DIRS, testFolder.getAbsolutePath());
 
+    testFile = testFolder.toPath().resolve("TestFile").toFile();
+    testExecutable = testFolder.toPath().resolve("TestScript").toFile();
     FileUtils.forceDeleteOnExit(testFolder);
     FileUtils.forceDeleteOnExit(testFile);
     FileUtils.forceDeleteOnExit(testExecutable);
 
-    assertFalse(testFolder.exists());
     assertFalse(testFile.exists());
     assertFalse(testExecutable.exists());
     testFolder.mkdirs();
diff --git a/src/test/java/org/caosdb/server/utils/mail/TestMail.java b/src/test/java/org/caosdb/server/utils/mail/TestMail.java
index 0156f9cafe1c5e9a4d4158d8e9ae7cdd97d57ffe..05cf5bf5698831ffbb68fc3a76836c4587d15f14 100644
--- a/src/test/java/org/caosdb/server/utils/mail/TestMail.java
+++ b/src/test/java/org/caosdb/server/utils/mail/TestMail.java
@@ -22,20 +22,33 @@
  */
 package org.caosdb.server.utils.mail;
 
+import java.io.File;
 import java.io.IOException;
-import org.caosdb.CaosDBTestClass;
+import java.nio.file.Files;
+import org.apache.commons.io.FileUtils;
 import org.caosdb.server.CaosDBServer;
 import org.caosdb.server.ServerProperties;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
-public class TestMail extends CaosDBTestClass {
+public class TestMail {
+
+  public static File testDir = null;
+
   @BeforeAll
   public static void setupUp() throws IOException {
+    testDir = Files.createTempDirectory(".TestDir_Mail").toFile();
+
     CaosDBServer.initServerProperties();
     // output mails to the test dir
     CaosDBServer.setProperty(
-        ServerProperties.KEY_MAIL_TO_FILE_HANDLER_LOC, TEST_DIR.getAbsolutePath());
+        ServerProperties.KEY_MAIL_TO_FILE_HANDLER_LOC, testDir.getAbsolutePath());
+  }
+
+  @AfterAll
+  public static void tearDown() throws IOException {
+    FileUtils.deleteDirectory(testDir);
   }
 
   @Test