summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-power
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-30 15:37:35 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:40 +0200
commita2ce07026bf3ef17326e72f395dfa2dd9d9b17be (patch)
tree347cd882148b43808bdd146fb7870b00103e5e6b /opendc-simulator/opendc-simulator-power
parent4f5a1f88d0c6aa19ce4cab0ec7b9b13a24c92fbe (diff)
refactor(simulator): Create separate callbacks for remaining events
This change creates separate callbacks for the remaining events: onStart, onStop and onConverge.
Diffstat (limited to 'opendc-simulator/opendc-simulator-power')
-rw-r--r--opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPduTest.kt3
-rw-r--r--opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPowerSourceTest.kt3
-rw-r--r--opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimUpsTest.kt3
3 files changed, 3 insertions, 6 deletions
diff --git a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPduTest.kt b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPduTest.kt
index ff447703..85b9ab01 100644
--- a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPduTest.kt
+++ b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPduTest.kt
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.opendc.simulator.core.runBlockingSimulation
import org.opendc.simulator.flow.FlowEngine
-import org.opendc.simulator.flow.FlowEvent
import org.opendc.simulator.flow.FlowSource
import org.opendc.simulator.flow.source.FixedFlowSource
@@ -87,7 +86,7 @@ internal class SimPduTest {
outlet.connect(inlet)
outlet.disconnect()
- verify { consumer.onEvent(any(), any(), FlowEvent.Exit) }
+ verify { consumer.onStop(any(), any(), any()) }
}
@Test
diff --git a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPowerSourceTest.kt b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPowerSourceTest.kt
index b411e292..20677633 100644
--- a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPowerSourceTest.kt
+++ b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimPowerSourceTest.kt
@@ -32,7 +32,6 @@ import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows
import org.opendc.simulator.core.runBlockingSimulation
import org.opendc.simulator.flow.FlowEngine
-import org.opendc.simulator.flow.FlowEvent
import org.opendc.simulator.flow.FlowSource
import org.opendc.simulator.flow.source.FixedFlowSource
@@ -86,7 +85,7 @@ internal class SimPowerSourceTest {
source.connect(inlet)
source.disconnect()
- verify { consumer.onEvent(any(), any(), FlowEvent.Exit) }
+ verify { consumer.onStop(any(), any(), any()) }
}
@Test
diff --git a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimUpsTest.kt b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimUpsTest.kt
index 31ac0b39..c6e0605a 100644
--- a/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimUpsTest.kt
+++ b/opendc-simulator/opendc-simulator-power/src/test/kotlin/org/opendc/simulator/power/SimUpsTest.kt
@@ -29,7 +29,6 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.opendc.simulator.core.runBlockingSimulation
import org.opendc.simulator.flow.FlowEngine
-import org.opendc.simulator.flow.FlowEvent
import org.opendc.simulator.flow.FlowSource
import org.opendc.simulator.flow.source.FixedFlowSource
@@ -93,7 +92,7 @@ internal class SimUpsTest {
ups.connect(inlet)
ups.disconnect()
- verify { consumer.onEvent(any(), any(), FlowEvent.Exit) }
+ verify { consumer.onStop(any(), any(), any()) }
}
class SimpleInlet : SimPowerInlet() {