diff --git a/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi1/TestVesselFmu.java b/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi1/TestVesselFmu.java index a5cac10..049e9f2 100644 --- a/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi1/TestVesselFmu.java +++ b/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi1/TestVesselFmu.java @@ -11,8 +11,9 @@ public class TestVesselFmu { @Test public void testVesselFmu() throws IOException { - File xmlFile = new File(TestVesselFmu.class.getClassLoader() - .getResource("fmi1.0/VesselFmu/modelDescription.xml").getFile()); + String file = TestVesselFmu.class.getClassLoader() + .getResource("fmi1.0/VesselFmu/modelDescription.xml").getFile(); + File xmlFile = new File(file.replace("%20", " ")); FmiModelDescription md = FmiModelDescription.fromXml(xmlFile); diff --git a/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi2/TestTrajectoryController.java b/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi2/TestTrajectoryController.java index bd4911b..3d1c324 100644 --- a/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi2/TestTrajectoryController.java +++ b/fmi-export/src/test/java/no/ntnu/ais/fmu4j/modeldescription/fmi2/TestTrajectoryController.java @@ -1,6 +1,6 @@ package no.ntnu.ais.fmu4j.modeldescription.fmi2; -import no.ntnu.ais.fmu4j.modeldescription.fmi1.TestVesselFmu; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.io.File; @@ -10,10 +10,12 @@ public class TestTrajectoryController { @Test public void test() throws IOException { - File xmlFile = new File(TestVesselFmu.class.getClassLoader() - .getResource("fmi2.0/TrajectoryController/modelDescription.xml").getFile()); + String file = TestTrajectoryController.class.getClassLoader() + .getResource("fmi2.0/TrajectoryController/modelDescription.xml").getFile(); + File xmlFile = new File(file.replace("%20", " ")); Fmi2ModelDescription md = Fmi2ModelDescription.fromXml(xmlFile); + Assertions.assertEquals(md.getModelName(), "TrajectoryController"); } }