From 91b6b421d24e7a8e5da44d2f6b1ba902ebc3580a Mon Sep 17 00:00:00 2001 From: lisrte Date: Mon, 8 Jul 2024 14:41:24 +0200 Subject: [PATCH] Fix code smells Signed-off-by: lisrte --- .../dynawo/dsl/ieee/AbstractIeeeTest.java | 2 +- .../dynawo/DynawoSimulationReports.java | 8 +++++--- .../dynawo/builders/BuilderReports.java | 7 ++++--- .../powsybl/dynawo/DynawoParametersTest.java | 1 + .../dynawo/builders/BuilderConfigTest.java | 20 +++++++++---------- .../xml/DisconnectHvdcEventXmlTest.java | 3 +-- ...cOverloadManagementSystemModelXmlTest.java | 3 +-- ...sOverloadManagementSystemModelXmlTest.java | 3 +-- ...mptyTapChangerAutomationSystemXmlTest.java | 3 +-- ...hangerBlockingAutomationSystemXmlTest.java | 3 +-- .../com/powsybl/dynawo/xml/HvdcXmlTest.java | 3 +-- .../powsybl/dynawo/xml/LoadsModelXmlTest.java | 3 +-- .../dynawo/xml/NodeFaultEventXmlTest.java | 3 +-- .../dynawo/xml/OmegaRefModelXmlTest.java | 3 +-- .../dynawo/xml/PhaseShiftersXmlTest.java | 3 +-- .../xml/SetPointInfiniteBusModelXmlTest.java | 3 +-- .../powsybl/dynawo/xml/ShuntModelXmlTest.java | 3 +-- .../dynawo/xml/SvarcModelWithSbaXmlTest.java | 3 +-- .../powsybl/dynawo/xml/SvarcModelXmlTest.java | 3 +-- .../TapChangerAutomationSystemXmlTest.java | 3 +-- ...hangerBlockingAutomationSystemXmlTest.java | 3 +-- ...ngToTapChangerAutomationSystemXmlTest.java | 3 +-- .../dynawo/xml/TransformerModelXmlTest.java | 3 +-- .../UnderVoltageAutomationSystemXmlTest.java | 3 +-- .../powsybl/dynawo/xml/WeccGenXmlTest.java | 3 +-- 25 files changed, 41 insertions(+), 57 deletions(-) diff --git a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/AbstractIeeeTest.java b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/AbstractIeeeTest.java index 72bb564a2..75826799a 100644 --- a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/AbstractIeeeTest.java +++ b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/AbstractIeeeTest.java @@ -71,7 +71,7 @@ protected void setup(String parametersFile, String networkParametersFile, String List dynamicModelGroovyExtensions = GroovyExtension.find(DynamicModelGroovyExtension.class, DynawoSimulationProvider.NAME); dynamicModelsSupplier = new GroovyDynamicModelsSupplier(workingDir.resolve("dynamicModels.groovy"), dynamicModelGroovyExtensions); } else { - dynamicModelsSupplier = (n, NO_OP) -> Collections.emptyList(); + dynamicModelsSupplier = (n, r) -> Collections.emptyList(); } // Event models diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationReports.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationReports.java index e01563a33..2ca46361f 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationReports.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationReports.java @@ -16,6 +16,8 @@ */ public final class DynawoSimulationReports { + private static final String DYNAMIC_ID_FIELD = "dynamicId"; + private DynawoSimulationReports() { } @@ -37,7 +39,7 @@ public static void reportDuplicateStaticId(ReportNode reportNode, String duplica .withMessageTemplate("duplicateStaticId", "Duplicate static id found: ${duplicateId} -> model ${modelName} ${dynamicId} will be skipped") .withUntypedValue("duplicateId", duplicateId) .withUntypedValue("modelName", modelName) - .withUntypedValue("dynamicId", dynamicId) + .withUntypedValue(DYNAMIC_ID_FIELD, dynamicId) .withSeverity(TypedValue.WARN_SEVERITY) .add(); } @@ -57,7 +59,7 @@ public static void reportEmptyAutomaton(ReportNode reportNode, String automatonN .withMessageTemplate("emptyAutomaton", "${automatonName} ${dynamicId} equipment ${equipmentId} is not a ${expectedModels}, the automation system will be skipped") .withUntypedValue("automatonName", automatonName) - .withUntypedValue("dynamicId", dynamicId) + .withUntypedValue(DYNAMIC_ID_FIELD, dynamicId) .withUntypedValue("equipmentId", equipmentId) .withUntypedValue("expectedModels", expectedModels) .withSeverity(TypedValue.WARN_SEVERITY) @@ -69,7 +71,7 @@ public static void reportEmptyListAutomaton(ReportNode reportNode, String automa .withMessageTemplate("emptyListAutomaton", "None of ${automatonName} ${dynamicId} equipments are ${expectedModels}, the automation system will be skipped") .withUntypedValue("automatonName", automatonName) - .withUntypedValue("dynamicId", dynamicId) + .withUntypedValue(DYNAMIC_ID_FIELD, dynamicId) .withUntypedValue("expectedModels", expectedModels) .withSeverity(TypedValue.WARN_SEVERITY) .add(); diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/BuilderReports.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/BuilderReports.java index 63b0cc553..e3a408961 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/BuilderReports.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/BuilderReports.java @@ -17,6 +17,7 @@ public final class BuilderReports { private static final String FIELD_NAME = "fieldName"; + private static final String EQUIPMENT_TYPE_FIELD = "equipmentType"; private BuilderReports() { } @@ -83,7 +84,7 @@ public static void reportFieldNotSet(ReportNode reportNode, String fieldName) { public static void reportStaticIdUnknown(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { reportNode.newReportNode() .withMessageTemplate("unknownStaticIdToDynamic", "'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}") - .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(EQUIPMENT_TYPE_FIELD, equipmentType) .withUntypedValue(FIELD_NAME, fieldName) .withUntypedValue("staticId", staticId) .withSeverity(TypedValue.WARN_SEVERITY) @@ -93,7 +94,7 @@ public static void reportStaticIdUnknown(ReportNode reportNode, String fieldName public static void reportDifferentNetwork(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { reportNode.newReportNode() .withMessageTemplate("wrongNetwork", "'${fieldName}' field value ${equipmentType} ${staticId} does not belong to the builder network") - .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(EQUIPMENT_TYPE_FIELD, equipmentType) .withUntypedValue(FIELD_NAME, fieldName) .withUntypedValue("staticId", staticId) .withSeverity(TypedValue.WARN_SEVERITY) @@ -103,7 +104,7 @@ public static void reportDifferentNetwork(ReportNode reportNode, String fieldNam public static void reportUnknownStaticIdHandling(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { reportNode.newReportNode() .withMessageTemplate("staticIdUnknown", "'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}, id will be used as pure dynamic model id") - .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(EQUIPMENT_TYPE_FIELD, equipmentType) .withUntypedValue(FIELD_NAME, fieldName).withUntypedValue("staticId", staticId) .withSeverity(TypedValue.INFO_SEVERITY) .add(); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java index df5a77430..fcf8e9b5e 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java @@ -40,6 +40,7 @@ class DynawoParametersTest extends AbstractSerDeTest { private InMemoryPlatformConfig platformConfig; @BeforeEach + @Override public void setUp() throws IOException { super.setUp(); platformConfig = new InMemoryPlatformConfig(fileSystem); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuilderConfigTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuilderConfigTest.java index 047bc9442..a5f5c2ad8 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuilderConfigTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuilderConfigTest.java @@ -22,21 +22,21 @@ */ class BuilderConfigTest { - private static Network NETWORK; - private static ModelConfigsHandler MODEL_CONFIGS_HANDLER; + private static Network network; + private static ModelConfigsHandler modelConfigsHandler; @BeforeAll static void setup() { - NETWORK = EurostagTutorialExample1Factory.create(); - MODEL_CONFIGS_HANDLER = ModelConfigsHandler.getInstance(); + network = EurostagTutorialExample1Factory.create(); + modelConfigsHandler = ModelConfigsHandler.getInstance(); } @Test void testModelBuilders() { - for (BuilderConfig builderConfig : MODEL_CONFIGS_HANDLER.getBuilderConfigs()) { + for (BuilderConfig builderConfig : modelConfigsHandler.getBuilderConfigs()) { String modelName = builderConfig.getModelInfos().iterator().next().name(); - ModelBuilder handlerBuilder = MODEL_CONFIGS_HANDLER.getModelBuilder(NETWORK, modelName, ReportNode.NO_OP); - ModelBuilder configBuilder = builderConfig.getBuilderConstructor().createBuilder(NETWORK, modelName, ReportNode.NO_OP); + ModelBuilder handlerBuilder = modelConfigsHandler.getModelBuilder(network, modelName, ReportNode.NO_OP); + ModelBuilder configBuilder = builderConfig.getBuilderConstructor().createBuilder(network, modelName, ReportNode.NO_OP); assertNotNull(handlerBuilder); assertEquals(handlerBuilder.getClass(), configBuilder.getClass()); } @@ -44,9 +44,9 @@ void testModelBuilders() { @Test void testEventBuilders() { - for (EventBuilderConfig eventBuilderConfig : MODEL_CONFIGS_HANDLER.getEventBuilderConfigs()) { - ModelBuilder handlerBuilder = MODEL_CONFIGS_HANDLER.getEventModelBuilder(NETWORK, eventBuilderConfig.getEventModelInfo().name(), ReportNode.NO_OP); - ModelBuilder configBuilder = eventBuilderConfig.getBuilderConstructor().createBuilder(NETWORK, ReportNode.NO_OP); + for (EventBuilderConfig eventBuilderConfig : modelConfigsHandler.getEventBuilderConfigs()) { + ModelBuilder handlerBuilder = modelConfigsHandler.getEventModelBuilder(network, eventBuilderConfig.getEventModelInfo().name(), ReportNode.NO_OP); + ModelBuilder configBuilder = eventBuilderConfig.getBuilderConstructor().createBuilder(network, ReportNode.NO_OP); assertNotNull(handlerBuilder); assertEquals(handlerBuilder.getClass(), configBuilder.getClass()); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java index 4e626c279..5b5a0f22d 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java @@ -21,7 +21,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.function.Function; import java.util.stream.Stream; @@ -55,7 +54,7 @@ protected void addDynamicModels(Function< Network, BlackBoxModel> hvdcConstructo @ParameterizedTest(name = "{0}") @MethodSource("provideModels") - void writeModel(String dydName, Function< Network, BlackBoxModel> hvdcConstructor, Function< Network, BlackBoxModel> disconnectConstructor) throws SAXException, IOException, XMLStreamException { + void writeModel(String dydName, Function< Network, BlackBoxModel> hvdcConstructor, Function< Network, BlackBoxModel> disconnectConstructor) throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", dydName, tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java index 0f834b5a9..86695a7b9 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java @@ -14,7 +14,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -58,7 +57,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "cla_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java index 93fb61ad1..ad05587f0 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -40,7 +39,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "cla_tl_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java index 72c4e2ab8..c1f4d73d7 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -41,7 +40,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_empty_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java index 28b342f6e..926248298 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java @@ -14,7 +14,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -55,7 +54,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_blocking_empty_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java index 307cf1e72..96624d6cf 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java @@ -20,7 +20,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.function.Function; import java.util.stream.Stream; @@ -51,7 +50,7 @@ protected void addDynamicModels(Function< Network, BlackBoxModel> constructor) { @ParameterizedTest(name = "{0}") @MethodSource("provideHvdc") - void writeHvdcModel(String dydName, Function< Network, BlackBoxModel> constructor) throws SAXException, IOException, XMLStreamException { + void writeHvdcModel(String dydName, Function< Network, BlackBoxModel> constructor) throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", dydName, tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java index e937159c7..d2ca79429 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java @@ -18,7 +18,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.function.Function; import java.util.stream.Stream; @@ -49,7 +48,7 @@ protected void addDynamicModels(Function< Network, BlackBoxModel> loadConstructo @ParameterizedTest(name = "{0}") @MethodSource("provideLoads") - void writeLoadModel(String dydName, Function< Network, BlackBoxModel> loadConstructor) throws SAXException, IOException, XMLStreamException { + void writeLoadModel(String dydName, Function< Network, BlackBoxModel> loadConstructor) throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", dydName + ".xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java index 97ee0af99..ac34e76be 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -37,7 +36,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "node_fault_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java index 0ae237a8d..61e8faa6c 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -46,7 +45,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "omega_ref_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java index 198559384..737cbf054 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java @@ -20,7 +20,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.function.Function; import java.util.stream.Stream; @@ -58,7 +57,7 @@ protected void addDynamicModels(Function phaseShifterCon @ParameterizedTest(name = "{0}") @MethodSource("providePhaseShifter") - void writeLoadModel(String dydName, Function phaseShifterConstructor, boolean dynamicTransformer) throws SAXException, IOException, XMLStreamException { + void writeLoadModel(String dydName, Function phaseShifterConstructor, boolean dynamicTransformer) throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", dydName + ".xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java index f3df762a1..cc82f66b9 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java @@ -14,7 +14,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -47,7 +46,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "set_point_inf_bus_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java index 2da682d18..68e976969 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -35,7 +34,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "shunt_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java index 234865a8b..293daa8aa 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -44,7 +43,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "svarc_sba_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java index fff96c436..83a747299 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -35,7 +34,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "svarc_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java index 4e3599733..e04f9dddc 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java @@ -17,7 +17,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -71,7 +70,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java index 4017d9a7f..aaa1f105e 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -65,7 +64,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_blocking_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java index c43ddcb03..ec8e3bf3f 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java @@ -11,7 +11,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -31,7 +30,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_blocking_tap_changer_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java index 2a6d19524..6808221b1 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -35,7 +34,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); validate("dyd.xsd", "tfr_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java index 0bd32fcc8..fd79320f7 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; /** @@ -35,7 +34,7 @@ protected void addDynamicModels() { } @Test - void writeModel() throws SAXException, IOException, XMLStreamException { + void writeModel() throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "under_voltage_dyd.xml", tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME)); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java index 39ec9468a..ccd88aa58 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.xml.sax.SAXException; -import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.function.Function; import java.util.stream.Stream; @@ -50,7 +49,7 @@ protected void addDynamicModels(Function< Network, BlackBoxModel> constructor) { @ParameterizedTest(name = "{0}") @MethodSource("provideWecc") - void writeModel(String dydName, String parName, Function< Network, BlackBoxModel> constructor) throws SAXException, IOException, XMLStreamException { + void writeModel(String dydName, String parName, Function< Network, BlackBoxModel> constructor) throws SAXException, IOException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", dydName, tmpDir.resolve(DynawoSimulationConstants.DYD_FILENAME));