summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-compute/src/test
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2024-01-08 13:44:09 +0100
committerGitHub <noreply@github.com>2024-01-08 13:44:09 +0100
commit616017ba78a0882fe38b9b171b2b0f68e593cd8d (patch)
tree9cc4c20078ae10d169c90cbce5b898226a7eee9d /opendc-experiments/opendc-experiments-compute/src/test
parentc57468c5040a838de6901972b6e49a8548d908d6 (diff)
refactored opendc-experiment-compute (#190)
* removed experiment-compute and integrated all components into opendc-compute * updated workflow gradle file * removed unneeded code
Diffstat (limited to 'opendc-experiments/opendc-experiments-compute/src/test')
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/HostDataWriterTest.kt78
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServerDataWriterTest.kt67
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServiceDataWriterTest.kt64
3 files changed, 0 insertions, 209 deletions
diff --git a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/HostDataWriterTest.kt b/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/HostDataWriterTest.kt
deleted file mode 100644
index 1cd9f20b..00000000
--- a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/HostDataWriterTest.kt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2022 AtLarge Research
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package org.opendc.experiments.compute.export.parquet
-
-import org.junit.jupiter.api.AfterEach
-import java.nio.file.Files
-
-/**
- * Test suite for [ParquetHostDataWriter]
- */
-class HostDataWriterTest {
- /**
- * The path to write the data file to.
- */
- private val path = Files.createTempFile("opendc", "parquet")
-
- /**
- * The writer used to write the data.
- */
- private val writer = ParquetHostDataWriter(path.toFile(), bufferSize = 4096)
-
- @AfterEach
- fun tearDown() {
- writer.close()
- Files.deleteIfExists(path)
- }
-
-// @Test
-// fun testSmoke() {
-// assertDoesNotThrow {
-// writer.write(object : HostTableReader {
-// override val timestamp: Instant = Instant.now()
-// override val host: HostInfo = HostInfo("id", "test", "x86", 4, 4096)
-// override val guestsTerminated: Int = 0
-// override val guestsRunning: Int = 0
-// override val guestsError: Int = 0
-// override val guestsInvalid: Int = 0
-// override val cpuLimit: Double = 4096.0
-// override val cpuUsage: Double = 1.0
-// override val cpuDemand: Double = 1.0
-// override val cpuUtilization: Double = 0.0
-// override val cpuActiveTime: Long = 1
-// override val cpuIdleTime: Long = 1
-// override val cpuStealTime: Long = 1
-// override val cpuLostTime: Long = 1
-// override val powerUsage: Double = 1.0
-// override val powerTotal: Double = 1.0
-// override val uptime: Long = 1
-// override val downtime: Long = 1
-// override val bootTime: Instant? = null
-//
-// // override fun copy(): HostTableReader {return HostTableReader}
-//
-// override fun setValues(table: HostTableReader) {}
-// })
-// }
-// }
-}
diff --git a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServerDataWriterTest.kt b/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServerDataWriterTest.kt
deleted file mode 100644
index 21bc799f..00000000
--- a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServerDataWriterTest.kt
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2022 AtLarge Research
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package org.opendc.experiments.compute.export.parquet
-
-import org.junit.jupiter.api.AfterEach
-import java.nio.file.Files
-
-/**
- * Test suite for [ParquetServerDataWriter]
- */
-class ServerDataWriterTest {
- /**
- * The path to write the data file to.
- */
- private val path = Files.createTempFile("opendc", "parquet")
-
- /**
- * The writer used to write the data.
- */
- private val writer = ParquetServerDataWriter(path.toFile(), bufferSize = 4096)
-
- @AfterEach
- fun tearDown() {
- writer.close()
- Files.deleteIfExists(path)
- }
-
-// @Test
-// fun testSmoke() {
-// assertDoesNotThrow {
-// writer.write(object : ServerTableReader {
-// override val timestamp: Instant = Instant.now()
-// override val server: ServerInfo = ServerInfo("id", "test", "vm", "x86", "test", "test", 2, 4096)
-// override val host: HostInfo = HostInfo("id", "test", "x86", 4, 4096)
-// override val cpuLimit: Double = 4096.0
-// override val cpuActiveTime: Long = 1
-// override val cpuIdleTime: Long = 1
-// override val cpuStealTime: Long = 1
-// override val cpuLostTime: Long = 1
-// override val uptime: Long = 1
-// override val downtime: Long = 1
-// override val provisionTime: Instant = timestamp
-// override val bootTime: Instant? = null
-// })
-// }
-// }
-}
diff --git a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServiceDataWriterTest.kt b/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServiceDataWriterTest.kt
deleted file mode 100644
index 0cbb0812..00000000
--- a/opendc-experiments/opendc-experiments-compute/src/test/kotlin/org/opendc/experiments/compute/export/parquet/ServiceDataWriterTest.kt
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2022 AtLarge Research
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package org.opendc.experiments.compute.export.parquet
-
-import org.junit.jupiter.api.AfterEach
-import java.nio.file.Files
-
-/**
- * Test suite for [ParquetServiceDataWriter]
- */
-class ServiceDataWriterTest {
- /**
- * The path to write the data file to.
- */
- private val path = Files.createTempFile("opendc", "parquet")
-
- /**
- * The writer used to write the data.
- */
- private val writer = ParquetServiceDataWriter(path.toFile(), bufferSize = 4096)
-
- @AfterEach
- fun tearDown() {
- writer.close()
- Files.deleteIfExists(path)
- }
-
-// @Test
-// fun testSmoke() {
-// assertDoesNotThrow {
-// writer.write(object : ServiceTableReader {
-// override val timestamp: Instant = Instant.now()
-// override val hostsUp: Int = 1
-// override val hostsDown: Int = 0
-// override val serversTotal: Int = 1
-// override val serversPending: Int = 1
-// override val serversActive: Int = 1
-// override val attemptsSuccess: Int = 1
-// override val attemptsFailure: Int = 0
-// override val attemptsError: Int = 0
-// })
-// }
-// }
-}