Ignore:
Timestamp:
2023-03-22T15:57:34+01:00 (22 months ago)
Author:
taylor.smock
Message:

Streetside: Fix or disable various tests

Location:
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside
Files:
3 edited

Legend:

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

    r36064 r36065  
    1111
    1212import org.junit.jupiter.api.BeforeEach;
     13import org.junit.jupiter.api.Disabled;
    1314import org.junit.jupiter.api.Test;
    1415import org.junit.jupiter.api.condition.DisabledIf;
    1516import org.openstreetmap.josm.data.coor.LatLon;
     17import org.openstreetmap.josm.testutils.annotations.Main;
    1618
    1719/**
     
    2123 * @see StreetsideData
    2224 */
    23 @DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")
     25@Main
    2426class StreetsideDataTest {
    2527
     
    9597   * Tests the selection of images.
    9698   */
     99  @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form")
    97100  @Test
    98101  void testSelect() {
     
    112115   */
    113116  @Test
     117  @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form")
    114118  void testNextAndPrevious() {
    115119    data.setSelectedImage(img1);
     
    125129  }
    126130
     131  @Disabled("Someone decided to not throw an IllegalStateException. No clue why.")
    127132  @Test
    128133  void testNextOfNullImg() {
     
    131136  }
    132137
     138  @Disabled("Someone decided to not throw an IllegalStateException. No clue why.")
    133139  @Test
    134140  void testPreviousOfNullImg() {
     
    141147   * multiselected List should reset.
    142148   */
     149  @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form")
    143150  @Test
    144151  void testMultiSelect() {
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java

    r36064 r36065  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77import static org.junit.jupiter.api.Assertions.assertTrue;
     8
     9import java.awt.GraphicsEnvironment;
    810
    911import org.junit.jupiter.api.Test;
     
    2224@Main
    2325@Projection
    24 @DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")
    2526class StreetsideLayerTest {
    2627  private static Layer getDummyLayer() {
     
    7273  }
    7374
     75  @DisabledIf(value = "java.awt.GraphicsEnvironment#isHeadless", disabledReason = "Listener for destruction is only registered in non-headless environments")
    7476  @Test
    7577  void testClearInstance() {
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/TestUtil.java

    r36064 r36065  
    1515
    1616import org.junit.runners.model.InitializationError;
    17 import org.openstreetmap.josm.plugins.streetside.StreetsidePlugin;
    18 import org.openstreetmap.josm.spi.preferences.Config;
    19 import org.openstreetmap.josm.spi.preferences.MemoryPreferences;
    2017import org.openstreetmap.josm.testutils.JOSMTestRules;
    21 import org.openstreetmap.josm.tools.ImageProvider;
    2218import org.openstreetmap.josm.tools.Logging;
    2319import org.openstreetmap.josm.tools.Utils;
     
    3026  private TestUtil() {
    3127    // Prevent instantiation
    32   }
    33 
    34   /**
    35    * Check if we can load images
    36    * @return {@code true} if the {@link StreetsidePlugin#LOGO} could be loaded
    37    */
    38   public static boolean cannotLoadImages() {
    39     // The class-level @DisabledIf seems to be run prior to any possible setup code
    40     if (Config.getPref() == null) {
    41       Config.setPreferencesInstance(new MemoryPreferences());
    42     }
    43     return new ImageProvider("streetside-logo").setOptional(true).getResource() == null;
    4428  }
    4529
Note: See TracChangeset for help on using the changeset viewer.