summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-wfformat/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-06-08 15:06:14 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-06-08 15:06:14 +0200
commit9d759c9bc987965fae8b0c16c000772c546bf3a2 (patch)
treebf20f51b434d56e60ad013568ac1a32b912a3b5e /opendc-trace/opendc-trace-wfformat/src/test
parentf7a5b200e4767213617774a87113d0b56d8d8a59 (diff)
test(trace): Add conformance suite for OpenDC trace API
This change adds a re-usable test suite for the interface of the OpenDC trace API, so implementors can verify whether they match the specification of the interfaces.
Diffstat (limited to 'opendc-trace/opendc-trace-wfformat/src/test')
-rw-r--r--opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt24
1 files changed, 21 insertions, 3 deletions
diff --git a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
index a460c5f6..40506d59 100644
--- a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
@@ -22,17 +22,20 @@
package org.opendc.trace.wfformat
-import org.junit.jupiter.api.Assertions
+import org.junit.jupiter.api.*
import org.junit.jupiter.api.Assertions.*
-import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.Assertions.assertAll
import org.junit.jupiter.api.assertDoesNotThrow
-import org.junit.jupiter.api.assertThrows
+import org.opendc.trace.TableColumn
+import org.opendc.trace.TableReader
import org.opendc.trace.conv.*
+import org.opendc.trace.testkit.TableReaderTestKit
import java.nio.file.Paths
/**
* Test suite for the [WfFormatTraceFormat] class.
*/
+@DisplayName("WfFormat TraceFormat")
class WfFormatTraceFormatTest {
private val format = WfFormatTraceFormat()
@@ -98,4 +101,19 @@ class WfFormatTraceFormatTest {
reader.close()
}
}
+
+ @DisplayName("TableReader for Tasks")
+ @Nested
+ inner class TasksTableReaderTest : TableReaderTestKit() {
+ override lateinit var reader: TableReader
+ override lateinit var columns: List<TableColumn>
+
+ @BeforeEach
+ fun setUp() {
+ val path = Paths.get("src/test/resources/trace.json")
+
+ columns = format.getDetails(path, TABLE_TASKS).columns
+ reader = format.newReader(path, TABLE_TASKS, null)
+ }
+ }
}