diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 74c342f..031317a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 21 - name: Build with Maven run: mvn -B package --file pom.xml diff --git a/pom.xml b/pom.xml index 0f10e04..3302c97 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ - 14.0 + 2024.0 @@ -21,8 +21,8 @@ UTF-8 UTF-8 - 11 - 11 + 21 + 21 @@ -71,14 +71,6 @@ ${matsim.version} - - - junit - junit - 4.13.1 - test - - org.matsim @@ -108,6 +100,21 @@ osm ${matsim.version} + + + org.junit.jupiter + junit-jupiter-engine + 5.10.2 + test + + + + + org.junit.platform + junit-platform-launcher + 1.9.0 + test + diff --git a/src/main/java/org/matsim/prepare/CreatePopulation.java b/src/main/java/org/matsim/prepare/CreatePopulation.java index c0339bc..f699603 100644 --- a/src/main/java/org/matsim/prepare/CreatePopulation.java +++ b/src/main/java/org/matsim/prepare/CreatePopulation.java @@ -19,7 +19,8 @@ package org.matsim.prepare; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.geotools.data.simple.SimpleFeatureIterator; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Point; @@ -47,7 +48,7 @@ */ public class CreatePopulation { - private static final Logger log = Logger.getLogger(CreatePopulation.class); + private static final Logger log = LogManager.getLogger(CreatePopulation.class); private int personCounter = 0; private final Map features = new HashMap<>(); diff --git a/src/main/java/org/matsim/run/RunSerengetiParkScenario.java b/src/main/java/org/matsim/run/RunSerengetiParkScenario.java index c1220b5..9f4910e 100644 --- a/src/main/java/org/matsim/run/RunSerengetiParkScenario.java +++ b/src/main/java/org/matsim/run/RunSerengetiParkScenario.java @@ -24,14 +24,15 @@ import java.util.HashSet; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup; +import org.matsim.core.config.groups.RoutingConfigGroup; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryLogging; import org.matsim.core.gbl.Gbl; @@ -47,7 +48,7 @@ public final class RunSerengetiParkScenario { - private static final Logger log = Logger.getLogger(RunSerengetiParkScenario.class ); + private static final Logger log = LogManager.getLogger(RunSerengetiParkScenario.class ); // Demand @@ -209,9 +210,9 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules // config.controler().setRoutingAlgorithmType( FastAStarLandmarks ); - config.plansCalcRoute().setRoutingRandomness( 0. ); + config.routing().setRoutingRandomness( 0. ); - config.plansCalcRoute().setAccessEgressType(PlansCalcRouteConfigGroup.AccessEgressType.accessEgressModeToLink); + config.routing().setAccessEgressType(RoutingConfigGroup.AccessEgressType.accessEgressModeToLink); config.qsim().setUsingTravelTimeCheckInTeleportation( true ); ConfigUtils.applyCommandline( config, typedArgs ) ; diff --git a/src/test/java/org/matsim/project/RunSerengetiParkScenarioTest.java b/src/test/java/org/matsim/project/RunSerengetiParkScenarioTest.java index 131c7e6..5361d94 100644 --- a/src/test/java/org/matsim/project/RunSerengetiParkScenarioTest.java +++ b/src/test/java/org/matsim/project/RunSerengetiParkScenarioTest.java @@ -18,15 +18,16 @@ * *********************************************************************** */ package org.matsim.project; -import org.apache.log4j.Logger; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; +import org.apache.logging.log4j.LogManager; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; import org.matsim.core.controler.Controler; import org.matsim.run.RunSerengetiParkScenario; import org.matsim.testcases.MatsimTestUtils; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.fail; /** * @author ikaddoura @@ -34,7 +35,8 @@ */ public class RunSerengetiParkScenarioTest { - @Rule public MatsimTestUtils utils = new MatsimTestUtils() ; + @RegisterExtension + public MatsimTestUtils utils = new MatsimTestUtils() ; @Test public final void test() { @@ -51,10 +53,10 @@ public final void test() { controler.run(); } catch ( Exception ee ) { - Logger.getLogger(this.getClass()).fatal("there was an exception: \n" + ee ) ; + LogManager.getLogger(this.getClass()).fatal("there was an exception: \n" + ee ) ; // if one catches an exception, then one needs to explicitly fail the test: - Assert.fail(); + fail(); }