Skip to content

Commit 2a65ce5

Browse files
committed
Remove unused ResourceBundle reports files, keep reports_en.properties to fallback on en locale for tests
Signed-off-by: CARON Alice <[email protected]>
1 parent 39a19c2 commit 2a65ce5

File tree

6 files changed

+41
-3
lines changed

6 files changed

+41
-3
lines changed

src/main/resources/com/powsybl/openloadflow/reports_fr.properties

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

src/main/resources/com/powsybl/openloadflow/reports_fr_FR.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright (c) 2024, 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 com.powsybl.openloadflow.util;
9+
10+
import com.powsybl.commons.report.ReportNode;
11+
import com.powsybl.commons.test.PowsyblCoreTestReportResourceBundle;
12+
import org.junit.jupiter.api.Test;
13+
import java.util.Locale;
14+
import static org.junit.jupiter.api.Assertions.assertEquals;
15+
16+
/**
17+
* @author Alice Caron {@literal <alice.caron at rte-france.com>}
18+
*/
19+
class ReportsTest {
20+
21+
@Test
22+
void useReportWithFranceLocaleTest() {
23+
ReportNode reportNode = ReportNode.newRootReportNode()
24+
.withLocale(Locale.FRANCE)
25+
.withResourceBundles(PowsyblCoreTestReportResourceBundle.TEST_BASE_NAME)
26+
.withMessageTemplate("testReport")
27+
.build();
28+
assertEquals("Rapport de test en français", reportNode.getMessage());
29+
}
30+
31+
@Test
32+
void useReportWithJVMLocaleTest() {
33+
ReportNode reportNode = ReportNode.newRootReportNode()
34+
.withLocale(Locale.ENGLISH)
35+
.withResourceBundles(PowsyblCoreTestReportResourceBundle.TEST_BASE_NAME)
36+
.withMessageTemplate("testReport")
37+
.build();
38+
assertEquals("Test Report", reportNode.getMessage());
39+
}
40+
}

src/main/resources/com/powsybl/openloadflow/reports_en_US.properties renamed to src/test/resources/i18n/reports_en.properties

File renamed without changes.

src/test/resources/i18n/reports_en_US.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
testReport = Rapport de test en français

0 commit comments

Comments
 (0)