summaryrefslogtreecommitdiff
path: root/opendc-common
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 15:34:19 +0200
committerGitHub <noreply@github.com>2022-10-06 15:34:19 +0200
commit7ba3b953300c46b4e3afcde17cd3dd14b1af8406 (patch)
tree950ba678869ec868c26ab3b95b57e4cabadb23c7 /opendc-common
parentc2047d09b27b0c05f5c203509dde524e17d3b729 (diff)
parent47357afd16f928260db34d4dd3e686fb9ee7c5ff (diff)
merge: Update build and runtime dependencies (#107)
This pull request updates the build and runtime dependencies used by OpenDC to their latest version compatible with the project. ## Implementation Notes :hammer_and_pick: * Update simulator dependency versions * Remove unused distribution conventions * Update next version to 3.0 * Eliminate use of wildcard imports * Switch to Spotless for formatting
Diffstat (limited to 'opendc-common')
-rw-r--r--opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt4
-rw-r--r--opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt8
-rw-r--r--opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt5
-rw-r--r--opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt8
4 files changed, 16 insertions, 9 deletions
diff --git a/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt b/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt
index 8ccff6c3..edf607d2 100644
--- a/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt
+++ b/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt
@@ -22,7 +22,9 @@
package org.opendc.common.util
-import kotlinx.coroutines.*
+import kotlinx.coroutines.Delay
+import kotlinx.coroutines.DisposableHandle
+import kotlinx.coroutines.InternalCoroutinesApi
import java.lang.Runnable
import java.time.Clock
import kotlin.coroutines.ContinuationInterceptor
diff --git a/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt b/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt
index bec2c9f1..44d6010f 100644
--- a/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt
+++ b/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt
@@ -22,9 +22,12 @@
package org.opendc.common.util
-import kotlinx.coroutines.*
+import kotlinx.coroutines.Delay
+import kotlinx.coroutines.DisposableHandle
+import kotlinx.coroutines.InternalCoroutinesApi
import java.time.Clock
-import java.util.*
+import java.util.ArrayDeque
+import java.util.PriorityQueue
import kotlin.coroutines.ContinuationInterceptor
import kotlin.coroutines.CoroutineContext
@@ -34,7 +37,6 @@ import kotlin.coroutines.CoroutineContext
* @param context The [CoroutineContext] to run the tasks with.
* @param clock The clock to keep track of the time.
*/
-@OptIn(ExperimentalCoroutinesApi::class)
public class TimerScheduler<T>(private val context: CoroutineContext, private val clock: Clock) {
/**
* The [Delay] instance that provides scheduled execution of [Runnable]s.
diff --git a/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt
index de9fd472..3fae2ebc 100644
--- a/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt
+++ b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt
@@ -23,7 +23,10 @@
package org.opendc.common.util
import kotlinx.coroutines.delay
-import org.junit.jupiter.api.Assertions.*
+import org.junit.jupiter.api.Assertions.assertDoesNotThrow
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Assertions.assertFalse
+import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.opendc.simulator.kotlin.runSimulation
diff --git a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
index 183ab66a..22a26111 100644
--- a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
+++ b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
@@ -22,8 +22,10 @@
package org.opendc.common.util
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import org.junit.jupiter.api.Assertions.*
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Assertions.assertFalse
+import org.junit.jupiter.api.Assertions.assertTrue
+import org.junit.jupiter.api.Assertions.fail
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.opendc.simulator.kotlin.runSimulation
@@ -33,7 +35,6 @@ import kotlin.coroutines.EmptyCoroutineContext
/**
* A test suite for the [TimerScheduler] class.
*/
-@OptIn(ExperimentalCoroutinesApi::class)
internal class TimerSchedulerTest {
@Test
fun testEmptyContext() {
@@ -99,7 +100,6 @@ internal class TimerSchedulerTest {
scheduler.startSingleTimer(0, 1000) { fail() }
scheduler.startSingleTimer(0, 200) {
-
assertEquals(200, clock.millis())
}
}