Changeset 16838 in josm for trunk/test
- Timestamp:
- 2020-08-03T22:06:40+02:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/tools
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java
r16810 r16838 156 156 Node node = new Node(LatLon.ZERO); 157 157 node.put("amenity", "fuel"); 158 assertDoesNotThrow(() -> ImageProvider.getPadded(node, ImageProvider.ImageSizes.MAP.getImageDimension(), Collections.emptyList()));158 assertDoesNotThrow(() -> OsmPrimitiveImageProvider.getResource(node, Collections.emptyList())); 159 159 } 160 160 -
trunk/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java
r16837 r16838 12 12 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetsTest; 13 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 14 import org.openstreetmap.josm.tools. ImageProvider.GetPaddedOptions;14 import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider.Options; 15 15 16 16 import java.awt.Dimension; … … 21 21 22 22 /** 23 * Unit tests of getPadded method of the {@link ImageProvider} class. 24 * This unit test is separated because it is the only one that needs a slow initialization. 23 * Unit tests of {@link OsmPrimitiveImageProvider} 25 24 */ 26 public class ImageProviderGetPaddedTest {25 public class OsmPrimitiveImageProviderTest { 27 26 28 27 /** … … 42 41 43 42 /** 44 * Unit test of {@link ImageProvider#getPadded}.43 * Unit test of {@link OsmPrimitiveImageProvider#getResource}. 45 44 */ 46 45 @Test 47 public void testGet Padded() {46 public void testGetResource() { 48 47 TaggingPresetsTest.waitForIconLoading(TaggingPresets.getTaggingPresets()); 49 48 50 final EnumSet< GetPaddedOptions> noDefault = EnumSet.of(GetPaddedOptions.NO_DEFAULT);49 final EnumSet<Options> noDefault = EnumSet.of(Options.NO_DEFAULT); 51 50 final Dimension iconSize = new Dimension(16, 16); 52 51 53 52 assertNull(ImageProvider.getPadded(new Node(), new Dimension(0, 0))); 54 53 assertNotNull(ImageProvider.getPadded(new Node(), iconSize)); 55 assertNull( ImageProvider.getPadded(new Node(), iconSize, noDefault));56 assertNotNull( ImageProvider.getPadded(OsmUtils.createPrimitive("node amenity=restaurant"), iconSize, noDefault));57 assertNull( ImageProvider.getPadded(OsmUtils.createPrimitive("node barrier=hedge"), iconSize,58 EnumSet.of( GetPaddedOptions.NO_DEFAULT, GetPaddedOptions.NO_DEPRECATED)));59 assertNotNull( ImageProvider.getPadded(OsmUtils.createPrimitive("way waterway=stream"), iconSize, noDefault));60 assertNotNull( ImageProvider.getPadded(OsmUtils.createPrimitive("relation type=route route=railway"), iconSize, noDefault));54 assertNull(OsmPrimitiveImageProvider.getResource(new Node(), noDefault)); 55 assertNotNull(OsmPrimitiveImageProvider.getResource(OsmUtils.createPrimitive("node amenity=restaurant"), noDefault)); 56 assertNull(OsmPrimitiveImageProvider.getResource(OsmUtils.createPrimitive("node barrier=hedge"), 57 EnumSet.of(Options.NO_DEFAULT, Options.NO_DEPRECATED))); 58 assertNotNull(OsmPrimitiveImageProvider.getResource(OsmUtils.createPrimitive("way waterway=stream"), noDefault)); 59 assertNotNull(OsmPrimitiveImageProvider.getResource(OsmUtils.createPrimitive("relation type=route route=railway"), noDefault)); 61 60 } 62 61 }
Note:
See TracChangeset
for help on using the changeset viewer.