SimpleDslTest.java
/**
* Copyright (c) 2017, 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.action.ial.simulator;
import com.powsybl.iidm.network.Network;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Geoffroy Jamgotchian {@literal <geoffroy.jamgotchian at rte-france.com>}
*/
class SimpleDslTest extends AbstractLoadFlowRulesEngineTest {
@Override
protected Network createNetwork() {
Network network = EurostagTutorialExample1WithTemporaryLimitFactory.create();
network.getVoltageLevel("VLHV1").getBusBreakerView().getBus("NHV1").setV(380).setAngle(0);
network.getLine("NHV1_NHV2_2").getTerminal1().setP(300).setQ(100);
return network;
}
@Override
protected String getDslFile() {
return "/simple-dsl.groovy";
}
@Test
void test() {
assertEquals(600, network.getLoad("LOAD").getP0(), 1e-6);
engine.start(actionDb);
assertEquals(601, network.getLoad("LOAD").getP0(), 1e-6);
}
}