Skip to content

Commit c15bfe5

Browse files
committed
Add TCK test on Identifiable getSortedIndex method
Signed-off-by: CARON Alice <alice.caron@rte-france.com>
1 parent ccf8384 commit c15bfe5

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright (c) 2026, 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.iidm.network.impl.tck;
9+
10+
import com.powsybl.iidm.network.tck.AbstractIdentifiableTest;
11+
12+
/**
13+
* @author Alice Caron {@literal <alice.caron at rte-france.com>}
14+
*/
15+
class IdentifiableTest extends AbstractIdentifiableTest { }

iidm/iidm-serde/src/test/java/com/powsybl/iidm/serde/ConnectableOrderingXmlTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void testRoundTrip() throws IOException {
2929
}
3030

3131
@Test
32-
void testCopy() throws IOException {
32+
void testCopy() {
3333
Network network = Network.read("/twtOrdering.xiidm", getNetworkAsStream("/twtOrdering.xiidm"));
3434
Network exportNetwork = NetworkSerDe.copy(network);
3535
assertEquals(exportNetwork.getTwoWindingsTransformers().toString(), network.getTwoWindingsTransformers().toString());
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright (c) 2026, 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.iidm.network.tck;
9+
10+
import com.powsybl.iidm.network.Network;
11+
import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory;
12+
import org.junit.jupiter.api.Test;
13+
14+
import static org.junit.jupiter.api.Assertions.assertEquals;
15+
16+
/**
17+
* @author Alice Caron {@literal <alice.caron at rte-france.com>}
18+
*/
19+
public abstract class AbstractIdentifiableTest {
20+
21+
@Test
22+
public void test() {
23+
Network network = EurostagTutorialExample1Factory.create();
24+
25+
// Test getSortIndex is implemented
26+
assertEquals(11, network.getLine("NHV1_NHV2_1").getSortIndex());
27+
assertEquals(12, network.getLine("NHV1_NHV2_2").getSortIndex());
28+
assertEquals(13, network.getTwoWindingsTransformer("NGEN_NHV1").getSortIndex());
29+
assertEquals(14, network.getTwoWindingsTransformer("NHV2_NLOAD").getSortIndex());
30+
}
31+
}

0 commit comments

Comments
 (0)