Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<properties>
<jib.from.image>powsybl/java-dynawo:3.0.0</jib.from.image>
<gridsuite-dependencies.version>38.0.0</gridsuite-dependencies.version>
<gridsuite-dependencies.version>39.0.0</gridsuite-dependencies.version>
<liquibase-hibernate-package>org.gridsuite.securityanalysis.server</liquibase-hibernate-package>
<db-util.version>1.0.5</db-util.version>
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright (c) 2025, 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/.
* SPDX-License-Identifier: MPL-2.0
*/
package org.gridsuite.securityanalysis.server.report;

import com.google.auto.service.AutoService;
import com.powsybl.commons.report.ReportResourceBundle;

/**
* @author Charly Boutier {@literal <charly.boutier at rte-france.com>}
*/
@AutoService(ReportResourceBundle.class)
public final class SecurityAnalysisServerReportResourceBundle implements ReportResourceBundle {

public static final String BASE_NAME = "org.gridsuite.securityanalysis.server.reports";

public String getBaseName() {
return BASE_NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,13 @@ private static void logContingencyEquipmentsNotFound(SecurityAnalysisRunContext
}

ReportNode elementsNotFoundSubReporter = runContext.getReportNode().newReportNode()
.withMessageTemplate("notFoundEquipments", "Equipments not found")
.withMessageTemplate("security.analysis.server.notFoundEquipments")
.add();

contingencyInfosList.forEach(contingencyInfos -> {
String elementsIds = String.join(", ", contingencyInfos.getNotFoundElements());
elementsNotFoundSubReporter.newReportNode()
.withMessageTemplate("contingencyEquipmentNotFound",
"Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}")
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotFound")
.withUntypedValue("elementsIds", elementsIds)
.withUntypedValue("contingencyId", contingencyInfos.getId())
.withSeverity(TypedValue.WARN_SEVERITY)
Expand All @@ -252,14 +251,13 @@ private void logContingencyEquipmentsNotConnected(SecurityAnalysisRunContext run
}

ReportNode elementsNotConnectedSubReporter = runContext.getReportNode().newReportNode()
.withMessageTemplate("notConnectedEquipments", "Equipments not connected")
.withMessageTemplate("security.analysis.server.notConnectedEquipments")
.add();

contingencyInfosList.forEach(contingencyInfos -> {
String elementsIds = String.join(", ", contingencyInfos.getNotConnectedElements());
elementsNotConnectedSubReporter.newReportNode()
.withMessageTemplate("contingencyEquipmentNotConnected",
"The following equipments ${elementsIds} in contingency ${contingencyId} are not connected")
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotConnected")
.withUntypedValue("elementsIds", elementsIds)
.withUntypedValue("contingencyId", contingencyInfos.getId())
.withSeverity(TypedValue.WARN_SEVERITY)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
security.analysis.server.notFoundEquipments = Equipments not found
security.analysis.server.contingencyEquipmentNotFound = Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}
security.analysis.server.notConnectedEquipments = Equipments not connected
security.analysis.server.contingencyEquipmentNotConnected = The following equipments ${elementsIds} in contingency ${contingencyId} are not connected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,11 @@ void runWithReportTestElementsNotFoundAndNotConnected() throws Exception {
SecurityAnalysisResult securityAnalysisResult = mapper.readValue(resultAsString, SecurityAnalysisResult.class);
assertThat(RESULT, new MatcherJson<>(mapper, securityAnalysisResult));

assertLogMessage("Equipments not found", "notFoundEquipments", reportService);
assertLogMessage("Cannot find the following equipments wrongId1, wrongId2 in contingency l1", "contingencyEquipmentNotFound", reportService);
assertLogMessage("Equipments not found", "security.analysis.server.notFoundEquipments", reportService);
assertLogMessage("Cannot find the following equipments wrongId1, wrongId2 in contingency l1", "security.analysis.server.contingencyEquipmentNotFound", reportService);

assertLogMessage("Equipments not connected", "notConnectedEquipments", reportService);
assertLogMessage("The following equipments notConnectedId1 in contingency l4 are not connected", "contingencyEquipmentNotConnected", reportService);
assertLogMessage("Equipments not connected", "security.analysis.server.notConnectedEquipments", reportService);
assertLogMessage("The following equipments notConnectedId1 in contingency l4 are not connected", "security.analysis.server.contingencyEquipmentNotConnected", reportService);
}

@Test
Expand Down