Changeset 19428 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2025-07-13T20:19:41+02:00 (4 months ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 5 edited
-
actions/AddImageryLayerActionTest.java (modified) (2 diffs)
-
actions/CreateMultipolygonActionTest.java (modified) (2 diffs)
-
actions/JoinAreasActionTest.java (modified) (2 diffs)
-
actions/JoinNodeWayActionTest.java (modified) (2 diffs)
-
gui/conflict/pair/tags/TagMergeItemTest.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r19292 r19428 6 6 import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; 7 7 import static org.junit.jupiter.api.Assertions.assertEquals; 8 import static org.junit.jupiter.api.Assertions.assertThrows; 8 9 import static org.junit.jupiter.api.Assertions.assertTrue; 9 10 … … 100 101 void testActionPerformedDisabled() { 101 102 assertTrue(MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); 102 try { 103 new AddImageryLayerAction(new ImageryInfo("foo")).actionPerformed(null); 104 } catch (IllegalArgumentException expected) { 105 assertEquals("Parameter 'info.url' must not be null", expected.getMessage()); 106 } 103 final AddImageryLayerAction action = new AddImageryLayerAction(new ImageryInfo("foo")); 104 IllegalArgumentException expected = assertThrows(IllegalArgumentException.class, () -> action.actionPerformed(null)); 105 assertEquals("Parameter 'info.url' must not be null", expected.getMessage()); 107 106 assertTrue(MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); 108 107 } -
trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
r19066 r19428 33 33 import org.openstreetmap.josm.testutils.annotations.MapPaintStyles; 34 34 import org.openstreetmap.josm.testutils.annotations.Projection; 35 import org.openstreetmap.josm.testutils.annotations.Territories; 35 36 import org.openstreetmap.josm.tools.Pair; 36 37 import org.openstreetmap.josm.tools.SubclassFilteredCollection; … … 43 44 @MapPaintStyles 44 45 @Projection 46 @Territories(Territories.Initialize.ALL) 45 47 class CreateMultipolygonActionTest { 46 48 private static Map<String, String> getRefToRoleMap(Relation relation) { -
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r19078 r19428 38 38 import org.openstreetmap.josm.testutils.annotations.Main; 39 39 import org.openstreetmap.josm.testutils.annotations.Projection; 40 import org.openstreetmap.josm.testutils.annotations.Territories; 40 41 import org.openstreetmap.josm.tools.MultiMap; 41 42 import org.openstreetmap.josm.tools.Utils; … … 47 48 @Main 48 49 @Projection 50 @Territories 49 51 class JoinAreasActionTest { 50 52 /** -
trunk/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java
r18870 r19428 29 29 import org.openstreetmap.josm.testutils.annotations.Main; 30 30 import org.openstreetmap.josm.testutils.annotations.Projection; 31 import org.openstreetmap.josm.testutils.annotations.Territories; 31 32 import org.openstreetmap.josm.tools.Geometry; 32 33 … … 37 38 @Main 38 39 @Projection 40 @Territories(Territories.Initialize.ALL) 39 41 final class JoinNodeWayActionTest { 40 42 private void setupMapView(DataSet ds) { -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java
r18037 r19428 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 import static org.junit.jupiter.api.Assertions.assertNull; 6 import static org.junit.jupiter.api.Assertions.assertThrows; 6 7 import static org.junit.jupiter.api.Assertions.fail; 7 8 … … 81 82 void testDecide1() { 82 83 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); 83 try { 84 item.decide(null); 85 fail("expected IllegalArgumentException not thrown"); 86 } catch (IllegalArgumentException e) { 87 // OK 88 Logging.trace(e); 89 } 84 assertThrows(IllegalArgumentException.class, () -> item.decide(null)); 90 85 } 91 86 … … 128 123 Node n1 = new Node(1); 129 124 n1.put("key", "oldvalue"); 130 try { 131 item.applyToMyPrimitive(n1); 132 fail("expected IllegalStateException"); 133 } catch (IllegalStateException e) { 134 // OK 135 Logging.trace(e); 136 } 125 assertThrows(IllegalStateException.class, () -> item.applyToMyPrimitive(n1)); 137 126 } 138 127 … … 141 130 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); 142 131 143 try { 144 item.applyToMyPrimitive(null); 145 fail("expected IllegalArgumentException"); 146 } catch (IllegalArgumentException e) { 147 // OK 148 Logging.trace(e); 149 } 132 assertThrows(IllegalArgumentException.class, () -> item.applyToMyPrimitive(null)); 150 133 } 151 134 }
Note:
See TracChangeset
for help on using the changeset viewer.
