progress logging on slower test cases

pull/1/head
Mike Barry 2021-09-18 06:07:44 -04:00
rodzic 7df851ca53
commit efbba82594
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -16,9 +16,13 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.CsvSource;
import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Geometry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FeatureMergeTest { public class FeatureMergeTest {
private static final Logger LOGGER = LoggerFactory.getLogger(FeatureMergeTest.class);
private VectorTile.Feature feature(long id, Geometry geom, Map<String, Object> attrs) { private VectorTile.Feature feature(long id, Geometry geom, Map<String, Object> attrs) {
return new VectorTile.Feature( return new VectorTile.Feature(
"layer", "layer",
@ -579,8 +583,9 @@ public class FeatureMergeTest {
"bostonbuildings.mbtiles, 2479, 3028, 13, 1074", "bostonbuildings.mbtiles, 2479, 3028, 13, 1074",
"jakartabuildings.mbtiles, 6527, 4240, 13, 410" "jakartabuildings.mbtiles, 6527, 4240, 13, 410"
}) })
public void testMergeManyPolygons(String file, int x, int y, int z, int expected) public void testMergeManyPolygons__TAKES_A_MINUTE_OR_TWO(String file, int x, int y, int z, int expected)
throws IOException, GeometryException { throws IOException, GeometryException {
LOGGER.warn("Testing complex polygon merging for " + file + " " + z + "/" + x + "/" + y + " ...");
try (var db = Mbtiles.newReadOnlyDatabase(TestUtils.pathToResource(file))) { try (var db = Mbtiles.newReadOnlyDatabase(TestUtils.pathToResource(file))) {
byte[] tileData = db.getTile(x, y, z); byte[] tileData = db.getTile(x, y, z);
byte[] gunzipped = TestUtils.gunzip(tileData); byte[] gunzipped = TestUtils.gunzip(tileData);

Wyświetl plik

@ -52,12 +52,16 @@ import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.io.InputStreamInStream; import org.locationtech.jts.io.InputStreamInStream;
import org.locationtech.jts.io.WKBReader; import org.locationtech.jts.io.WKBReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* In-memory tests with fake data and profiles to ensure all features work end-to-end. * In-memory tests with fake data and profiles to ensure all features work end-to-end.
*/ */
public class FlatmapTests { public class FlatmapTests {
private static final Logger LOGGER = LoggerFactory.getLogger(FlatmapTests.class);
private static final String TEST_PROFILE_NAME = "test name"; private static final String TEST_PROFILE_NAME = "test name";
private static final String TEST_PROFILE_DESCRIPTION = "test description"; private static final String TEST_PROFILE_DESCRIPTION = "test description";
private static final String TEST_PROFILE_ATTRIBUTION = "test attribution"; private static final String TEST_PROFILE_ATTRIBUTION = "test attribution";
@ -678,6 +682,7 @@ public class FlatmapTests {
}) })
public void testComplexShorelinePolygons__TAKES_A_MINUTE_OR_TWO(String fileName, int expected) public void testComplexShorelinePolygons__TAKES_A_MINUTE_OR_TWO(String fileName, int expected)
throws Exception { throws Exception {
LOGGER.warn("Testing complex shoreline processing for " + fileName + " ...");
MultiPolygon geometry = (MultiPolygon) new WKBReader() MultiPolygon geometry = (MultiPolygon) new WKBReader()
.read(new InputStreamInStream(Files.newInputStream(TestUtils.pathToResource(fileName)))); .read(new InputStreamInStream(Files.newInputStream(TestUtils.pathToResource(fileName))));
assertNotNull(geometry); assertNotNull(geometry);