diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-10-01 10:42:36 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-10-01 10:47:44 +0200 |
| commit | ebd375d524714708d7b38c0117a77d50d23043a3 (patch) | |
| tree | bb246d18f86e551dd01f92658c6ef2b14a608fc6 /simulator/opendc-format/src/test | |
| parent | afee4c550515dc2f6021be33f58823d279980246 (diff) | |
Add test case for WTA trace parser
Diffstat (limited to 'simulator/opendc-format/src/test')
2 files changed, 46 insertions, 0 deletions
diff --git a/simulator/opendc-format/src/test/kotlin/org/opendc/format/trace/wtf/WtfTraceReaderTest.kt b/simulator/opendc-format/src/test/kotlin/org/opendc/format/trace/wtf/WtfTraceReaderTest.kt new file mode 100644 index 00000000..58d96657 --- /dev/null +++ b/simulator/opendc-format/src/test/kotlin/org/opendc/format/trace/wtf/WtfTraceReaderTest.kt @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 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.format.trace.wtf + +import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Test + +/** + * Test suite for the [WtfTraceReader] class. + */ +class WtfTraceReaderTest { + /** + * Smoke test for parsing WTF traces. + */ + @Test + fun testParseWtf() { + val reader = WtfTraceReader("src/test/resources/wtf-trace") + var entry = reader.next() + assertEquals(0, entry.submissionTime) + assertEquals(23, entry.workload.tasks.size) + + entry = reader.next() + assertEquals(333387, entry.submissionTime) + assertEquals(23, entry.workload.tasks.size) + } +} diff --git a/simulator/opendc-format/src/test/resources/wtf-trace/tasks/schema-1.0/part.0.parquet b/simulator/opendc-format/src/test/resources/wtf-trace/tasks/schema-1.0/part.0.parquet Binary files differnew file mode 100644 index 00000000..d2044038 --- /dev/null +++ b/simulator/opendc-format/src/test/resources/wtf-trace/tasks/schema-1.0/part.0.parquet |
