diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 909d4fa1b..aa2a54f9e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,28 +18,40 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v4 + with: + path: main + + - name: Checkout powsybl-core branch + uses: actions/checkout@v4 + with: + repository: powsybl/powsybl-core + ref: refs/heads/main + path: powsybl-core - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 + - name: Build and install powsybl-core with Maven + run: mvn --batch-mode -DskipTests=true --file ./powsybl-core/pom.xml install + - name: Build with Maven if: matrix.os == 'ubuntu-latest' - run: mvn --batch-mode -Pintegration-tests,jacoco install + run: mvn --batch-mode -Pintegration-tests,jacoco --file ./main/pom.xml install - name: Build with Maven if: matrix.os != 'ubuntu-latest' - run: mvn --batch-mode install + run: mvn --batch-mode --file ./main/pom.xml install - name: Run SonarCloud analysis if: matrix.os == 'ubuntu-latest' run: > - mvn --batch-mode -DskipTests sonar:sonar + mvn --batch-mode -DskipTests --file ./main/pom.xml sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=powsybl-ci-github -Dsonar.projectKey=com.powsybl:powsybl-dynawo env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/commons/src/test/java/com/powsybl/dynawo/commons/AbstractDynawoCommonsTest.java b/commons/src/test/java/com/powsybl/dynawo/commons/AbstractDynawoCommonsTest.java index d284f684d..832792558 100644 --- a/commons/src/test/java/com/powsybl/dynawo/commons/AbstractDynawoCommonsTest.java +++ b/commons/src/test/java/com/powsybl/dynawo/commons/AbstractDynawoCommonsTest.java @@ -17,7 +17,7 @@ import java.nio.file.Path; import java.util.Objects; -import static com.powsybl.commons.test.ComparisonUtils.compareXml; +import static com.powsybl.commons.test.ComparisonUtils.assertXmlEquals; /** * @author Florian Dupuy {@literal } @@ -26,11 +26,11 @@ abstract class AbstractDynawoCommonsTest extends AbstractSerDeTest { protected void compare(String expectedIidmResource, Network actual) throws IOException { InputStream expected = Objects.requireNonNull(getClass().getResourceAsStream(expectedIidmResource)); - compareXml(expected, getInputStream(actual, tmpDir.resolve("actual.xiidm"))); + assertXmlEquals(expected, getInputStream(actual, tmpDir.resolve("actual.xiidm"))); } protected void compare(Network expected, Network actual) throws IOException { - compareXml(getInputStream(expected, tmpDir.resolve("expected.xiidm")), + assertXmlEquals(getInputStream(expected, tmpDir.resolve("expected.xiidm")), getInputStream(actual, tmpDir.resolve("actual.xiidm"))); } diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java index bbcacc572..2a2cea440 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java @@ -7,26 +7,21 @@ package com.powsybl.dynaflow; import com.google.auto.service.AutoService; -import com.powsybl.action.Action; import com.powsybl.commons.report.ReportNode; -import com.powsybl.computation.ComputationManager; import com.powsybl.contingency.ContingenciesProvider; import com.powsybl.dynawo.commons.PowsyblDynawoVersion; import com.powsybl.iidm.network.Network; -import com.powsybl.security.*; -import com.powsybl.security.interceptors.SecurityAnalysisInterceptor; -import com.powsybl.security.limitreduction.LimitReduction; -import com.powsybl.security.monitor.StateMonitor; -import com.powsybl.security.strategy.OperatorStrategy; +import com.powsybl.security.SecurityAnalysisProvider; +import com.powsybl.security.SecurityAnalysisReport; +import com.powsybl.security.SecurityAnalysisRunParameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; -import static com.powsybl.dynaflow.DynaFlowConstants.*; +import static com.powsybl.dynaflow.DynaFlowConstants.DYNAFLOW_NAME; /** * @author Marcos de Miguel {@literal } @@ -49,37 +44,25 @@ public DynaFlowSecurityAnalysisProvider(Supplier configSupplier) @Override public CompletableFuture run(Network network, String workingVariantId, - LimitViolationDetector detector, - LimitViolationFilter filter, - ComputationManager computationManager, - SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider, - List interceptors, - List operatorStrategies, - List actions, - List monitors, - List limitReductions, - ReportNode reportNode) { - if (detector != null) { - LOG.error("LimitViolationDetector is not used in Dynaflow implementation."); - } - if (monitors != null && !monitors.isEmpty()) { + SecurityAnalysisRunParameters runParameters) { + if (!runParameters.getMonitors().isEmpty()) { LOG.error("Monitoring is not possible with Dynaflow implementation. There will not be supplementary information about monitored equipment."); } - if (operatorStrategies != null && !operatorStrategies.isEmpty()) { + if (!runParameters.getOperatorStrategies().isEmpty()) { LOG.error("Strategies are not implemented in Dynaflow"); } - if (actions != null && !actions.isEmpty()) { + if (!runParameters.getActions().isEmpty()) { LOG.error("Actions are not implemented in Dynaflow"); } - if (limitReductions != null && !limitReductions.isEmpty()) { + if (!runParameters.getLimitReductions().isEmpty()) { LOG.error("Limit reductions are not implemented in Dynaflow"); } - DynaFlowSecurityAnalysis securityAnalysis = new DynaFlowSecurityAnalysis(network, filter, computationManager, configSupplier); - interceptors.forEach(securityAnalysis::addInterceptor); + DynaFlowSecurityAnalysis securityAnalysis = new DynaFlowSecurityAnalysis(network, runParameters.getFilter(), runParameters.getComputationManager(), configSupplier); + runParameters.getInterceptors().forEach(securityAnalysis::addInterceptor); - ReportNode dfsaReportNode = DynaflowReports.createDynaFlowSecurityAnalysisReportNode(reportNode, network.getId()); - return securityAnalysis.run(workingVariantId, parameters, contingenciesProvider, dfsaReportNode); + ReportNode dfsaReportNode = DynaflowReports.createDynaFlowSecurityAnalysisReportNode(runParameters.getReportNode(), network.getId()); + return securityAnalysis.run(workingVariantId, runParameters.getSecurityAnalysisParameters(), contingenciesProvider, dfsaReportNode); } @Override diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/ConstraintsReaderTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/ConstraintsReaderTest.java index 2b2db1202..b58af03c1 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/ConstraintsReaderTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/ConstraintsReaderTest.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Objects; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; import static org.junit.jupiter.api.Assertions.assertEquals; /** @@ -40,6 +40,6 @@ void test() throws IOException { ObjectMapper mapper = JsonUtil.createObjectMapper().registerModule(new SecurityAnalysisJsonModule()); mapper.writerWithDefaultPrettyPrinter().writeValue(stringWriter, violations); - compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/limitViolations.json")), stringWriter.toString()); + assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream("/limitViolations.json")), stringWriter.toString()); } } diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowParametersTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowParametersTest.java index ad6dd9447..9d646b02e 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowParametersTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowParametersTest.java @@ -26,7 +26,7 @@ import java.nio.file.Path; import java.util.*; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; import static com.powsybl.dynaflow.DynaFlowProvider.MODULE_SPECIFIC_PARAMETERS; import static org.junit.jupiter.api.Assertions.*; @@ -205,7 +205,7 @@ void defaultParametersSerialization() throws IOException { try (InputStream actual = Files.newInputStream(parameterFile); InputStream expected = getClass().getResourceAsStream("/params_default.json")) { - compareTxt(expected, actual); + assertTxtEquals(expected, actual); } } @@ -239,7 +239,7 @@ void parametersSerialization() throws IOException { try (InputStream actual = Files.newInputStream(parameterFile); InputStream expected = getClass().getResourceAsStream("/params.json")) { - compareTxt(expected, actual); + assertTxtEquals(expected, actual); } } diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java index ff68bbb7a..9bac95638 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java @@ -33,7 +33,7 @@ import java.util.Objects; import java.util.concurrent.ForkJoinPool; -import static com.powsybl.commons.test.ComparisonUtils.compareXml; +import static com.powsybl.commons.test.ComparisonUtils.assertXmlEquals; import static com.powsybl.dynaflow.DynaFlowConstants.*; import static com.powsybl.loadflow.LoadFlowResult.Status.FAILED; import static com.powsybl.loadflow.LoadFlowResult.Status.FULLY_CONVERGED; @@ -222,7 +222,7 @@ private void compare(Network expected, Network actual) throws IOException { NetworkSerDe.write(expected, pexpected); actual.setCaseDate(expected.getCaseDate()); NetworkSerDe.write(actual, pactual); - compareXml(Files.newInputStream(pexpected), Files.newInputStream(pactual)); + assertXmlEquals(Files.newInputStream(pexpected), Files.newInputStream(pactual)); } private static Network createTestNetwork() { diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java index 60d6c4910..554629932 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java @@ -8,19 +8,14 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.commons.test.AbstractSerDeTest; -import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; -import com.powsybl.contingency.ContingenciesProvider; import com.powsybl.contingency.Contingency; import com.powsybl.iidm.network.*; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.security.SecurityAnalysis; -import com.powsybl.security.SecurityAnalysisParameters; -import com.powsybl.security.SecurityAnalysisReport; -import com.powsybl.security.SecurityAnalysisResult; +import com.powsybl.security.*; import com.powsybl.security.json.SecurityAnalysisResultSerializer; import org.junit.jupiter.api.Test; @@ -36,8 +31,8 @@ import java.util.Objects; import java.util.concurrent.ForkJoinPool; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; -import static com.powsybl.commons.test.ComparisonUtils.compareXml; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; +import static com.powsybl.commons.test.ComparisonUtils.assertXmlEquals; import static com.powsybl.dynaflow.DynaFlowConstants.DYNAFLOW_NAME; import static com.powsybl.dynaflow.DynaFlowConstants.IIDM_FILENAME; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -86,11 +81,11 @@ public int execute(String program, List args, Path outFile, Path errFile private void validateInputs(Path workingDir) throws IOException { if (inputFile != null) { - compareXml(getClass().getResourceAsStream(inputFile), Files.newInputStream(workingDir.resolve(IIDM_FILENAME))); + assertXmlEquals(getClass().getResourceAsStream(inputFile), Files.newInputStream(workingDir.resolve(IIDM_FILENAME))); } if (contingencyFile != null) { InputStream contingencyIs = Objects.requireNonNull(getClass().getResourceAsStream(contingencyFile)); - compareTxt(contingencyIs, Files.newInputStream(workingDir.resolve("contingencies.json"))); + assertTxtEquals(contingencyIs, Files.newInputStream(workingDir.resolve("contingencies.json"))); } } @@ -120,25 +115,24 @@ void test() throws IOException { LocalCommandExecutor commandExecutor = new LocalCommandExecutorMock("/dynawo_version.out", "/SecurityAnalysis/input.xiidm", "/SecurityAnalysis/contingencies.json", contingencyIds, List.of("/SecurityAnalysis/constraints1.xml", "/SecurityAnalysis/constraints2.xml")); - ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(fileSystem.getPath("/working-dir"), 1), commandExecutor, ForkJoinPool.commonPool()); - - SecurityAnalysisReport report = SecurityAnalysis.run(network, n -> contingencies, SecurityAnalysisParameters.load(), computationManager); + SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() + .setComputationManager(new LocalComputationManager(new LocalComputationConfig(fileSystem.getPath("/working-dir"), 1), commandExecutor, ForkJoinPool.commonPool())); + SecurityAnalysisReport report = SecurityAnalysis.run(network, contingencies, runParameters); SecurityAnalysisResult result = report.getResult(); assertEquals(LoadFlowResult.ComponentResult.Status.CONVERGED, result.getPreContingencyResult().getStatus()); StringWriter writer = new StringWriter(); SecurityAnalysisResultSerializer.write(result, writer); - compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/SecurityAnalysis/result.json")), writer.toString()); + assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream("/SecurityAnalysis/result.json")), writer.toString()); } @Test void testCallingBadVersionDynawo() throws IOException { Network network = Network.create("test", "test"); - ContingenciesProvider contingenciesProvider = n -> List.of(); LocalCommandExecutor commandExecutor = new LocalCommandExecutorMock("/dynawo_bad_version.out", null); - ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(fileSystem.getPath("/working-dir"), 1), commandExecutor, ForkJoinPool.commonPool()); - SecurityAnalysisParameters sap = SecurityAnalysisParameters.load(); - assertThrows(PowsyblException.class, () -> SecurityAnalysis.run(network, contingenciesProvider, sap, computationManager)); + SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() + .setComputationManager(new LocalComputationManager(new LocalComputationConfig(fileSystem.getPath("/working-dir"), 1), commandExecutor, ForkJoinPool.commonPool())); + assertThrows(PowsyblException.class, () -> SecurityAnalysis.run(network, List.of(), runParameters)); } private static Network buildNetwork() { diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java index c92778183..390cd2d87 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Objects; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; import static org.junit.jupiter.api.Assertions.assertEquals; /** @@ -73,7 +73,7 @@ public void validate(String schemaDefinition, String expectedResourceName, Path Schema schema = factory.newSchema(xsd); Validator validator = schema.newValidator(); validator.validate(xml); - compareTxt(expected, actual); + assertTxtEquals(expected, actual); } void setupDynawaltzContext() { diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractParametrizedDynamicModelXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractParametrizedDynamicModelXmlTest.java index c0a138037..4c4016698 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractParametrizedDynamicModelXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractParametrizedDynamicModelXmlTest.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Objects; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; /** * @author Laurent Issertial {@literal } @@ -52,7 +52,7 @@ public void validate(String schemaDefinition, String expectedResourceName, Path Schema schema = factory.newSchema(xsd); Validator validator = schema.newValidator(); validator.validate(xml); - compareTxt(expected, actual); + assertTxtEquals(expected, actual); } void setupDynawaltzContext() { diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/DynaWaltzTestUtil.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/DynaWaltzTestUtil.java index 52f7048c4..b57d27a61 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/DynaWaltzTestUtil.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/DynaWaltzTestUtil.java @@ -37,7 +37,7 @@ import java.util.List; import java.util.Objects; -import static com.powsybl.commons.test.ComparisonUtils.compareTxt; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; /** * @author Marcos de Miguel {@literal } @@ -161,7 +161,7 @@ public void validate(String schemaDefinition, String expectedResourceName, Path Schema schema = factory.newSchema(xsd); Validator validator = schema.newValidator(); validator.validate(xml); - compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/" + expectedResourceName)), Files.newInputStream(xmlFile)); + assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream("/" + expectedResourceName)), Files.newInputStream(xmlFile)); } private static Network createEurostagTutorialExample1WithMoreLoads() { diff --git a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java index 06755bfb1..70f8cc6eb 100644 --- a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java +++ b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java @@ -10,7 +10,6 @@ import com.powsybl.commons.datasource.ResourceDataSource; import com.powsybl.commons.datasource.ResourceSet; import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.commons.test.TestUtil; import com.powsybl.contingency.Contingency; import com.powsybl.dynaflow.DynaFlowConfig; @@ -23,10 +22,9 @@ import com.powsybl.iidm.network.test.FourSubstationsNodeBreakerFactory; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.security.LimitViolationFilter; import com.powsybl.security.SecurityAnalysisParameters; import com.powsybl.security.SecurityAnalysisResult; -import com.powsybl.security.detectors.DefaultLimitViolationDetector; +import com.powsybl.security.SecurityAnalysisRunParameters; import com.powsybl.security.json.SecurityAnalysisResultSerializer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,10 +34,10 @@ import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Path; -import java.util.Collections; import java.util.List; import java.util.Objects; +import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; import static com.powsybl.loadflow.LoadFlowResult.ComponentResult.Status.CONVERGED; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -125,9 +123,11 @@ void testSaBb() throws IOException { .toList(); ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("root", "Root message").build(); - SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, new DefaultLimitViolationDetector(), - new LimitViolationFilter(), computationManager, securityAnalysisParameters, n -> contingencies, Collections.emptyList(), - Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), reportNode) + SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() + .setComputationManager(computationManager) + .setSecurityAnalysisParameters(securityAnalysisParameters) + .setReportNode(reportNode); + SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, n -> contingencies, runParameters) .join() .getResult(); @@ -141,7 +141,7 @@ void testSaBb() throws IOException { StringWriter serializedResult = new StringWriter(); SecurityAnalysisResultSerializer.write(result, serializedResult); InputStream expected = Objects.requireNonNull(getClass().getResourceAsStream("/ieee14/security-analysis/sa_bb_results.json")); - ComparisonUtils.compareTxt(expected, serializedResult.toString()); + assertTxtEquals(expected, serializedResult.toString()); } @Test @@ -151,15 +151,16 @@ void testSaNb() throws IOException { List contingencies = network.getGeneratorStream() .map(g -> Contingency.generator(g.getId())) .toList(); - SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, new DefaultLimitViolationDetector(), - new LimitViolationFilter(), computationManager, securityAnalysisParameters, n -> contingencies, Collections.emptyList(), - Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), ReportNode.NO_OP) + SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() + .setComputationManager(computationManager) + .setSecurityAnalysisParameters(securityAnalysisParameters); + SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, n -> contingencies, runParameters) .join() .getResult(); StringWriter serializedResult = new StringWriter(); SecurityAnalysisResultSerializer.write(result, serializedResult); InputStream expected = Objects.requireNonNull(getClass().getResourceAsStream("/ieee14/security-analysis/sa_nb_results.json")); - ComparisonUtils.compareTxt(expected, serializedResult.toString()); + assertTxtEquals(expected, serializedResult.toString()); } } diff --git a/pom.xml b/pom.xml index 1ea98d84e..b81885fc5 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 17 - 6.3.0 + 6.4.0-SNAPSHOT 4.0.14 ../distribution/target/site/jacoco-aggregate/jacoco.xml,