Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Upgrade to powsybl ws dependencies 2.17.0 #88

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ public void visitGenerator(Generator generator) {
assertNull(voltageLevel1.getNodeBreakerView().getTerminal(4));
List<Integer> traversedNodes = new ArrayList<>();
voltageLevel1.getNodeBreakerView().traverse(2, (node1, sw, node2) -> {
traversedNodes.add(node1);
if (!traversedNodes.contains(node1)) {
traversedNodes.add(node1);
}
return TraverseResult.CONTINUE;
});
assertEquals(Arrays.asList(2, 3, 0, 1, 6), traversedNodes);
assertEquals(Arrays.asList(2, 3, 0, 1, 6, 5), traversedNodes);
}
}

Expand Down Expand Up @@ -681,9 +683,9 @@ void testSubstationUpdate() {
s.setTso("New TSO");
s.addGeographicalTag("paris");

verify(mockedListener, times(1)).onUpdate(s, "country", Country.FR, Country.BB);
verify(mockedListener, times(1)).onUpdate(s, "tso", null, "New TSO");
verify(mockedListener, times(1)).onElementAdded(s, "geographicalTags", "paris");
verify(mockedListener, times(1)).onUpdate(s, "country", INITIAL_VARIANT_ID, Country.FR, Country.BB);
verify(mockedListener, times(1)).onUpdate(s, "tso", INITIAL_VARIANT_ID, null, "New TSO");
verify(mockedListener, times(1)).onPropertyAdded(s, "geographicalTags", "paris");

service.flush(readNetwork);
}
Expand Down Expand Up @@ -733,14 +735,14 @@ void substationTest() {
assertEquals(Country.BE, s1.getCountry().get());
assertEquals("TSO_BE", s1.getTso());

verify(mockedListener, times(1)).onUpdate(s1, "country", Country.FR, Country.BE);
verify(mockedListener, times(1)).onUpdate(s1, "tso", "TSO_FR", "TSO_BE");
verify(mockedListener, times(1)).onElementAdded(s1, "geographicalTags", "BELGIUM");
verify(mockedListener, times(1)).onUpdate(s1, "country", INITIAL_VARIANT_ID, Country.FR, Country.BE);
verify(mockedListener, times(1)).onUpdate(s1, "tso", INITIAL_VARIANT_ID, "TSO_FR", "TSO_BE");
verify(mockedListener, times(1)).onPropertyAdded(s1, "geographicalTags", "BELGIUM");

s1.setProperty("testProperty", "original");
verify(mockedListener, times(1)).onElementAdded(s1, "properties[testProperty]", "original");
verify(mockedListener, times(1)).onPropertyAdded(s1, "properties[testProperty]", "original");
s1.setProperty("testProperty", "modified");
verify(mockedListener, times(1)).onElementReplaced(s1, "properties[testProperty]", "original", "modified");
verify(mockedListener, times(1)).onPropertyReplaced(s1, "properties[testProperty]", "original", "modified");
}
}

Expand Down Expand Up @@ -785,9 +787,9 @@ void voltageLevelTest() {
assertEquals(370, vl1.getLowVoltageLimit(), 0.1);
assertEquals(390, vl1.getHighVoltageLimit(), 0.1);

verify(mockedListener, times(1)).onUpdate(vl1, "nominalV", 400d, 380d);
verify(mockedListener, times(1)).onUpdate(vl1, "lowVoltageLimit", 385d, 370d);
verify(mockedListener, times(1)).onUpdate(vl1, "highVoltageLimit", 415d, 390d);
verify(mockedListener, times(1)).onUpdate(vl1, "nominalV", INITIAL_VARIANT_ID, 400d, 380d);
verify(mockedListener, times(1)).onUpdate(vl1, "lowVoltageLimit", INITIAL_VARIANT_ID, 385d, 370d);
verify(mockedListener, times(1)).onUpdate(vl1, "highVoltageLimit", INITIAL_VARIANT_ID, 415d, 390d);
}
}

Expand Down Expand Up @@ -865,12 +867,12 @@ void lineTest() {
assertEquals(8, line.getB1(), 0.1);
assertEquals(16, line.getB2(), 0.1);

verify(mockedListener, times(1)).onUpdate(line, "r", 1d, 5d);
verify(mockedListener, times(1)).onUpdate(line, "x", 3d, 6d);
verify(mockedListener, times(1)).onUpdate(line, "g1", 4d, 12d);
verify(mockedListener, times(1)).onUpdate(line, "g2", 8d, 24d);
verify(mockedListener, times(1)).onUpdate(line, "b1", 2d, 8d);
verify(mockedListener, times(1)).onUpdate(line, "b2", 4d, 16d);
verify(mockedListener, times(1)).onUpdate(line, "r", null, 1d, 5d);
verify(mockedListener, times(1)).onUpdate(line, "x", INITIAL_VARIANT_ID, 3d, 6d);
verify(mockedListener, times(1)).onUpdate(line, "g1", INITIAL_VARIANT_ID, 4d, 12d);
verify(mockedListener, times(1)).onUpdate(line, "g2", INITIAL_VARIANT_ID, 8d, 24d);
verify(mockedListener, times(1)).onUpdate(line, "b1", INITIAL_VARIANT_ID, 2d, 8d);
verify(mockedListener, times(1)).onUpdate(line, "b2", INITIAL_VARIANT_ID, 4d, 16d);
}
}

Expand Down Expand Up @@ -927,8 +929,8 @@ void batteryTest() {

battery.setMaxP(90);
battery.setMinP(50);
verify(mockedListener, times(1)).onUpdate(battery, "maxP", 70d, 90d);
verify(mockedListener, times(1)).onUpdate(battery, "minP", 40d, 50d);
verify(mockedListener, times(1)).onUpdate(battery, "maxP", INITIAL_VARIANT_ID, 70d, 90d);
verify(mockedListener, times(1)).onUpdate(battery, "minP", INITIAL_VARIANT_ID, 40d, 50d);
}
}

Expand Down Expand Up @@ -1082,18 +1084,18 @@ void danglingLineTest() {
danglingLine.getGeneration().setVoltageRegulationOn(false);

// Check update notification
verify(mockedListener, times(1)).onUpdate(danglingLine, "r", 27d, 25d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "x", 44d, 48d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "g", 89d, 83d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "b", 11d, 15d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "r", INITIAL_VARIANT_ID, 27d, 25d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "x", INITIAL_VARIANT_ID, 44d, 48d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "g", INITIAL_VARIANT_ID, 89d, 83d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "b", INITIAL_VARIANT_ID, 11d, 15d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "p0", INITIAL_VARIANT_ID, 533d, 520d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "q0", INITIAL_VARIANT_ID, 242d, 250d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "minP", 10d, 20d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "maxP", 500d, 900d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "minP", INITIAL_VARIANT_ID, 10d, 20d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "maxP", INITIAL_VARIANT_ID, 500d, 900d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "targetP", INITIAL_VARIANT_ID, 100d, 300d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "targetQ", INITIAL_VARIANT_ID, 200d, 1100d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "targetV", INITIAL_VARIANT_ID, 300d, 350d);
verify(mockedListener, times(1)).onUpdate(danglingLine, "voltageRegulationOn", true, false);
verify(mockedListener, times(1)).onUpdate(danglingLine, "voltageRegulationOn", INITIAL_VARIANT_ID, true, false);

readNetwork.removeListener(mockedListener);

Expand Down Expand Up @@ -1506,14 +1508,14 @@ void twoWindingsTransformerTest() {
assertEquals(120, twoWindingsTransformer.getRatedU2(), 0.1);
assertEquals(100, twoWindingsTransformer.getRatedS(), 0.1);

verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "r", 250d, 280d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "x", 100d, 130d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "g", 52d, 82d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "b", 12d, 42d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedU1", 65d, 95d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedU2", 90d, 120d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedS", 50d, 100d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "fictitious", false, true);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "r", INITIAL_VARIANT_ID, 250d, 280d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "x", INITIAL_VARIANT_ID, 100d, 130d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "g", INITIAL_VARIANT_ID, 52d, 82d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "b", INITIAL_VARIANT_ID, 12d, 42d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedU1", INITIAL_VARIANT_ID, 65d, 95d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedU2", INITIAL_VARIANT_ID, 90d, 120d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "ratedS", INITIAL_VARIANT_ID, 50d, 100d);
verify(mockedListener, times(1)).onUpdate(twoWindingsTransformer, "fictitious", null, false, true);

readNetwork.removeListener(mockedListener);
}
Expand Down
22 changes: 2 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

<properties>
<sirocco.version>1.0</sirocco.version>
<powsybl-ws-dependencies.version>2.16.0</powsybl-ws-dependencies.version>
<powsybl-network-store.version>1.21.0-SNAPSHOT</powsybl-network-store.version>
<powsybl-ws-dependencies.version>2.17.0</powsybl-ws-dependencies.version>

<!-- FIXME : to remove when sonar version is updated on github actions -->
<!-- https://community.sonarsource.com/t/stackoverflowerror-at-defaultinputcomponent-equals/20324 -->
<!-- The versions are very different from this post. But the fix works again. Maybe a similar problem in sonar code -->
Expand Down Expand Up @@ -81,24 +81,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-client</artifactId>
<!-- FIXME: to be removed at next powsybl-ws-dependencies upgrade -->
<version>${powsybl-network-store.version}</version>
</dependency>
<!-- FIXME: to be removed at next powsybl-ws-dependencies upgrade -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-iidm-impl</artifactId>
<version>${powsybl-network-store.version}</version>
</dependency>
<!-- FIXME: to be removed at next powsybl-ws-dependencies upgrade -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-model</artifactId>
<version>${powsybl-network-store.version}</version>
</dependency>

<!-- project specific dependencies -->
<dependency>
Expand Down
Loading