diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/config/PlanetilerConfig.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/config/PlanetilerConfig.java index e304eb6e37..0563485044 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/config/PlanetilerConfig.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/config/PlanetilerConfig.java @@ -124,7 +124,7 @@ public static PlanetilerConfig from(Arguments arguments) { int renderMaxzoom = arguments.getInteger("render_maxzoom", "maximum rendering zoom level up to " + MAX_MAXZOOM, Math.max(maxzoom, DEFAULT_MAXZOOM)); - Path tmpDir = arguments.file("tmpdir", "temp directory", Path.of("data", "tmp")); + Path tmpDir = arguments.file("tmpdir|tmp", "temp directory", Path.of("data", "tmp")); return new PlanetilerConfig( arguments, diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/AppendStoreTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/AppendStoreTest.java index 0c2b38f5dd..3b9eac02bb 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/AppendStoreTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/AppendStoreTest.java @@ -10,15 +10,15 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -class AppendStoreTest { +abstract class AppendStoreTest { - static abstract class IntsTest { + abstract static class IntsTest { protected AppendStore.Ints store; @ParameterizedTest @ValueSource(ints = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) - public void writeThenRead(int num) { + void writeThenRead(int num) { for (int i = 0; i < num; i++) { store.appendInt(i + 1); } @@ -30,7 +30,7 @@ public void writeThenRead(int num) { } @Test - public void readBig() { + void readBig() { store.appendInt(Integer.MAX_VALUE); store.appendInt(Integer.MAX_VALUE - 1); store.appendInt(Integer.MAX_VALUE - 2); @@ -40,13 +40,13 @@ public void readBig() { } } - static abstract class LongsTest { + abstract static class LongsTest { protected AppendStore.Longs store; @ParameterizedTest @ValueSource(ints = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) - public void writeThenRead(int num) { + void writeThenRead(int num) { for (int i = 0; i < num; i++) { store.appendLong(i + 1); } @@ -61,82 +61,82 @@ public void writeThenRead(int num) { @ParameterizedTest @ValueSource(longs = {maxInt - 1, maxInt, maxInt + 1, 2 * maxInt - 1, 2 * maxInt, 5 * maxInt - 1, 5 * maxInt + 1}) - public void readBig(long value) { + void readBig(long value) { store.appendLong(value); assertEquals(value, store.getLong(0)); } } - static class RamInt extends IntsTest { + static class RamIntTest extends IntsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStoreRam.Ints(false, 4 << 2); } } - static class MMapInt extends IntsTest { + static class MMapIntTest extends IntsTest { @BeforeEach - public void setup(@TempDir Path path) { + void setup(@TempDir Path path) { this.store = new AppendStoreMmap.Ints(path.resolve("ints"), 4 << 2, true); } } - static class DirectInt extends IntsTest { + static class DirectIntTest extends IntsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStoreRam.Ints(true, 4 << 2); } } - static class RamLong extends LongsTest { + static class RamLongTest extends LongsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStoreRam.Longs(false, 4 << 2); } } - static class MMapLong extends LongsTest { + static class MMapLongTest extends LongsTest { @BeforeEach - public void setup(@TempDir Path path) { + void setup(@TempDir Path path) { this.store = new AppendStoreMmap.Longs(path.resolve("longs"), 4 << 2, true); } } - static class DirectLong extends LongsTest { + static class DirectLongTest extends LongsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStoreRam.Longs(true, 4 << 2); } } - static class MMapSmallLong extends LongsTest { + static class MMapSmallLongTest extends LongsTest { @BeforeEach - public void setup(@TempDir Path path) { + void setup(@TempDir Path path) { this.store = new AppendStore.SmallLongs( (i) -> new AppendStoreMmap.Ints(path.resolve("smalllongs" + i), 4 << 2, true)); } } - static class RamSmallLong extends LongsTest { + static class RamSmallLongTest extends LongsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStore.SmallLongs((i) -> new AppendStoreRam.Ints(false, 4 << 2)); } } - static class DirectSmallLong extends LongsTest { + static class DirectSmallLongTest extends LongsTest { @BeforeEach - public void setup() { + void setup() { this.store = new AppendStore.SmallLongs((i) -> new AppendStoreRam.Ints(true, 4 << 2)); } } diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/LongLongMultimapTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/LongLongMultimapTest.java index e51367aeda..ffb943692f 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/LongLongMultimapTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/collection/LongLongMultimapTest.java @@ -11,18 +11,18 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -public abstract class LongLongMultimapTest { +abstract class LongLongMultimapTest { protected LongLongMultimap map; protected boolean retainInputOrder = false; @Test - public void missingValue() { + void missingValue() { assertTrue(map.get(0).isEmpty()); } @Test - public void oneValue() { + void oneValue() { put(1, 1); assertResultLists(LongArrayList.from(), map.get(0)); assertResultLists(LongArrayList.from(1), map.get(1)); @@ -50,7 +50,7 @@ private void putAll(long k, LongArrayList vs) { } @Test - public void twoConsecutiveValues() { + void twoConsecutiveValues() { put(1, 1); put(2, 2); assertResultLists(LongArrayList.from(), map.get(0)); @@ -60,7 +60,7 @@ public void twoConsecutiveValues() { } @Test - public void twoNonconsecutiveValues() { + void twoNonconsecutiveValues() { put(1, 1); put(3, 3); assertResultLists(LongArrayList.from(), map.get(0)); @@ -71,7 +71,7 @@ public void twoNonconsecutiveValues() { } @Test - public void returnToFirstKey() { + void returnToFirstKey() { if (retainInputOrder) { return; } @@ -91,7 +91,7 @@ public void returnToFirstKey() { } @Test - public void manyInsertsOrdered() { + void manyInsertsOrdered() { long[] toInsert = new long[10]; for (int i = 0; i < 100; i++) { for (int j = 0; j < 10; j++) { @@ -128,7 +128,7 @@ private void assertResultLists(LongArrayList expected, LongArrayList actual) { } @Test - public void manyInsertsUnordered() { + void manyInsertsUnordered() { for (long i = 99; i >= 0; i--) { putAll(i, LongArrayList.from( i * 10 + 10, @@ -160,7 +160,7 @@ public void manyInsertsUnordered() { } @Test - public void multiInsert() { + void multiInsert() { putAll(1, LongArrayList.from(1, 2, 3)); put(0, 3); assertResultLists(LongArrayList.from(3), map.get(0)); @@ -168,35 +168,35 @@ public void multiInsert() { assertResultLists(LongArrayList.from(), map.get(2)); } - public static class SparseUnorderedTest extends LongLongMultimapTest { + static class SparseUnorderedTest extends LongLongMultimapTest { @BeforeEach - public void setup() { + void setup() { this.map = LongLongMultimap.newAppendableMultimap(); } } - public static class DenseOrderedTest extends LongLongMultimapTest { + static class DenseOrderedTest extends LongLongMultimapTest { @BeforeEach - public void setup() { + void setup() { retainInputOrder = true; this.map = LongLongMultimap.newInMemoryReplaceableMultimap(); } } - public static class DenseOrderedMmapTest extends LongLongMultimapTest { + static class DenseOrderedMmapTest extends LongLongMultimapTest { @BeforeEach - public void setup(@TempDir Path dir) { + void setup(@TempDir Path dir) { retainInputOrder = true; this.map = LongLongMultimap.newReplaceableMultimap(Storage.MMAP, new Storage.Params(dir.resolve("multimap"), true)); } @AfterEach - public void teardown() { + void teardown() { this.map.close(); } } diff --git a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/BikeRouteOverlayTest.java b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/BikeRouteOverlayTest.java index 7dbc25ef11..e2e311b818 100644 --- a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/BikeRouteOverlayTest.java +++ b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/BikeRouteOverlayTest.java @@ -96,7 +96,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception { // Override input source locations "osm_path", TestUtils.pathToResource("monaco-latest.osm.pbf"), // Override temp dir location - "tmp", tmpDir.toString(), + "tmpdir", tmpDir.toString(), // Override output location "output", dbPath.toString() )); diff --git a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/OsmQaTilesTest.java b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/OsmQaTilesTest.java index 656695084c..808791f058 100644 --- a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/OsmQaTilesTest.java +++ b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/OsmQaTilesTest.java @@ -91,7 +91,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception { // Override input source locations "osm_path", TestUtils.pathToResource("monaco-latest.osm.pbf"), // Override temp dir location - "tmp", tmpDir.toString(), + "tmpdir", tmpDir.toString(), // Override output location "output", dbPath.toString() )); diff --git a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/ToiletsProfileTest.java b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/ToiletsProfileTest.java index 691cbf992c..8f3bc74652 100644 --- a/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/ToiletsProfileTest.java +++ b/planetiler-examples/src/test/java/com/onthegomap/planetiler/examples/ToiletsProfileTest.java @@ -56,7 +56,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception { // Override input source locations "osm_path", TestUtils.pathToResource("monaco-latest.osm.pbf"), // Override temp dir location - "tmp", tmpDir.toString(), + "tmpdir", tmpDir.toString(), // Override output location "output", dbPath.toString() )); diff --git a/pom.xml b/pom.xml index 1ebdbce031..987dd7dda2 100644 --- a/pom.xml +++ b/pom.xml @@ -236,11 +236,15 @@ org.apache.maven.plugins maven-surefire-plugin 3.5.2 - + + + + **/*.java + @@ -451,6 +455,7 @@ maven-surefire-plugin !slow + 1C diff --git a/scripts/fasttests.sh b/scripts/fasttests.sh index e4a6cbb760..9a8674e765 100755 --- a/scripts/fasttests.sh +++ b/scripts/fasttests.sh @@ -4,4 +4,4 @@ set -o errexit set -o pipefail set -o nounset -./mvnw -Pfast clean test +./mvnw -T 1C -Pfast clean test