diff --git a/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java b/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java index 21de5f2..21f1388 100644 --- a/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java @@ -21,6 +21,7 @@ import java.nio.file.Path; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class RunLeipzigIntegrationTest { @@ -62,13 +63,14 @@ public final void runPoint1pctIntegrationTest() { @Test public final void runPoint1pctParkingIntegrationTest() { - Path output = Path.of("output-parking-test/it-1pct"); + String output = utils.getOutputDirectory(); + Config config = ConfigUtils.loadConfig("input/v1.3/leipzig-v1.3-10pct.config.xml"); config.global().setNumberOfThreads(1); config.qsim().setNumberOfThreads(1); - config.controler().setLastIteration(0); + config.controler().setLastIteration(1); config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setOutputDirectory(output.toString()); + config.controler().setOutputDirectory(utils.getOutputDirectory()); ConfigUtils.addOrGetModule(config, SimWrapperConfigGroup.class).defaultDashboards = SimWrapperConfigGroup.Mode.disabled; config.plans().setInputFile(URL + "leipzig-v1.2-0.1pct.plans-initial.xml.gz"); @@ -76,10 +78,21 @@ public final void runPoint1pctParkingIntegrationTest() { "--parking-cost-area", "input/v" + RunLeipzigScenario.VERSION + "/parkingCostArea/Bewohnerparken_2020.shp", "--parking", "--intermodality", "drtAsAccessEgressForPt"); - assertThat(output) + assertThat(Path.of(output)) .exists() .isNotEmptyDirectory(); - new ParkingLocation().execute("--directory", output.toString()); + + assertThat(EventsUtils.compareEventsFiles( + new File(utils.getOutputDirectory(), "leipzig-1pct.output_events.xml.gz").toString(), + new File(utils.getClassInputDirectory(), "runPoint1pctParkingIntegrationTest_events.xml.zst").toString() + )).isEqualTo(EventsFileComparator.Result.FILES_ARE_EQUAL); + + + Network network = NetworkUtils.readNetwork(utils.getOutputDirectory() + "/" + config.controler().getRunId() + ".output_network.xml.gz"); + assertTrue(network.getLinks().get(Id.createLinkId("24232899")).getFreespeed() < 12.501000000000001); + assertTrue(network.getLinks().get(Id.createLinkId("24675139")).getFreespeed() < 7.497); + + new ParkingLocation().execute("--directory", output); } @Test diff --git a/test/input/org/matsim/run/RunLeipzigIntegrationTest/runPoint1pctParkingIntegrationTest_events.xml.zst b/test/input/org/matsim/run/RunLeipzigIntegrationTest/runPoint1pctParkingIntegrationTest_events.xml.zst new file mode 100644 index 0000000..8734e7d Binary files /dev/null and b/test/input/org/matsim/run/RunLeipzigIntegrationTest/runPoint1pctParkingIntegrationTest_events.xml.zst differ