Skip to content

Commit

Permalink
Fix tests on paths with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Mar 23, 2022
1 parent e4f3637 commit 696f04f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
}

}

0 comments on commit 696f04f

Please sign in to comment.