Skip to content

Commit

Permalink
fix before and after
Browse files Browse the repository at this point in the history
  • Loading branch information
paulheinr committed Dec 11, 2023
1 parent 58b1265 commit e10a392
Show file tree
Hide file tree
Showing 97 changed files with 349 additions and 367 deletions.
4 changes: 0 additions & 4 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
<artifactId>matsim-examples</artifactId>
<version>16.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class KNAnalysisEventsHandlerTest {
private Population population = null ;
private Network network = null ;

@Before
@BeforeEach
public void setUp() throws Exception {

scenario = ScenarioUtils.createScenario(ConfigUtils.createConfig());
Expand Down Expand Up @@ -101,7 +101,7 @@ public void setUp() throws Exception {
this.network.addLink(link);
}

@After
@AfterEach
public void tearDown() throws Exception {
this.population = null;
this.network = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.matsim.contrib.bicycle;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Coord;
Expand Down Expand Up @@ -42,7 +42,7 @@ public class BicycleLinkSpeedCalculatorTest {
private BicycleConfigGroup configGroup;
private final Network unusedNetwork = NetworkUtils.createNetwork();

@Before
@BeforeEach
public void before() {
configGroup = ConfigUtils.addOrGetModule( config, BicycleConfigGroup.class );
configGroup.setMaxBicycleSpeedForRouting(MAX_BICYCLE_SPEED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.matsim.contrib.commercialTrafficApplications.jointDemand;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Id;
Expand All @@ -41,7 +41,7 @@ public class IsTheRightCustomerScoredTest {

Scenario scenario;

@Before
@BeforeEach
public void setUp() {

Config config = ConfigUtils.loadConfig("./scenarios/grid/jointDemand_config.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Random;

import org.apache.commons.lang3.mutable.MutableDouble;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -37,7 +37,7 @@ public class WeightedRandomSelectionTest {
private final MutableDouble randomDouble = new MutableDouble();
private WeightedRandomSelection<String> weightedRandomSelection;

@Before
@BeforeEach
public void init() {
weightedRandomSelection = new WeightedRandomSelection<>(new Random() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.matsim.contrib.drt.extension.estimator;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.application.MATSimApplication;
Expand Down Expand Up @@ -67,7 +67,7 @@ private static void prepare(Config config) {

}

@Before
@BeforeEach
public void setUp() throws Exception {

Config config = DrtTestScenario.loadConfig(utils);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.matsim.contrib.drt.extension.estimator;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.application.MATSimApplication;
Expand Down Expand Up @@ -31,7 +31,7 @@ public class MultiModalDrtLegEstimatorTest {

private Controler controler;

@Before
@BeforeEach
public void setUp() throws Exception {

Config config = DrtTestScenario.loadConfig(utils);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
Expand Down Expand Up @@ -70,7 +70,7 @@ public class MultiInsertionDetourPathCalculatorTest {
private final MultiInsertionDetourPathCalculator detourPathCalculator = new MultiInsertionDetourPathCalculator(
pathSearch, pathSearch, pathSearch, pathSearch, 1);

@After
@AfterEach
public void after() {
detourPathCalculator.notifyMobsimBeforeCleanup(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import java.util.List;

import org.junit.After;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
Expand Down Expand Up @@ -74,7 +74,7 @@ public class SingleInsertionDetourPathCalculatorTest {
private final SingleInsertionDetourPathCalculator detourPathCalculator = new SingleInsertionDetourPathCalculator(
null, new FreeSpeedTravelTime(), null, 1, (network, travelCosts, travelTimes) -> pathCalculator);

@After
@AfterEach
public void after() {
detourPathCalculator.notifyMobsimBeforeCleanup(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import java.util.List;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class OneToManyPathCalculatorTest {
private final LeastCostPathTree dijkstraTree = new LeastCostPathTree(new SpeedyGraph(network), travelTime,
new TimeAsTravelDisutility(travelTime));

@Before
@BeforeEach
public void init() {
for (Node node : List.of(nodeA, nodeB, nodeC, nodeD, nodeE)) {
nodeMap.put(node.getId(), node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* *********************************************************************** */

import org.junit.Assert;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -44,7 +44,7 @@

/**
* @author joe
/*
* test for playground.vsp.emissions.WarmEmissionAnalysisModule
Expand Down Expand Up @@ -96,7 +96,7 @@ public static Collection<Object[]> createCombinations() {
return list;
}

@Before
@BeforeEach
public void setUp() {
Map<HbefaWarmEmissionFactorKey, HbefaWarmEmissionFactor> avgHbefaWarmTable = new HashMap<>();
Map<HbefaWarmEmissionFactorKey, HbefaWarmEmissionFactor> detailedHbefaWarmTable = new HashMap<>();
Expand Down Expand Up @@ -257,7 +257,7 @@ private void fillDetailedTable( Map<HbefaWarmEmissionFactorKey, HbefaWarmEmissio

}
}

}

private void fillAverageTable( Map<HbefaWarmEmissionFactorKey, HbefaWarmEmissionFactor> avgHbefaWarmTable) {
Expand All @@ -282,7 +282,7 @@ private void fillAverageTable( Map<HbefaWarmEmissionFactorKey, HbefaWarmEmission

}
}

}

private void addDetailedRecordsToTestSpeedsTable(
Expand All @@ -302,7 +302,7 @@ private void addDetailedRecordsToTestSpeedsTable(


}






Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Scenario;
Expand Down Expand Up @@ -50,7 +50,7 @@ public class CarrierModuleTest {
@RegisterExtension
public MatsimTestUtils testUtils = new MatsimTestUtils();

@Before
@BeforeEach
public void setUp(){
Config config = ConfigUtils.createConfig() ;
ScoringConfigGroup.ActivityParams workParams = new ScoringConfigGroup.ActivityParams("w");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -49,7 +49,7 @@ public class CarrierPlanXmlReaderV2Test {

private Carrier testCarrier;

@Before
@BeforeEach
public void setUp() throws Exception{
CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes();
new CarrierVehicleTypeReader( carrierVehicleTypes ).readFile( utils.getPackageInputDirectory() + "vehicleTypes_v2.xml" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.Ignore;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand All @@ -42,7 +42,7 @@ public class CarrierPlanXmlReaderV2WithDtdTest {

private Carrier testCarrier;

@Before
@BeforeEach
public void setUp() throws Exception{

CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Id;
Expand All @@ -42,7 +42,7 @@ public class CarrierPlanXmlWriterV2Test {

private Carrier testCarrier;

@Before
@BeforeEach
public void setUp() throws Exception{

CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Id;
Expand All @@ -42,7 +42,7 @@ public class CarrierPlanXmlWriterV2_1Test {

private Carrier testCarrier;

@Before
@BeforeEach
public void setUp() throws Exception{

CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -39,7 +39,7 @@ public class CarrierVehicleTypeLoaderTest {
private CarrierVehicleTypes types;
private Carriers carriers;

@Before
@BeforeEach
public void setUp() throws Exception{
types = new CarrierVehicleTypes();
new CarrierVehicleTypeReader(types).readFile(utils.getClassInputDirectory() + "vehicleTypes.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Id;
Expand All @@ -41,7 +41,7 @@ public class CarrierVehicleTypeReaderTest {
private CarrierVehicleTypes types;
private String inFilename;

@Before
@BeforeEach
public void setUp() {
types = new CarrierVehicleTypes();
inFilename = utils.getClassInputDirectory() + "vehicleTypes.xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -38,7 +38,7 @@ public class CarrierVehicleTypeTest {

CarrierVehicleTypes types;

@Before
@BeforeEach
public void setUp() throws Exception{
final Id<VehicleType> vehicleTypeId = Id.create( "medium", VehicleType.class );
VehicleType mediumType = VehicleUtils.getFactory().createVehicleType( vehicleTypeId );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package org.matsim.freight.carriers.controler;

import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -60,7 +60,7 @@ static Config commonConfig( MatsimTestUtils testUtils ) {
return config;
}

@Before
@BeforeEach
public void setUp(){
Config config = commonConfig( testUtils );

Expand Down
Loading

0 comments on commit e10a392

Please sign in to comment.