Changeset 16810 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2020-07-29T21:19:37+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java
r16768 r16810 7 7 import static org.junit.Assert.assertNotNull; 8 8 import static org.junit.Assert.assertTrue; 9 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 9 10 10 11 import java.awt.Color; 11 12 import java.awt.Dimension; 13 import java.awt.Graphics; 12 14 import java.awt.GraphicsEnvironment; 13 15 import java.awt.GridLayout; 14 import java.awt.Graphics;15 16 import java.awt.Image; 16 17 import java.awt.Point; … … 22 23 import java.io.File; 23 24 import java.io.IOException; 25 import java.util.Arrays; 26 import java.util.Collections; 24 27 import java.util.List; 25 28 import java.util.logging.Handler; … … 38 41 import org.openstreetmap.josm.JOSMFixture; 39 42 import org.openstreetmap.josm.TestUtils; 43 import org.openstreetmap.josm.data.coor.LatLon; 44 import org.openstreetmap.josm.data.osm.Node; 45 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 46 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 47 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 40 48 import org.openstreetmap.josm.testutils.JOSMTestRules; 49 import org.xml.sax.SAXException; 41 50 42 51 import com.kitfox.svg.SVGConst; … … 48 57 */ 49 58 public class ImageProviderTest { 50 59 51 60 /** 52 61 * Setup test. … … 126 135 assertNotNull(img); 127 136 assertFalse(handler.failed); 137 } 138 139 /** 140 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/19551">#19551</a> 141 * @throws SAXException If the type cannot be set (shouldn't throw) 142 */ 143 @Test 144 public void testTicket19551() throws SAXException { 145 TaggingPreset badPreset = new TaggingPreset(); 146 badPreset.setType("node,way,relation,closedway"); 147 Key key = new Key(); 148 key.key = "amenity"; 149 key.value = "fuel"; 150 badPreset.data.add(key); 151 TaggingPreset goodPreset = new TaggingPreset(); 152 goodPreset.setType("node,way,relation,closedway"); 153 goodPreset.data.add(key); 154 goodPreset.iconName = "stop"; 155 TaggingPresets.addTaggingPresets(Arrays.asList(goodPreset, badPreset)); 156 Node node = new Node(LatLon.ZERO); 157 node.put("amenity", "fuel"); 158 assertDoesNotThrow(() -> ImageProvider.getPadded(node, ImageProvider.ImageSizes.MAP.getImageDimension(), Collections.emptyList())); 128 159 } 129 160
Note:
See TracChangeset
for help on using the changeset viewer.