Skip to content

Commit 8ecbd81

Browse files
Upgrade to powsybl-dependencies v2025.0.0 (#17)
Signed-off-by: BOUTIER Charly <[email protected]>
1 parent d7e9182 commit 8ecbd81

File tree

8 files changed

+38
-14
lines changed

8 files changed

+38
-14
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</developers>
4343

4444
<properties>
45-
<gridsuite-dependencies.version>38.0.0</gridsuite-dependencies.version>
45+
<gridsuite-dependencies.version>39.0.0</gridsuite-dependencies.version>
4646
<jib.from.image>powsybl/java-dynawo:3.0.0</jib.from.image>
4747
<liquibase-hibernate-package>org.gridsuite.dynamicsecurityanalysis.server</liquibase-hibernate-package>
4848
<sonar.organization>gridsuite</sonar.organization>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package org.gridsuite.dynamicsecurityanalysis.server.report;
9+
10+
import com.google.auto.service.AutoService;
11+
import com.powsybl.commons.report.ReportResourceBundle;
12+
13+
/**
14+
* @author Charly Boutier {@literal <charly.boutier at rte-france.com>}
15+
*/
16+
@AutoService(ReportResourceBundle.class)
17+
public final class DynamicSecurityAnalysisServerReportResourceBundle implements ReportResourceBundle {
18+
19+
public static final String BASE_NAME = "org.gridsuite.dynamicsecurityanalysis.server.reports";
20+
21+
public String getBaseName() {
22+
return BASE_NAME;
23+
}
24+
}

src/main/java/org/gridsuite/dynamicsecurityanalysis/server/service/DynamicSecurityAnalysisWorkerService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,16 @@ private static void enrichContingenciesTimelineReport(SecurityAnalysisReport sec
289289
if (contingencyReportNode != null) {
290290
contingencyReportNode.newReportNode()
291291
.withSeverity(postContingencyResult.getStatus() == PostContingencyComputationStatus.CONVERGED ? TypedValue.INFO_SEVERITY : TypedValue.ERROR_SEVERITY)
292-
.withMessageTemplate("saContingencyStatus", INDENT_4 + "Status : ${contingencyStatus}")
292+
.withMessageTemplate("dynamicsecurityanalysis.server.saContingencyStatus")
293293
.withUntypedValue("contingencyStatus", postContingencyResult.getStatus().name()).add();
294294
if (isNotEmpty(limitViolations)) {
295295
ReportNode limitViolationsReportNode = contingencyReportNode.newReportNode()
296-
.withMessageTemplate("limitViolations", INDENT_4 + "Limit Violations")
296+
.withMessageTemplate("dynamicsecurityanalysis.server.limitViolations")
297297
.add();
298298
for (LimitViolation limitViolation : limitViolations) {
299299
limitViolationsReportNode.newReportNode()
300300
.withSeverity(TypedValue.TRACE_SEVERITY)
301-
.withMessageTemplate("limitViolation", INDENT_8 + "${count}. ${limitViolation}")
301+
.withMessageTemplate("dynamicsecurityanalysis.server.limitViolation")
302302
.withUntypedValue("count", limitViolations.indexOf(limitViolation) + 1)
303303
.withUntypedValue("limitViolation", limitViolation.toString())
304304
.add();

src/main/java/org/gridsuite/dynamicsecurityanalysis/server/utils/Utils.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ public final class Utils {
3131

3232
public static final String RESOURCE_PATH_DELIMITER = "/";
3333

34-
public static final String INDENT = " ";
35-
36-
public static final String INDENT_2 = INDENT.repeat(2);
37-
38-
public static final String INDENT_4 = INDENT_2.repeat(2);
39-
40-
public static final String INDENT_8 = INDENT_4.repeat(2);
41-
4234
private Utils() {
4335
throw new AssertionError("Utility class should not be instantiated");
4436
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dynamicsecurityanalysis.server.saContingencyStatus = Status : ${contingencyStatus}
2+
dynamicsecurityanalysis.server.limitViolations = Limit Violations
3+
dynamicsecurityanalysis.server.limitViolation = ${count}. ${limitViolation}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/test/java/org/gridsuite/dynamicsecurityanalysis/server/controller/DynamicSecurityAnalysisControllerTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,10 @@ void testRunWithReport() throws Exception {
285285
doAnswer(invocation -> {
286286
Object[] args = invocation.getArguments();
287287
if (args[0] instanceof DynamicSecurityAnalysisRunContext runContext && runContext.getReportInfos().reportUuid() != null) {
288-
ReportNode dsaReportNode = runContext.getReportNode().newReportNode().withMessageTemplate("dsa", "").add();
289-
dsaReportNode.newReportNode().withMessageTemplate("saContingency", "Contingency '${contingencyId}'")
288+
ReportNode dsaReportNode = runContext.getReportNode().newReportNode()
289+
.withResourceBundles("i18n.reports")
290+
.withMessageTemplate("dsa").add();
291+
dsaReportNode.newReportNode().withMessageTemplate("saContingency")
290292
.withUntypedValue("contingencyId", "contingencyId01")
291293
.add();
292294
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dsa = empty
2+
saContingency = Contingency '${contingencyId}'

0 commit comments

Comments
 (0)