Ignore:
Timestamp:
2024-03-14T16:34:12+01:00 (14 months ago)
Author:
taylor.smock
Message:

StreetSide: Update to official API

This also moves the plugin to Java 21 (mostly for virtual threads), reformats the
code to match the JOSM standard (4 spaces), and fixes a bunch of lint issues.

Additionally, a lot of cruft from when this plugin was copied from Mapillary was
removed. That was largely related to image import, uploading, and login.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTaskTest.java

    r36194 r36228  
    77import java.util.List;
    88import java.util.concurrent.Callable;
     9import java.util.concurrent.ExecutionException;
    910import java.util.concurrent.ExecutorService;
    1011import java.util.concurrent.Executors;
     
    1314import org.junit.jupiter.api.Disabled;
    1415import org.junit.jupiter.api.Test;
     16import org.openstreetmap.josm.plugins.streetside.CubeMapTileXY;
     17import org.openstreetmap.josm.plugins.streetside.utils.TestUtil;
    1518
    1619@Disabled
     
    1821
    1922    @Test
    20     final void testCall() throws InterruptedException {
    21         ExecutorService pool = Executors.newFixedThreadPool(1);
    22         List<Callable<List<String>>> tasks = new ArrayList<>(1);
    23         tasks.add(new TileDownloadingTask("2202112030033001233"));
    24         List<Future<List<String>>> results = pool.invokeAll(tasks);
    25         assertEquals(results.get(0), "2202112030033001233");
     23    final void testCall() throws InterruptedException, ExecutionException {
     24        try (ExecutorService pool = Executors.newFixedThreadPool(1)) {
     25            List<Callable<List<String>>> tasks = new ArrayList<>(1);
     26            tasks.add(new TileDownloadingTask(TestUtil.generateImage("2202112030033001233", 0, 0),
     27                    CubemapUtils.CubemapFaces.FRONT, new CubeMapTileXY(CubemapUtils.CubemapFaces.FRONT, 0, 0)));
     28            List<Future<List<String>>> results = pool.invokeAll(tasks);
     29            assertEquals("2202112030033001233", results.get(0).get().get(0));
     30        }
    2631    }
    2732}
Note: See TracChangeset for help on using the changeset viewer.