diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-05 14:10:11 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-05 14:10:11 +0200 |
| commit | be176910eb870209576326ffaad8bf21241fccbd (patch) | |
| tree | 3903d8aed5e87850c92e1b2dce8379ea99bdfa6d /opendc-simulator/opendc-simulator-network/src | |
| parent | c214a7fe0d46ecc23a71f9237b20281c0ca1c929 (diff) | |
refactor(sim/core): Rename runBlockingSimulation to runSimulation
This change renames the method `runBlockingSimulation` to
`runSimulation` to put more emphasis on the simulation part of the
method. The blocking part is not that important, but this behavior is
still described in the method documentation.
Diffstat (limited to 'opendc-simulator/opendc-simulator-network/src')
2 files changed, 11 insertions, 11 deletions
diff --git a/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSinkTest.kt b/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSinkTest.kt index 8e95f2b0..944c4d6a 100644 --- a/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSinkTest.kt +++ b/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSinkTest.kt @@ -32,14 +32,14 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows import org.opendc.simulator.flow.* import org.opendc.simulator.flow.source.FixedFlowSource -import org.opendc.simulator.kotlin.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation /** * Test suite for the [SimNetworkSink] class. */ class SimNetworkSinkTest { @Test - fun testInitialState() = runBlockingSimulation { + fun testInitialState() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) @@ -49,7 +49,7 @@ class SimNetworkSinkTest { } @Test - fun testDisconnectIdempotent() = runBlockingSimulation { + fun testDisconnectIdempotent() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) @@ -58,7 +58,7 @@ class SimNetworkSinkTest { } @Test - fun testConnectCircular() = runBlockingSimulation { + fun testConnectCircular() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) @@ -68,7 +68,7 @@ class SimNetworkSinkTest { } @Test - fun testConnectAlreadyConnectedTarget() = runBlockingSimulation { + fun testConnectAlreadyConnectedTarget() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val source = mockk<SimNetworkPort>(relaxUnitFun = true) @@ -80,7 +80,7 @@ class SimNetworkSinkTest { } @Test - fun testConnectAlreadyConnected() = runBlockingSimulation { + fun testConnectAlreadyConnected() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val source1 = Source(engine) @@ -96,7 +96,7 @@ class SimNetworkSinkTest { } @Test - fun testConnect() = runBlockingSimulation { + fun testConnect() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val source = spyk(Source(engine)) @@ -112,7 +112,7 @@ class SimNetworkSinkTest { } @Test - fun testDisconnect() = runBlockingSimulation { + fun testDisconnect() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val source = spyk(Source(engine)) diff --git a/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtualTest.kt b/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtualTest.kt index b45b150d..ff6cb66e 100644 --- a/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtualTest.kt +++ b/opendc-simulator/opendc-simulator-network/src/test/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtualTest.kt @@ -29,14 +29,14 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opendc.simulator.flow.* import org.opendc.simulator.flow.source.FixedFlowSource -import org.opendc.simulator.kotlin.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation /** * Test suite for the [SimNetworkSwitchVirtual] class. */ class SimNetworkSwitchVirtualTest { @Test - fun testConnect() = runBlockingSimulation { + fun testConnect() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val source = spyk(Source(engine)) @@ -54,7 +54,7 @@ class SimNetworkSwitchVirtualTest { } @Test - fun testConnectClosedPort() = runBlockingSimulation { + fun testConnectClosedPort() = runSimulation { val engine = FlowEngine(coroutineContext, clock) val sink = SimNetworkSink(engine, capacity = 100.0) val switch = SimNetworkSwitchVirtual(engine) |
