From 1461740584b51b83ba637a89f17f32435dc5e3a0 Mon Sep 17 00:00:00 2001 From: Florian Dupuy Date: Tue, 21 Jan 2025 16:34:22 +0100 Subject: [PATCH] Make the unit test more complex to fail Signed-off-by: Florian Dupuy --- .../topology/RemoveVoltageLevelTest.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/topology/RemoveVoltageLevelTest.java b/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/topology/RemoveVoltageLevelTest.java index c81969a0ed5..a8d5e77041b 100644 --- a/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/topology/RemoveVoltageLevelTest.java +++ b/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/topology/RemoveVoltageLevelTest.java @@ -53,21 +53,24 @@ public void afterRemoval(String id) { } @Test - void testFaultyRemoveVoltageLevel() { + void testLoops() { Network network = Network.create("test", "test"); var s = network.newSubstation().setId("s").add(); - // First voltage level (which will be removed) + // First voltage level (which will be removed): + // two busbars linked with a coupler, two lines, one diamond-shaped cell (two breakers in parallel) var vl1 = s.newVoltageLevel().setId("vl1").setTopologyKind(TopologyKind.NODE_BREAKER).setNominalV(225).add(); vl1.getNodeBreakerView().newBusbarSection().setId("bbs1").setNode(0).add(); vl1.getNodeBreakerView().newBusbarSection().setId("bbs2").setNode(1).add(); vl1.getNodeBreakerView().newSwitch().setId("Coupler").setNode1(0).setNode2(1).setKind(SwitchKind.BREAKER).add(); vl1.getNodeBreakerView().newSwitch().setId("d_l1_bbs1").setNode1(0).setNode2(2).setKind(SwitchKind.DISCONNECTOR).add(); - vl1.getNodeBreakerView().newSwitch().setId("d_l2_bbs1").setNode1(0).setNode2(3).setKind(SwitchKind.DISCONNECTOR).add(); vl1.getNodeBreakerView().newSwitch().setId("d_l1_bbs2").setNode1(1).setNode2(2).setKind(SwitchKind.DISCONNECTOR).add(); + vl1.getNodeBreakerView().newSwitch().setId("d_l2_bbs1").setNode1(0).setNode2(3).setKind(SwitchKind.DISCONNECTOR).add(); vl1.getNodeBreakerView().newSwitch().setId("d_l2_bbs2").setNode1(1).setNode2(3).setKind(SwitchKind.DISCONNECTOR).add(); + vl1.getNodeBreakerView().newSwitch().setId("b_l2_bbs2_A").setNode1(3).setNode2(4).setKind(SwitchKind.BREAKER).setOpen(true).add(); + vl1.getNodeBreakerView().newSwitch().setId("b_l2_bbs2_B").setNode1(3).setNode2(4).setKind(SwitchKind.BREAKER).setOpen(false).add(); - // Second voltage level + // Second voltage level, only there to host the lines var vl2 = s.newVoltageLevel().setId("vl2").setTopologyKind(TopologyKind.NODE_BREAKER).setNominalV(225).add(); vl2.getNodeBreakerView().newBusbarSection().setId("bbs").setNode(0).add(); vl2.getNodeBreakerView().newInternalConnection().setNode1(0).setNode2(1).add(); @@ -76,7 +79,7 @@ void testFaultyRemoveVoltageLevel() { // Parallel lines between voltage levels var line1 = network.newLine().setId("line1").setVoltageLevel1(vl1.getId()).setVoltageLevel2(vl2.getId()).setNode1(2).setNode2(1) .setR(0.01).setX(20.0).setG1(0.0).setB1(0.0).setG2(0.0).setB2(0.0).add(); - network.newLine(line1).setId("line2").setNode1(3).setNode2(2).add(); + network.newLine(line1).setId("line2").setNode1(4).setNode2(2).add(); addListener(network);