Changeset 16838 in josm for trunk/test


Ignore:
Timestamp:
2020-08-03T22:06:40+02:00 (4 years ago)
Author:
simon04
Message:

see #19622 - Extract OsmPrimitiveImageProvider

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  
    156156        Node node = new Node(LatLon.ZERO);
    157157        node.put("amenity", "fuel");
    158         assertDoesNotThrow(() -> ImageProvider.getPadded(node, ImageProvider.ImageSizes.MAP.getImageDimension(), Collections.emptyList()));
     158        assertDoesNotThrow(() -> OsmPrimitiveImageProvider.getResource(node, Collections.emptyList()));
    159159    }
    160160
  • trunk/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java

    r16837 r16838  
    1212import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetsTest;
    1313import org.openstreetmap.josm.testutils.JOSMTestRules;
    14 import org.openstreetmap.josm.tools.ImageProvider.GetPaddedOptions;
     14import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider.Options;
    1515
    1616import java.awt.Dimension;
     
    2121
    2222/**
    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}
    2524 */
    26 public class ImageProviderGetPaddedTest {
     25public class OsmPrimitiveImageProviderTest {
    2726
    2827    /**
     
    4241
    4342    /**
    44      * Unit test of {@link ImageProvider#getPadded}.
     43     * Unit test of {@link OsmPrimitiveImageProvider#getResource}.
    4544     */
    4645    @Test
    47     public void testGetPadded() {
     46    public void testGetResource() {
    4847        TaggingPresetsTest.waitForIconLoading(TaggingPresets.getTaggingPresets());
    4948
    50         final EnumSet<GetPaddedOptions> noDefault = EnumSet.of(GetPaddedOptions.NO_DEFAULT);
     49        final EnumSet<Options> noDefault = EnumSet.of(Options.NO_DEFAULT);
    5150        final Dimension iconSize = new Dimension(16, 16);
    5251
    5352        assertNull(ImageProvider.getPadded(new Node(), new Dimension(0, 0)));
    5453        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));
    6160    }
    6261}
Note: See TracChangeset for help on using the changeset viewer.