Skip to content

Commit b045896

Browse files
authored
Remove useless ReportNode locale report and set tests locale default to stabilize report node tests (#1225)
Signed-off-by: CARON Alice <alice.caron@rte-france.com>
1 parent 8159456 commit b045896

File tree

7 files changed

+25
-31
lines changed

7 files changed

+25
-31
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<groupId>org.apache.maven.plugins</groupId>
9393
<artifactId>maven-surefire-plugin</artifactId>
9494
<configuration>
95+
<argLine>-Duser.language=en -Duser.region=US</argLine>
9596
<classpathDependencyExcludes>
9697
<classpathDependencyExclude>com.powsybl:powsybl-config-classic</classpathDependencyExclude>
9798
</classpathDependencyExcludes>

src/main/java/com/powsybl/openloadflow/ac/outerloop/ReactiveLimitsOuterLoop.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,23 +187,23 @@ private static boolean switchPqPv(List<PqToPvBus> pqToPvBuses, ContextData conte
187187

188188
int pvPqSwitchCount = contextData.getPvPqSwitchCount(controllerBus.getId());
189189
if (pvPqSwitchCount >= maxPqPvSwitch) {
190-
pqPvNodes.add(Reports.reportPvPqSwitchLimit(reportNode, controllerBus, pvPqSwitchCount, log, LOGGER));
190+
pqPvNodes.add(Reports.createRootReportPvPqSwitchLimit(reportNode, controllerBus, pvPqSwitchCount, log, LOGGER));
191191
} else {
192192
controllerBus.setGeneratorVoltageControlEnabled(true);
193193
controllerBus.setGenerationTargetQ(0);
194194
controllerBus.setQLimitType(null);
195195
pqPvSwitchCount++;
196196

197197
if (pqToPvBus.limitType.isMaxLimit()) {
198-
pqPvNodes.add(Reports.reportPqToPvBusMaxLimit(
198+
pqPvNodes.add(Reports.createRootReportPqToPvBusMaxLimit(
199199
reportNode,
200200
controllerBus,
201201
controllerBus.getGeneratorVoltageControl().map(VoltageControl::getControlledBus).orElseThrow(),
202202
getBusTargetV(controllerBus),
203203
log,
204204
LOGGER));
205205
} else {
206-
pqPvNodes.add(Reports.reportPqToPvBusMinLimit(
206+
pqPvNodes.add(Reports.createRootReportPqToPvBusMinLimit(
207207
reportNode,
208208
controllerBus,
209209
controllerBus.getGeneratorVoltageControl().map(VoltageControl::getControlledBus).orElseThrow(),
@@ -345,10 +345,10 @@ private boolean switchReactiveControllerBusPq(List<ControllerBusToPqBus> reactiv
345345

346346
switch (bus.limitType) {
347347
case MAX_Q:
348-
switchedNodes.add(Reports.reportReactiveControllerBusesToPqMaxQ(reportNode, controllerBus, bus.q, bus.qLimit, log, LOGGER));
348+
switchedNodes.add(Reports.createRootReportReactiveControllerBusesToPqMaxQ(reportNode, controllerBus, bus.q, bus.qLimit, log, LOGGER));
349349
break;
350350
case MIN_Q:
351-
switchedNodes.add(Reports.reportReactiveControllerBusesToPqMinQ(reportNode, controllerBus, bus.q, bus.qLimit, log, LOGGER));
351+
switchedNodes.add(Reports.createRootReportReactiveControllerBusesToPqMinQ(reportNode, controllerBus, bus.q, bus.qLimit, log, LOGGER));
352352
break;
353353
case MIN_REALISTIC_V, MAX_REALISTIC_V:
354354
// Note: never happens for now. Robust mode applies only to remote voltage control generators

src/main/java/com/powsybl/openloadflow/sa/AbstractSecurityAnalysis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ SecurityAnalysisReport runSync(SecurityAnalysisParameters securityAnalysisParame
220220

221221
parameters = createParameters(lfParameters, lfParametersExt, partitionTopoConfig.isBreaker(), isAreaInterchangeControl(lfParametersExt, contingencies));
222222

223-
ReportNode threadRootNode = partitionNum == 0 ? saReportNode : Reports.createThreadRootReport(saReportNode);
223+
ReportNode threadRootNode = partitionNum == 0 ? saReportNode : Reports.createRootThreadReport(saReportNode);
224224
reportNodes.set(partitionNum, threadRootNode);
225225

226226
// create networks including all necessary switches

src/main/java/com/powsybl/openloadflow/util/Reports.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public static ReportNode reportPqToPvBuses(ReportNode reportNode, int pqToPvBusC
309309
.add();
310310
}
311311

312-
public static ReportNode reportPvPqSwitchLimit(ReportNode firstRootReportNode, LfBus controllerBus, int limit, boolean log, Logger logger) {
312+
public static ReportNode createRootReportPvPqSwitchLimit(ReportNode firstRootReportNode, LfBus controllerBus, int limit, boolean log, Logger logger) {
313313
ReportNode result = ReportNode.newRootReportNode()
314314
.withLocale(firstRootReportNode.getTreeContext().getLocale())
315315
.withResourceBundles(PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME)
@@ -324,7 +324,7 @@ public static ReportNode reportPvPqSwitchLimit(ReportNode firstRootReportNode, L
324324
return result;
325325
}
326326

327-
public static ReportNode reportPqToPvBusMaxLimit(ReportNode firstRootReportNode, LfBus controllerBus, LfBus controlledBus, double targetV, boolean log, Logger logger) {
327+
public static ReportNode createRootReportPqToPvBusMaxLimit(ReportNode firstRootReportNode, LfBus controllerBus, LfBus controlledBus, double targetV, boolean log, Logger logger) {
328328
ReportNode result = ReportNode.newRootReportNode()
329329
.withLocale(firstRootReportNode.getTreeContext().getLocale())
330330
.withResourceBundles(PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME)
@@ -342,7 +342,7 @@ public static ReportNode reportPqToPvBusMaxLimit(ReportNode firstRootReportNode,
342342
return result;
343343
}
344344

345-
public static ReportNode reportPqToPvBusMinLimit(ReportNode firstRootReportNode, LfBus controllerBus, LfBus controlledBus, double targetV, boolean log, Logger logger) {
345+
public static ReportNode createRootReportPqToPvBusMinLimit(ReportNode firstRootReportNode, LfBus controllerBus, LfBus controlledBus, double targetV, boolean log, Logger logger) {
346346
ReportNode result = ReportNode.newRootReportNode()
347347
.withLocale(firstRootReportNode.getTreeContext().getLocale())
348348
.withResourceBundles(PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME)
@@ -384,12 +384,12 @@ public static ReportNode reportReactiveControllerBusesToPqBuses(ReportNode repor
384384
.add();
385385
}
386386

387-
public static ReportNode reportReactiveControllerBusesToPqMaxQ(ReportNode firstRootReportNode,
388-
LfBus controllerBus,
389-
double busQ,
390-
double maxQ,
391-
boolean log,
392-
Logger logger) {
387+
public static ReportNode createRootReportReactiveControllerBusesToPqMaxQ(ReportNode firstRootReportNode,
388+
LfBus controllerBus,
389+
double busQ,
390+
double maxQ,
391+
boolean log,
392+
Logger logger) {
393393
ReportNode result = ReportNode.newRootReportNode()
394394
.withLocale(firstRootReportNode.getTreeContext().getLocale())
395395
.withResourceBundles(PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME)
@@ -405,12 +405,12 @@ public static ReportNode reportReactiveControllerBusesToPqMaxQ(ReportNode firstR
405405
return result;
406406
}
407407

408-
public static ReportNode reportReactiveControllerBusesToPqMinQ(ReportNode firstRootReportNode,
409-
LfBus controllerBus,
410-
double busQ,
411-
double minQ,
412-
boolean log,
413-
Logger logger) {
408+
public static ReportNode createRootReportReactiveControllerBusesToPqMinQ(ReportNode firstRootReportNode,
409+
LfBus controllerBus,
410+
double busQ,
411+
double minQ,
412+
boolean log,
413+
Logger logger) {
414414
ReportNode result = ReportNode.newRootReportNode()
415415
.withLocale(firstRootReportNode.getTreeContext().getLocale())
416416
.withResourceBundles(PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME)
@@ -895,7 +895,7 @@ public static void reportActionApplicationFailure(String actionId, String contin
895895
.add();
896896
}
897897

898-
public static ReportNode createThreadRootReport(ReportNode firstRootReport) {
898+
public static ReportNode createRootThreadReport(ReportNode firstRootReport) {
899899
return ReportNode.newRootReportNode()
900900
.withLocale(firstRootReport.getTreeContext().getLocale())
901901
.withAllResourceBundlesFromClasspath()

src/test/java/com/powsybl/openloadflow/ac/DistributedSlackOnGenerationTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@
3535
import org.junit.jupiter.api.BeforeEach;
3636
import org.junit.jupiter.api.Test;
3737

38-
import java.util.EnumSet;
39-
import java.util.List;
40-
import java.util.OptionalDouble;
41-
import java.util.Set;
38+
import java.util.*;
4239
import java.util.concurrent.CompletionException;
4340

4441
import static com.powsybl.openloadflow.util.LoadFlowAssert.*;

src/test/java/com/powsybl/openloadflow/sa/OpenSecurityAnalysisWithActionsTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343

4444
import java.io.ByteArrayInputStream;
4545
import java.io.IOException;
46-
import java.util.ArrayList;
47-
import java.util.Collections;
48-
import java.util.List;
49-
import java.util.Set;
46+
import java.util.*;
5047
import java.util.concurrent.CompletionException;
5148
import java.util.stream.Stream;
5249

src/test/resources/i18n/reports_en.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)