ThreeWindingsTransformerToBeEstimatedXmlTest.java
/**
* Copyright (c) 2021, 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 com.powsybl.iidm.serde.extensions;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.ThreeWindingsTransformer;
import com.powsybl.iidm.network.extensions.ThreeWindingsTransformerToBeEstimatedAdder;
import com.powsybl.iidm.network.test.ThreeWindingsTransformerNetworkFactory;
import com.powsybl.iidm.serde.AbstractIidmSerDeTest;
import com.powsybl.iidm.serde.IidmSerDeConstants;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.time.ZonedDateTime;
/**
* @author Miora Ralambotiana {@literal <miora.ralambotiana at rte-france.com>}
*/
class ThreeWindingsTransformerToBeEstimatedXmlTest extends AbstractIidmSerDeTest {
@Test
void test() throws IOException {
Network network = ThreeWindingsTransformerNetworkFactory.create();
network.setCaseDate(ZonedDateTime.parse("2019-05-27T12:17:02.504+02:00"));
ThreeWindingsTransformer twt = network.getThreeWindingsTransformer("3WT");
twt.newExtension(ThreeWindingsTransformerToBeEstimatedAdder.class)
.withRatioTapChanger2Status(true)
.withRatioTapChanger3Status(true)
.add();
allFormatsRoundTripTest(network, "threeWindingsTransformerToBeEstimated.xiidm", IidmSerDeConstants.CURRENT_IIDM_VERSION);
}
}