Changeset 36065 in osm for applications/editors/josm/plugins/MicrosoftStreetside/test
- Timestamp:
- 2023-03-22T15:57:34+01:00 (22 months ago)
- 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 11 11 12 12 import org.junit.jupiter.api.BeforeEach; 13 import org.junit.jupiter.api.Disabled; 13 14 import org.junit.jupiter.api.Test; 14 15 import org.junit.jupiter.api.condition.DisabledIf; 15 16 import org.openstreetmap.josm.data.coor.LatLon; 17 import org.openstreetmap.josm.testutils.annotations.Main; 16 18 17 19 /** … … 21 23 * @see StreetsideData 22 24 */ 23 @ DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")25 @Main 24 26 class StreetsideDataTest { 25 27 … … 95 97 * Tests the selection of images. 96 98 */ 99 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 97 100 @Test 98 101 void testSelect() { … … 112 115 */ 113 116 @Test 117 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 114 118 void testNextAndPrevious() { 115 119 data.setSelectedImage(img1); … … 125 129 } 126 130 131 @Disabled("Someone decided to not throw an IllegalStateException. No clue why.") 127 132 @Test 128 133 void testNextOfNullImg() { … … 131 136 } 132 137 138 @Disabled("Someone decided to not throw an IllegalStateException. No clue why.") 133 139 @Test 134 140 void testPreviousOfNullImg() { … … 141 147 * multiselected List should reset. 142 148 */ 149 @Disabled("The imgs have non-int identifiers while the code expects the identifiers to be int in string form") 143 150 @Test 144 151 void testMultiSelect() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java
r36064 r36065 6 6 import static org.junit.jupiter.api.Assertions.assertThrows; 7 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 9 import java.awt.GraphicsEnvironment; 8 10 9 11 import org.junit.jupiter.api.Test; … … 22 24 @Main 23 25 @Projection 24 @DisabledIf(value = "org.openstreetmap.josm.plugins.streetside.utils.TestUtil#cannotLoadImages", disabledReason = "At JOSM maintainer request (flaky?)")25 26 class StreetsideLayerTest { 26 27 private static Layer getDummyLayer() { … … 72 73 } 73 74 75 @DisabledIf(value = "java.awt.GraphicsEnvironment#isHeadless", disabledReason = "Listener for destruction is only registered in non-headless environments") 74 76 @Test 75 77 void testClearInstance() { -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/TestUtil.java
r36064 r36065 15 15 16 16 import 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;20 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 import org.openstreetmap.josm.tools.ImageProvider;22 18 import org.openstreetmap.josm.tools.Logging; 23 19 import org.openstreetmap.josm.tools.Utils; … … 30 26 private TestUtil() { 31 27 // Prevent instantiation 32 }33 34 /**35 * Check if we can load images36 * @return {@code true} if the {@link StreetsidePlugin#LOGO} could be loaded37 */38 public static boolean cannotLoadImages() {39 // The class-level @DisabledIf seems to be run prior to any possible setup code40 if (Config.getPref() == null) {41 Config.setPreferencesInstance(new MemoryPreferences());42 }43 return new ImageProvider("streetside-logo").setOptional(true).getResource() == null;44 28 } 45 29
Note:
See TracChangeset
for help on using the changeset viewer.