Skip to content

Commit

Permalink
Merge pull request #1054 from matsim-org/dependabot/maven/dev.x/java-…
Browse files Browse the repository at this point in the history
…dependencies-f78fdcc416

Bump the java-dependencies group with 1 update
  • Loading branch information
paulheinr authored Dec 21, 2023
2 parents d64d061 + 29eeddd commit 0994136
Show file tree
Hide file tree
Showing 43 changed files with 254 additions and 274 deletions.
15 changes: 11 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- This is where we change the matsim version. Maven does not allow using properties in the parent declaration (like ${matsim.version}).
Therefore we need to use a fixed value here and then refer to the matsim version with ${project.parent.version} -->
<!-- Options: stable build based on weekly (e.g. 15.0-PR2344), PR-based (e.g. 15.0-2023w01) or official (e.g. 14.0) releases -->
<version>16.0-2023w50</version>
<version>16.0-2023w51</version>
<!--<version>16.0-2023w39</version>-->
<!--<version>15.0-SNAPSHOT</version>-->
<relativePath/>
Expand Down Expand Up @@ -155,11 +155,18 @@

<!-- Include the JUnit testing library -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>


</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import com.jogamp.common.util.SyncedRingbuffer;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
Expand All @@ -17,15 +16,15 @@
import org.matsim.examples.ExamplesUtils;
import org.matsim.testcases.MatsimTestUtils;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class RunAbcSimpleExampleTest{
private static final Logger log = LogManager.getLogger(RunAbcSimpleExampleTest.class) ;

@Rule public MatsimTestUtils utils = new MatsimTestUtils() ;
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils() ;

@Test
public void testMain(){
void testMain(){
try{
RunAbcSimpleExample.main( new String []{ IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ).toString()
, "--config:controler.outputDirectory=" + utils.getOutputDirectory()
Expand All @@ -45,7 +44,7 @@ public void testMain(){

for( Person expectedPerson : expected.getPersons().values() ){
Person actualPerson = actual.getPersons().get( Id.createPersonId( expectedPerson.getId() ) );
Assert.assertEquals( expectedPerson.getSelectedPlan().getScore(), actualPerson.getSelectedPlan().getScore() );
Assertions.assertEquals( expectedPerson.getSelectedPlan().getScore(), actualPerson.getSelectedPlan().getScore() );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.stream.Stream;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.matsim.core.config.Config;
import org.matsim.core.controler.OutputDirectoryHierarchy;
import org.matsim.core.utils.io.IOUtils;
Expand All @@ -39,44 +39,25 @@
* @author nagel
*
*/
@RunWith(Parameterized.class)
public class ExamplesByConfigfileTest {
@Rule public MatsimTestUtils utils = new MatsimTestUtils() ;
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils() ;

private String configFile;

public ExamplesByConfigfileTest(String configFile ) {
this.configFile = configFile ;
}

@Parameters(name = "{index}: configFilename == {0};")
public static Collection<Object[]> createTests() {
Collection<Object[]> filesToRun = new ArrayList<>();

filesToRun.add(new Object [] {"scenarios/equil/config.xml"});
filesToRun.add(new Object [] {"scenarios/equil/config-with-minimal-plans-file.xml"});
filesToRun.add(new Object [] {"scenarios/equil/config-with-mobsim.xml"});
filesToRun.add(new Object [] {"scenarios/equil/example2-config.xml"});
filesToRun.add(new Object [] {"scenarios/equil/example5-config.xml"});
filesToRun.add(new Object [] {"scenarios/equil/config-with-controlerListener.xml"});
filesToRun.add(new Object [] {"scenarios/equil/config-with-pluggablePlanStrategy.xml"});

filesToRun.add(new Object [] {"scenarios/equil-extended/config-extended.xml"});
filesToRun.add(new Object [] {"scenarios/equil-extended/config-with-lanes.xml"});
filesToRun.add(new Object [] {"scenarios/equil-extended/config-with-network-change-events.xml"});

filesToRun.add(new Object [] {"scenarios/equil-extended/config-with-subpopulation.xml"});
filesToRun.add(new Object [] {"scenarios/equil-extended/config-with-trips.xml"});

filesToRun.add(new Object [] {"scenarios/equil-mixedTraffic/config-with-mode-vehicles.xml"});
filesToRun.add(new Object [] {"scenarios/equil-mixedTraffic/config-with-all-vehicles-from-file.xml"});

filesToRun.add(new Object [] {"examples/tutorial/config/externalReplanning.xml"});

return filesToRun;

// the convention, I think, is that the output of the method marked by "@Parameters" is taken as input to the constructor
// before running each test. kai, jul'16
public static Stream<String> arguments() {
return Stream.of("scenarios/equil/config.xml",
"scenarios/equil/config-with-minimal-plans-file.xml",
"scenarios/equil/config-with-mobsim.xml",
"scenarios/equil/example2-config.xml",
"scenarios/equil/example5-config.xml",
"scenarios/equil/config-with-controlerListener.xml",
"scenarios/equil/config-with-pluggablePlanStrategy.xml",
"scenarios/equil-extended/config-extended.xml",
"scenarios/equil-extended/config-with-lanes.xml",
"scenarios/equil-extended/config-with-network-change-events.xml",
"scenarios/equil-extended/config-with-subpopulation.xml",
"scenarios/equil-extended/config-with-trips.xml",
"scenarios/equil-mixedTraffic/config-with-mode-vehicles.xml",
"scenarios/equil-mixedTraffic/config-with-all-vehicles-from-file.xml",
"examples/tutorial/config/externalReplanning.xml");
}

private String outputDir ;
Expand All @@ -86,8 +67,9 @@ public static Collection<Object[]> createTests() {
* Test method for {@link RunFromConfigfileExample#main(java.lang.String[])}.
*/
@SuppressWarnings("static-method")
@Test
public final void testMain() {
@ParameterizedTest
@MethodSource("arguments")
final void testMain(String configFile) {
if ( outputDir==null ) {
outputDir = utils.getOutputDirectory() ; // removes output dir every time this is run so run it only once
}
Expand All @@ -111,7 +93,7 @@ public final void testMain() {
}
} catch( Exception ee ){
ee.printStackTrace();
Assert.fail();
Assertions.fail();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.matsim.codeexamples.config.commandline;

import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.testcases.MatsimTestUtils;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class RunWithCommandLineOptionsExampleTest{
@Rule public MatsimTestUtils utils = new MatsimTestUtils() ;
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils() ;

@Test
public void testMain(){
void testMain(){

RunWithCommandLineOptionsExample.main( new String [] {"--config:controler.outputDirectory=" + utils.getPackageInputDirectory()} ) ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
import java.io.File;
import java.io.UncheckedIOException;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.matsim.core.utils.io.IOUtils;

/**
* @author vsp-gleich
*
*/
public class ExternalMobsimByConfigfileTest {

/**
* Test method for {@link RunExternalMobsimExample#main(java.lang.String[])}.
*/
@SuppressWarnings("static-method")
@Test
public final void testMain() {
final void testMain() {
try {
IOUtils.deleteDirectoryRecursively(new File("./output/example").toPath());
} catch ( UncheckedIOException ee ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.matsim.codeexamples.dvrptc;

import org.junit.Test;

import org.junit.jupiter.api.Test;
import org.matsim.codeexamples.extensions.dvrp.RunTaxiExample;

public class RunTaxiExampleTest {

@Test
public void test() {
void test() {
RunTaxiExample.main(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
Expand All @@ -17,14 +16,14 @@
import org.matsim.examples.ExamplesUtils;
import org.matsim.testcases.MatsimTestUtils;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

public class RunDiscreteModeChoiceExampleTest{
private static final Logger log = LogManager.getLogger( RunDiscreteModeChoiceExampleTest.class );
@Rule public MatsimTestUtils utils = new MatsimTestUtils();
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils();

@Test
public void testMain(){
void testMain(){

try{
RunDiscreteModeChoiceExample.main( new String []{ IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ).toString()
Expand All @@ -45,7 +44,7 @@ public void testMain(){

for( Person expectedPerson : expected.getPersons().values() ){
Person actualPerson = actual.getPersons().get( Id.createPersonId( expectedPerson.getId() ) );
Assert.assertEquals( expectedPerson.getSelectedPlan().getScore(), actualPerson.getSelectedPlan().getScore() );
Assertions.assertEquals( expectedPerson.getSelectedPlan().getScore(), actualPerson.getSelectedPlan().getScore() );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import java.io.File;

import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.testcases.MatsimTestUtils;

public class RunMelunPrebookingTest {
@Rule
@RegisterExtension
public MatsimTestUtils utils = new MatsimTestUtils();

@Test
public void runExample() {
void runExample() {
RunMelunPrebooking.RunSettings settings = new RunMelunPrebooking.RunSettings();

settings.prebookingShare = 0.5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package org.matsim.codeexamples.extensions.dvrp;

import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Test;
import org.apache.logging.log4j.LogManager;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.population.Population;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.events.EventsUtils;
import org.matsim.core.population.PopulationUtils;
import org.matsim.testcases.MatsimTestUtils;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

public class RunDrtExampleTest{
private static final Logger log = LogManager.getLogger( RunDrtExampleTest.class );
@Rule public MatsimTestUtils utils = new MatsimTestUtils();
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils();

@Test
public void testMain(){
void testMain(){
try{
RunDrtExample.run(false,
"scenarios/multi_mode_one_shared_taxi/multi_mode_one_shared_taxi_config.xml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package org.matsim.codeexamples.extensions.emissions;

import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Test;
import org.apache.logging.log4j.LogManager;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.population.Population;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.events.EventsUtils;
import org.matsim.core.population.PopulationUtils;
import org.matsim.testcases.MatsimTestUtils;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

public class RunAverageEmissionToolOfflineExampleTest{
private static final Logger log = LogManager.getLogger( RunAverageEmissionToolOfflineExampleTest.class );
@Rule public MatsimTestUtils utils = new MatsimTestUtils();
@RegisterExtension public MatsimTestUtils utils = new MatsimTestUtils();

@Test
public void testMain(){
void testMain(){

try{
RunAverageEmissionToolOfflineExample.main( new String []{ "./scenarios/sampleScenario/testv2_Vehv2/config_average.xml"
Expand Down
Loading

0 comments on commit 0994136

Please sign in to comment.