Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into constraints_modifier_config_multiple_count…
…ries
- Loading branch information
Showing
5 changed files
with
132 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...t/java/eu/itesla_project/iidm/network/impl/NodeBreakerDisconnectionDoublePathBugTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.iidm.network.impl; | ||
|
||
import eu.itesla_project.iidm.network.*; | ||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class NodeBreakerDisconnectionDoublePathBugTest { | ||
|
||
private Network createNetwork() { | ||
Network network = NetworkFactory.create("test", "test"); | ||
Substation s = network.newSubstation() | ||
.setId("S") | ||
.setCountry(Country.FR) | ||
.add(); | ||
VoltageLevel vl = s.newVoltageLevel() | ||
.setId("VL") | ||
.setNominalV(400f) | ||
.setTopologyKind(TopologyKind.NODE_BREAKER) | ||
.add(); | ||
vl.getNodeBreakerView().setNodeCount(10); | ||
vl.getNodeBreakerView().newBusbarSection() | ||
.setId("BBS1") | ||
.setNode(0) | ||
.add(); | ||
vl.getNodeBreakerView().newBusbarSection() | ||
.setId("BBS2") | ||
.setNode(1) | ||
.add(); | ||
vl.newLoad() | ||
.setId("L") | ||
.setNode(2) | ||
.setP0(1) | ||
.setQ0(1) | ||
.add(); | ||
vl.getNodeBreakerView().newBreaker() | ||
.setId("BR0") | ||
.setNode1(2) | ||
.setNode2(3) | ||
.setOpen(false) | ||
.add(); | ||
vl.getNodeBreakerView().newBreaker() | ||
.setId("BR1") | ||
.setNode1(3) | ||
.setNode2(0) | ||
.setOpen(true) | ||
.add(); | ||
vl.getNodeBreakerView().newBreaker() | ||
.setId("BR2") | ||
.setNode1(3) | ||
.setNode2(1) | ||
.setOpen(false) | ||
.add(); | ||
return network; | ||
} | ||
|
||
@Test | ||
public void testOnePathAlreadyOpen() { | ||
Network network = createNetwork(); | ||
Load l = network.getLoad("L"); | ||
assertTrue(l.getTerminal().isConnected()); | ||
l.getTerminal().disconnect(); | ||
assertFalse(l.getTerminal().isConnected()); | ||
} | ||
|
||
@Test | ||
public void testBothPathClosed() { | ||
Network network = createNetwork(); | ||
Load l = network.getLoad("L"); | ||
network.getSwitch("BR1").setOpen(false); | ||
assertTrue(l.getTerminal().isConnected()); | ||
l.getTerminal().disconnect(); | ||
assertFalse(l.getTerminal().isConnected()); | ||
} | ||
} |