From f2733ede942e287a56b1177fd0af88fc97846209 Mon Sep 17 00:00:00 2001
From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de>
Date: Sat, 1 May 2021 20:36:04 +0200
Subject: [PATCH] Add last test case

---
 .../kotlin/theodolite/ResourceLimitPatcherTest.kt    |  2 +-
 .../kotlin/theodolite/ResourceRequestPatcherTest.kt  |  2 +-
 .../src/test/kotlin/theodolite/util/IOHandlerTest.kt | 12 +++++++++++-
 .../testYaml => test/resources}/cpu-deployment.yaml  |  0
 .../resources}/cpu-memory-deployment.yaml            |  0
 .../resources}/memory-deployment.yaml                |  0
 .../resources}/no-resources-deployment.yaml          |  0
 7 files changed, 13 insertions(+), 3 deletions(-)
 rename theodolite-quarkus/src/{main/resources/testYaml => test/resources}/cpu-deployment.yaml (100%)
 rename theodolite-quarkus/src/{main/resources/testYaml => test/resources}/cpu-memory-deployment.yaml (100%)
 rename theodolite-quarkus/src/{main/resources/testYaml => test/resources}/memory-deployment.yaml (100%)
 rename theodolite-quarkus/src/{main/resources/testYaml => test/resources}/no-resources-deployment.yaml (100%)

diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
index 82e4bc5d7..4f4308a35 100644
--- a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
+++ b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceLimitPatcherTest.kt
@@ -21,7 +21,7 @@ import theodolite.util.PatcherDefinition
  */
 @QuarkusTest
 class ResourceLimitPatcherTest {
-    val testPath = "./src/main/resources/testYaml/"
+    val testPath = "./src/test/resources/"
     val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(""))
     val patcherFactory = PatcherFactory()
 
diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
index 3cd6b012f..721442270 100644
--- a/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
+++ b/theodolite-quarkus/src/test/kotlin/theodolite/ResourceRequestPatcherTest.kt
@@ -21,7 +21,7 @@ import theodolite.util.PatcherDefinition
  */
 @QuarkusTest
 class ResourceRequestPatcherTest {
-    val testPath = "./src/main/resources/testYaml/"
+    val testPath = "./src/test/resources/"
     val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(""))
     val patcherFactory = PatcherFactory()
 
diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt
index 062994df5..6984c3935 100644
--- a/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt
+++ b/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt
@@ -79,7 +79,7 @@ internal class IOHandlerTest {
         )
     }
 
-    // Test the function `getResultFolderString
+    // Test the function `getResultFolderString`
 
     @Test
     @ClearEnvironmentVariable.ClearEnvironmentVariables(
@@ -90,6 +90,16 @@ internal class IOHandlerTest {
         assertEquals("",IOHandler().getResultFolderURL())
     }
 
+
+    @Test()
+    @SetEnvironmentVariable.SetEnvironmentVariables(
+        SetEnvironmentVariable(key = "RESULTS_FOLDER", value = "./src/test/resources"),
+        SetEnvironmentVariable(key = "CREATE_RESULTS_FOLDER", value = "false")
+    )
+    fun testGetResultFolderURL_FolderExist() {
+        assertEquals("./src/test/resources/", IOHandler().getResultFolderURL())
+    }
+
     @Test()
     @SetEnvironmentVariable.SetEnvironmentVariables(
         SetEnvironmentVariable(key = "RESULTS_FOLDER", value = "$FOLDER_URL-0"),
diff --git a/theodolite-quarkus/src/main/resources/testYaml/cpu-deployment.yaml b/theodolite-quarkus/src/test/resources/cpu-deployment.yaml
similarity index 100%
rename from theodolite-quarkus/src/main/resources/testYaml/cpu-deployment.yaml
rename to theodolite-quarkus/src/test/resources/cpu-deployment.yaml
diff --git a/theodolite-quarkus/src/main/resources/testYaml/cpu-memory-deployment.yaml b/theodolite-quarkus/src/test/resources/cpu-memory-deployment.yaml
similarity index 100%
rename from theodolite-quarkus/src/main/resources/testYaml/cpu-memory-deployment.yaml
rename to theodolite-quarkus/src/test/resources/cpu-memory-deployment.yaml
diff --git a/theodolite-quarkus/src/main/resources/testYaml/memory-deployment.yaml b/theodolite-quarkus/src/test/resources/memory-deployment.yaml
similarity index 100%
rename from theodolite-quarkus/src/main/resources/testYaml/memory-deployment.yaml
rename to theodolite-quarkus/src/test/resources/memory-deployment.yaml
diff --git a/theodolite-quarkus/src/main/resources/testYaml/no-resources-deployment.yaml b/theodolite-quarkus/src/test/resources/no-resources-deployment.yaml
similarity index 100%
rename from theodolite-quarkus/src/main/resources/testYaml/no-resources-deployment.yaml
rename to theodolite-quarkus/src/test/resources/no-resources-deployment.yaml
-- 
GitLab