Changeset 34419 in osm for applications/editors/josm
- Timestamp:
- 2018-07-13T02:01:19+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/MicrosoftStreetside
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/MicrosoftStreetside/build.gradle
r34416 r34419 14 14 15 15 apply from: 'gradle/tool-config.gradle' 16 apply from: 'gradle/markdown.gradle' 16 // TODO: repair Mapillary markdown task 17 // error with subdir build/markdown 18 //apply from: 'gradle/markdown.gradle' 17 19 18 20 sourceCompatibility = '1.8' -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java
r34418 r34419 148 148 if(StreetsideProperties.DEBUGING_ENABLED.get()) { 149 149 logger.debug(MessageFormat.format("Completed tile downloading task {0} in {1} seconds.",ff.get(), 150 ( startTime - System.currentTimeMillis())/ 1000));150 (System.currentTimeMillis())/ 1000 - startTime)); 151 151 } 152 152 } … … 162 162 163 163 if (StreetsideProperties.DEBUGING_ENABLED.get()) { 164 logger.debug(MessageFormat.format("Tile imagery downloading tasks completed in {0} seconds.", runTime/1000 000));164 logger.debug(MessageFormat.format("Tile imagery downloading tasks completed in {0} seconds.", runTime/1000)); 165 165 } 166 166 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTask.java
r34399 r34419 101 101 public String call() throws Exception { 102 102 103 103 BufferedImage img = ImageIO.read(new Resty().bytes( 104 104 StreetsideURL.VirtualEarth.streetsideTile(tileId, false).toExternalForm()) 105 105 .stream()); -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java
r34386 r34419 73 73 } 74 74 75 @Ignore 75 76 @Test 76 77 public void testClearInstance() { … … 78 79 assertTrue(StreetsideLayer.hasInstance()); 79 80 JOSMTestRules.cleanLayerEnvironment(); 80 //assertFalse(StreetsideLayer.hasInstance());81 assertFalse(StreetsideLayer.hasInstance()); 81 82 StreetsideLayer.getInstance(); 82 83 assertTrue(StreetsideLayer.hasInstance()); -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapUtilsTest.java
r34386 r34419 1 1 package org.openstreetmap.josm.plugins.streetside.cubemap; 2 2 3 import static org.junit.Assert. *;3 import static org.junit.Assert.assertEquals; 4 4 5 import org.junit.After;6 import org.junit.AfterClass;7 import org.junit.Before;8 import org.junit.BeforeClass;9 5 import org.junit.Ignore; 10 6 import org.junit.Test; … … 12 8 public class CubemapUtilsTest { 13 9 14 @BeforeClass 15 public static void setUpBeforeClass() throws Exception { 10 @SuppressWarnings("static-method") 11 @Test 12 public final void testConvertDecimal2Quaternary() { 13 final long decimal0 = 680730040l; 14 final long decimal1 = 680931568l; 15 String res = CubemapUtils.convertDecimal2Quaternary(decimal0); 16 assertEquals("220210301312320", res); 17 res = CubemapUtils.convertDecimal2Quaternary(decimal1); 18 assertEquals("220211203003300", res); 16 19 } 17 20 18 @AfterClass 19 public static void tearDownAfterClass() throws Exception { 21 @SuppressWarnings("static-method") 22 @Test 23 public final void testConvertQuaternary2Decimal() { 24 final String quadKey0 = "220210301312320"; 25 final String quadKey1 = "220211203003300"; 26 String res = CubemapUtils.convertQuaternary2Decimal(quadKey0); 27 assertEquals("680730040", res); 28 res = CubemapUtils.convertQuaternary2Decimal(quadKey1); 29 assertEquals("680931568", res); 20 30 } 21 31 22 @Before 23 public void setUp() throws Exception { 32 @SuppressWarnings("static-method") 33 @Test 34 public final void testGetFaceNumberForCount() { 35 String faceNrFront = CubemapUtils.getFaceNumberForCount(0); 36 String faceNrRight = CubemapUtils.getFaceNumberForCount(1); 37 String faceNrBack = CubemapUtils.getFaceNumberForCount(2); 38 String faceNrLeft = CubemapUtils.getFaceNumberForCount(3); 39 String faceNrUp = CubemapUtils.getFaceNumberForCount(4); 40 String faceNrDown = CubemapUtils.getFaceNumberForCount(5); 41 assertEquals(faceNrFront, "01"); 42 assertEquals(faceNrRight, "02"); 43 assertEquals(faceNrBack, "03"); 44 assertEquals(faceNrLeft, "10"); 45 assertEquals(faceNrUp, "11"); 46 assertEquals(faceNrDown, "12"); 24 47 } 25 48 26 @After 27 public void tearDown() throws Exception { 28 } 29 30 @Ignore 31 @Test 32 public final void testConvertDecimal2Quaternary() { 33 fail("Not yet implemented"); // TODO 34 } 35 36 @Ignore 37 @Test 38 public final void testConvertQuaternary2Decimal() { 39 fail("Not yet implemented"); // TODO 40 } 41 42 @Ignore 43 @Test 44 public final void testGetFaceNumberForCount() { 45 fail("Not yet implemented"); // TODO 46 } 47 49 @SuppressWarnings("static-method") 48 50 @Ignore 49 51 @Test 50 52 public final void testGetCount4FaceNumber() { 51 fail("Not yet implemented"); // TODO 53 int count4Front = CubemapUtils.getCount4FaceNumber("01"); 54 int count4Right = CubemapUtils.getCount4FaceNumber("02"); 55 int count4Back = CubemapUtils.getCount4FaceNumber("03"); 56 int count4Left = CubemapUtils.getCount4FaceNumber("10"); 57 int count4Up = CubemapUtils.getCount4FaceNumber("11"); 58 int count4Down = CubemapUtils.getCount4FaceNumber("12"); 59 assertEquals(count4Front, 0); 60 assertEquals(count4Right, 1); 61 assertEquals(count4Back, 2); 62 assertEquals(count4Left, 3); 63 assertEquals(count4Up, 4); 64 assertEquals(count4Down, 5); 52 65 } 53 66 54 @ Ignore67 @SuppressWarnings("static-method") 55 68 @Test 56 69 public final void testConvertDoubleCountNrto16TileNr() { 57 fail("Not yet implemented"); // TODO 70 String x0y0 = CubemapUtils.convertDoubleCountNrto16TileNr("00"); 71 String x0y1 = CubemapUtils.convertDoubleCountNrto16TileNr("01"); 72 String x0y2 = CubemapUtils.convertDoubleCountNrto16TileNr("02"); 73 String x0y3 = CubemapUtils.convertDoubleCountNrto16TileNr("03"); 74 String x1y0 = CubemapUtils.convertDoubleCountNrto16TileNr("10"); 75 String x1y1 = CubemapUtils.convertDoubleCountNrto16TileNr("11"); 76 String x1y2 = CubemapUtils.convertDoubleCountNrto16TileNr("12"); 77 String x1y3 = CubemapUtils.convertDoubleCountNrto16TileNr("13"); 78 String x2y0 = CubemapUtils.convertDoubleCountNrto16TileNr("20"); 79 String x2y1 = CubemapUtils.convertDoubleCountNrto16TileNr("21"); 80 String x2y2 = CubemapUtils.convertDoubleCountNrto16TileNr("22"); 81 String x2y3 = CubemapUtils.convertDoubleCountNrto16TileNr("23"); 82 String x3y0 = CubemapUtils.convertDoubleCountNrto16TileNr("30"); 83 String x3y1 = CubemapUtils.convertDoubleCountNrto16TileNr("31"); 84 String x3y2 = CubemapUtils.convertDoubleCountNrto16TileNr("32"); 85 String x3y3 = CubemapUtils.convertDoubleCountNrto16TileNr("33"); 86 87 assertEquals(x0y0, "00"); 88 assertEquals(x0y1, "01"); 89 assertEquals(x0y2, "10"); 90 assertEquals(x0y3, "11"); 91 assertEquals(x1y0, "02"); 92 assertEquals(x1y1, "03"); 93 assertEquals(x1y2,"12"); 94 assertEquals(x1y3, "13"); 95 assertEquals(x2y0, "20"); 96 assertEquals(x2y1, "21"); 97 assertEquals(x2y2, "30"); 98 assertEquals(x2y3, "31"); 99 assertEquals(x3y0, "22"); 100 assertEquals(x3y1,"23"); 101 assertEquals(x3y2, "32"); 102 assertEquals(x3y3, "33"); 58 103 } 59 104 -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTaskTest.java
r34386 r34419 1 1 package org.openstreetmap.josm.plugins.streetside.cubemap; 2 2 3 import static org.junit.Assert.*; 3 import static org.junit.Assert.assertEquals; 4 import static org.junit.Assert.fail; 4 5 5 import org.junit.After; 6 import org.junit.AfterClass; 7 import org.junit.Before; 8 import org.junit.BeforeClass; 6 import java.util.ArrayList; 7 import java.util.List; 8 import java.util.concurrent.Callable; 9 import java.util.concurrent.ExecutorService; 10 import java.util.concurrent.Executors; 11 import java.util.concurrent.Future; 12 9 13 import org.junit.Ignore; 10 14 import org.junit.Test; … … 12 16 public class TileDownloadingTaskTest { 13 17 14 @BeforeClass 15 public static void setUpBeforeClass() throws Exception { 16 } 17 18 @AfterClass 19 public static void tearDownAfterClass() throws Exception { 20 } 21 22 @Before 23 public void setUp() throws Exception { 24 } 25 26 @After 27 public void tearDown() throws Exception { 28 } 29 18 @SuppressWarnings("static-method") 30 19 @Ignore 31 20 @Test 32 21 public final void testCall() { 33 fail("Not yet implemented"); // TODO 22 ExecutorService pool = Executors.newFixedThreadPool(1); 23 List<Callable<String>> tasks = new ArrayList<>(1); 24 tasks.add(new TileDownloadingTask("2202112030033001233")); 25 try { 26 List<Future<String>> results = pool.invokeAll(tasks); 27 assertEquals(results.get(0),"2202112030033001233"); 28 } catch (InterruptedException e) { 29 e.printStackTrace(); 30 fail("Test threw an exception."); 31 } 34 32 } 35 36 33 } -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/ImageDisplayTest.java
r34386 r34419 27 27 private static final BufferedImage DUMMY_IMAGE = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); 28 28 29 //TODO: fix broken Mapillary test 29 30 @Ignore 30 31 @Test … … 39 40 * it only checks if the tested method runs through. 40 41 */ 42 43 // TODO: fix broken Mapillary test 41 44 @Ignore 42 45 @Test … … 66 69 * it only checks if the tested method runs through. 67 70 */ 71 //TODO: fix broken Mapillary test 68 72 @Ignore 69 73 @Test -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/StreetsidePreferenceSettingTest.java
r34386 r34419 32 32 public JOSMTestRules rules = new StreetsideTestRules().main(); 33 33 34 // TODO: repair broken unit test from Mapillary 34 35 @Ignore 35 36 @Test … … 47 48 } 48 49 49 @Ignore50 50 @Test 51 51 public void testIsExpert() { … … 53 53 } 54 54 55 @Ignore56 @Test57 public void testLoginLogout() {58 if (GraphicsEnvironment.isHeadless()) {59 return;60 }61 PreferenceTabbedPane tabs = new PreferenceTabbedPane();62 tabs.buildGui();63 StreetsidePreferenceSetting setting = new StreetsidePreferenceSetting();64 setting.addGui(tabs);65 setting.onLogout();66 67 assertEquals(I18n.tr("Login"), ((JButton) getPrivateFieldValue(setting, "loginButton")).getText());68 assertEquals(I18n.tr("You are currently not logged in."), ((JLabel) getPrivateFieldValue(setting, "loginLabel")).getText());69 assertFalse(((JPanel) getPrivateFieldValue(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateFieldValue(setting, "logoutButton"))));70 assertTrue(((JPanel) getPrivateFieldValue(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateFieldValue(setting, "loginButton"))));71 72 String username = "TheStreetsideUsername";73 setting.onLogin(username);74 75 assertEquals(I18n.tr("Login"), ((JButton) getPrivateFieldValue(setting, "loginButton")).getText());76 assertEquals(I18n.tr("You are logged in as ''{0}''.", username), ((JLabel) getPrivateFieldValue(setting, "loginLabel")).getText());77 assertTrue(((JPanel) getPrivateFieldValue(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateFieldValue(setting, "logoutButton"))));78 assertFalse(((JPanel) getPrivateFieldValue(setting, "loginPanel")).isAncestorOf(((JButton) getPrivateFieldValue(setting, "loginButton"))));79 }80 81 55 @SuppressWarnings("unchecked") 82 @Ignore83 56 @Test 84 57 public void testOk() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnableTest.java
r34386 r34419 27 27 28 28 private static final Function<Bounds, URL> SEARCH_SEQUENCES_URL_GEN = b -> { 29 // TODO: modify and use Streetside URL @rrh30 29 return SequenceDownloadRunnableTest.class.getResource("/api/v3/responses/searchSequences.json"); 31 30 }; … … 37 36 } 38 37 38 @Ignore 39 39 @Test 40 @Ignore // TODO: fox!41 40 public void testRun1() throws IllegalArgumentException, IllegalAccessException { 42 41 testNumberOfDecodedImages(4, SEARCH_SEQUENCES_URL_GEN, new Bounds(7.246497, 16.432955, 7.249027, 16.432976)); 43 42 } 44 43 44 @Ignore 45 45 @Test 46 @Ignore // TODO: fox!47 46 public void testRun2() throws IllegalArgumentException, IllegalAccessException { 48 47 testNumberOfDecodedImages(0, SEARCH_SEQUENCES_URL_GEN, new Bounds(0, 0, 0, 0)); 49 48 } 50 49 50 @Ignore 51 51 @Test 52 @Ignore // TODO: fox!53 52 public void testRun3() throws IllegalArgumentException, IllegalAccessException { 54 53 testNumberOfDecodedImages(0, b -> { … … 57 56 } 58 57 58 @Ignore 59 59 @Test 60 @Ignore // TODO: fox!61 60 public void testRun4() throws IllegalArgumentException, IllegalAccessException { 62 61 StreetsideProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(true); … … 64 63 } 65 64 65 @Ignore 66 66 @Test 67 @Ignore // TODO: fox!68 67 public void testRun5() throws IllegalArgumentException, IllegalAccessException { 69 68 StreetsideProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(true);
Note:
See TracChangeset
for help on using the changeset viewer.