Changeset 18001 in josm for trunk/test
- Timestamp:
- 2021-07-11T14:39:42+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java
r17938 r18001 2 2 package org.openstreetmap.josm.gui.tagging.presets; 3 3 4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 7 import java.util.Arrays; 8 import java.util.Locale; 9 10 import javax.swing.JLabel; 11 5 12 import org.junit.jupiter.api.BeforeEach; 6 13 import org.junit.jupiter.api.Test; … … 9 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 17 import org.openstreetmap.josm.data.osm.OsmUtils; 18 import org.openstreetmap.josm.data.osm.Tag; 11 19 import org.openstreetmap.josm.data.validation.OsmValidator; 12 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 21 14 import javax.swing.JLabel; 15 16 import static org.junit.jupiter.api.Assertions.assertEquals; 17 import static org.junit.jupiter.api.Assertions.assertTrue; 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 23 19 24 /** … … 31 36 @BeforeEach 32 37 void setUp() { 38 Locale.setDefault(Locale.ENGLISH); 33 39 OsmValidator.initialize(); 34 40 } … … 38 44 */ 39 45 @Test 40 void validate() {46 void testValidate() { 41 47 JLabel label = new JLabel(); 42 48 OsmPrimitive primitive = OsmUtils.createPrimitive("way incline=10m width=1mm opening_hours=\"Mo-Fr 8-10\""); … … 53 59 "<li>suspicious tag combination (incline on suspicious object)</li></ul>", label.getToolTipText()); 54 60 } 61 62 /** 63 * Tests {@link TaggingPresetValidation#applyChangedTags} 64 */ 65 @Test 66 void testApplyChangedTags() { 67 OsmPrimitive primitive = OsmUtils.createPrimitive("way incline=10m width=1mm opening_hours=\"Mo-Fr 8-10\""); 68 new DataSet(primitive); 69 OsmPrimitive clone = TaggingPresetValidation.applyChangedTags(primitive, Arrays.asList(new Tag("incline", "20m"))); 70 assertEquals("20m", clone.get("incline")); 71 assertEquals("1mm", clone.get("width")); 72 } 55 73 }
Note:
See TracChangeset
for help on using the changeset viewer.