summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-resources/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-29 22:20:48 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:39 +0200
commitdd605ab1f70fef1fbbed848e8ebbd6b231622273 (patch)
tree1ba3b4a9c909738d4b6f21478456257bed649e6e /opendc-simulator/opendc-simulator-resources/src/test
parentd2f15fd7fd16922c11b0dcaa8807e8a321859773 (diff)
refactor(simulator): Remove transform from SimResourceForwarder
This change removes the ability to transform the duration of a pull from the SimResourceForwarder class. This ability is not used anymore, since pushes are now done using a method instead of a command.
Diffstat (limited to 'opendc-simulator/opendc-simulator-resources/src/test')
-rw-r--r--opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceForwarderTest.kt (renamed from opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceTransformerTest.kt)18
1 files changed, 2 insertions, 16 deletions
diff --git a/opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceTransformerTest.kt b/opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceForwarderTest.kt
index d7d0924f..49e60f68 100644
--- a/opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceTransformerTest.kt
+++ b/opendc-simulator/opendc-simulator-resources/src/test/kotlin/org/opendc/simulator/resources/SimResourceForwarderTest.kt
@@ -33,9 +33,9 @@ import org.opendc.simulator.resources.consumer.SimWorkConsumer
import org.opendc.simulator.resources.impl.SimResourceInterpreterImpl
/**
- * A test suite for the [SimResourceTransformer] class.
+ * A test suite for the [SimResourceForwarder] class.
*/
-internal class SimResourceTransformerTest {
+internal class SimResourceForwarderTest {
@Test
fun testCancelImmediately() = runBlockingSimulation {
val forwarder = SimResourceForwarder()
@@ -199,20 +199,6 @@ internal class SimResourceTransformerTest {
}
@Test
- fun testTransformExit() = runBlockingSimulation {
- val forwarder = SimResourceTransformer { ctx, _ -> ctx.close(); Long.MAX_VALUE }
- val scheduler = SimResourceInterpreterImpl(coroutineContext, clock)
- val source = SimResourceSource(1.0, scheduler)
-
- val consumer = spyk(SimWorkConsumer(2.0, 1.0))
- source.startConsumer(forwarder)
- forwarder.consume(consumer)
-
- assertEquals(0, clock.millis())
- verify(exactly = 1) { consumer.onNext(any(), any(), any()) }
- }
-
- @Test
fun testCounters() = runBlockingSimulation {
val forwarder = SimResourceForwarder()
val scheduler = SimResourceInterpreterImpl(coroutineContext, clock)