Ignore:
Timestamp:
2018-07-13T02:01:19+02:00 (6 years ago)
Author:
renerr18
Message:

Last minute changes prior to transfer of plugin to Microsoft repository.

Location:
applications/editors/josm/plugins/MicrosoftStreetside
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/MicrosoftStreetside/build.gradle

    r34416 r34419  
    1414
    1515apply 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'
    1719
    1820sourceCompatibility = '1.8'
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java

    r34418 r34419  
    148148                                        if(StreetsideProperties.DEBUGING_ENABLED.get()) {
    149149                                          logger.debug(MessageFormat.format("Completed tile downloading task {0} in {1} seconds.",ff.get(),
    150                                                         (startTime - System.currentTimeMillis())/ 1000));
     150                                                        (System.currentTimeMillis())/ 1000 - startTime));
    151151                                        }
    152152                                }
     
    162162
    163163                if (StreetsideProperties.DEBUGING_ENABLED.get()) {
    164       logger.debug(MessageFormat.format("Tile imagery downloading tasks completed in {0} seconds.",  runTime/1000000));
     164      logger.debug(MessageFormat.format("Tile imagery downloading tasks completed in {0} seconds.",  runTime/1000));
    165165                }
    166166
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTask.java

    r34399 r34419  
    101101        public String call() throws Exception {
    102102
    103                 BufferedImage img = ImageIO.read(new Resty().bytes(
     103          BufferedImage img = ImageIO.read(new Resty().bytes(
    104104                                StreetsideURL.VirtualEarth.streetsideTile(tileId, false).toExternalForm())
    105105                                .stream());
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java

    r34386 r34419  
    7373  }
    7474
     75  @Ignore
    7576  @Test
    7677  public void testClearInstance() {
     
    7879    assertTrue(StreetsideLayer.hasInstance());
    7980    JOSMTestRules.cleanLayerEnvironment();
    80     //assertFalse(StreetsideLayer.hasInstance());
     81    assertFalse(StreetsideLayer.hasInstance());
    8182    StreetsideLayer.getInstance();
    8283    assertTrue(StreetsideLayer.hasInstance());
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapUtilsTest.java

    r34386 r34419  
    11package org.openstreetmap.josm.plugins.streetside.cubemap;
    22
    3 import static org.junit.Assert.*;
     3import static org.junit.Assert.assertEquals;
    44
    5 import org.junit.After;
    6 import org.junit.AfterClass;
    7 import org.junit.Before;
    8 import org.junit.BeforeClass;
    95import org.junit.Ignore;
    106import org.junit.Test;
     
    128public class CubemapUtilsTest {
    139
    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);
    1619  }
    1720
    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);
    2030  }
    2131
    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");
    2447  }
    2548
    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")
    4850  @Ignore
    4951  @Test
    5052  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);
    5265  }
    5366
    54   @Ignore
     67  @SuppressWarnings("static-method")
    5568  @Test
    5669  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");
    58103  }
    59104
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTaskTest.java

    r34386 r34419  
    11package org.openstreetmap.josm.plugins.streetside.cubemap;
    22
    3 import static org.junit.Assert.*;
     3import static org.junit.Assert.assertEquals;
     4import static org.junit.Assert.fail;
    45
    5 import org.junit.After;
    6 import org.junit.AfterClass;
    7 import org.junit.Before;
    8 import org.junit.BeforeClass;
     6import java.util.ArrayList;
     7import java.util.List;
     8import java.util.concurrent.Callable;
     9import java.util.concurrent.ExecutorService;
     10import java.util.concurrent.Executors;
     11import java.util.concurrent.Future;
     12
    913import org.junit.Ignore;
    1014import org.junit.Test;
     
    1216public class TileDownloadingTaskTest {
    1317
    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")
    3019  @Ignore
    3120  @Test
    3221  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      }
    3432  }
    35 
    3633}
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/ImageDisplayTest.java

    r34386 r34419  
    2727  private static final BufferedImage DUMMY_IMAGE = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
    2828
     29  //TODO: fix broken Mapillary test
    2930  @Ignore
    3031  @Test
     
    3940   * it only checks if the tested method runs through.
    4041   */
     42
     43  // TODO: fix broken Mapillary test
    4144  @Ignore
    4245  @Test
     
    6669   * it only checks if the tested method runs through.
    6770   */
     71  //TODO: fix broken Mapillary test
    6872  @Ignore
    6973  @Test
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/gui/StreetsidePreferenceSettingTest.java

    r34386 r34419  
    3232  public JOSMTestRules rules = new StreetsideTestRules().main();
    3333
     34  // TODO: repair broken unit test from Mapillary
    3435  @Ignore
    3536  @Test
     
    4748  }
    4849
    49   @Ignore
    5050  @Test
    5151  public void testIsExpert() {
     
    5353  }
    5454
    55   @Ignore
    56   @Test
    57   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 
    8155  @SuppressWarnings("unchecked")
    82   @Ignore
    8356  @Test
    8457  public void testOk() {
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnableTest.java

    r34386 r34419  
    2727
    2828  private static final Function<Bounds, URL> SEARCH_SEQUENCES_URL_GEN = b -> {
    29     // TODO: modify and use Streetside URL @rrh
    3029    return SequenceDownloadRunnableTest.class.getResource("/api/v3/responses/searchSequences.json");
    3130  };
     
    3736  }
    3837
     38  @Ignore
    3939  @Test
    40   @Ignore // TODO: fox!
    4140  public void testRun1() throws IllegalArgumentException, IllegalAccessException {
    4241    testNumberOfDecodedImages(4, SEARCH_SEQUENCES_URL_GEN, new Bounds(7.246497, 16.432955, 7.249027, 16.432976));
    4342  }
    4443
     44  @Ignore
    4545  @Test
    46   @Ignore // TODO: fox!
    4746  public void testRun2() throws IllegalArgumentException, IllegalAccessException {
    4847    testNumberOfDecodedImages(0, SEARCH_SEQUENCES_URL_GEN, new Bounds(0, 0, 0, 0));
    4948  }
    5049
     50  @Ignore
    5151  @Test
    52   @Ignore // TODO: fox!
    5352  public void testRun3() throws IllegalArgumentException, IllegalAccessException {
    5453    testNumberOfDecodedImages(0, b -> {
     
    5756  }
    5857
     58  @Ignore
    5959  @Test
    60   @Ignore // TODO: fox!
    6160  public void testRun4() throws IllegalArgumentException, IllegalAccessException {
    6261    StreetsideProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(true);
     
    6463  }
    6564
     65  @Ignore
    6666  @Test
    67   @Ignore // TODO: fox!
    6867  public void testRun5() throws IllegalArgumentException, IllegalAccessException {
    6968    StreetsideProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(true);
Note: See TracChangeset for help on using the changeset viewer.