Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (5 years ago)
Author:
Don-vip
Message:

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java

    r17144 r17275  
    22package org.openstreetmap.josm.tools;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNotNull;
    74import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
     5import static org.junit.jupiter.api.Assertions.assertEquals;
     6import static org.junit.jupiter.api.Assertions.assertFalse;
     7import static org.junit.jupiter.api.Assertions.assertNotNull;
    88import static org.openstreetmap.josm.gui.mappaint.MapCSSRendererTest.assertImageEquals;
    99
     
    4848 * Unit tests of {@link ImageProvider} class.
    4949 */
    50 public class ImageProviderTest {
     50class ImageProviderTest {
    5151
    5252    /**
     
    9494     */
    9595    @Test
    96     public void testTicket9984() throws IOException {
     96    void testTicket9984() throws IOException {
    9797        File file = new File(TestUtils.getRegressionDataFile(9984, "tile.png"));
    9898        assertEquals(Transparency.TRANSLUCENT, ImageProvider.read(file, true, true).getTransparency());
     
    108108     */
    109109    @Test
    110     public void testTicket10030() throws IOException {
     110    void testTicket10030() throws IOException {
    111111        File file = new File(TestUtils.getRegressionDataFile(10030, "tile.jpg"));
    112112        BufferedImage img = ImageProvider.read(file, true, true);
     
    120120    @Test
    121121    @SuppressFBWarnings(value = "LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE")
    122     public void testTicket14319() throws IOException {
     122    void testTicket14319() throws IOException {
    123123        LogHandler14319 handler = new LogHandler14319();
    124124        Logger.getLogger(SVGConst.SVG_LOGGER).addHandler(handler);
     
    134134     */
    135135    @Test
    136     public void testTicket19551() throws SAXException {
     136    void testTicket19551() throws SAXException {
    137137        TaggingPreset badPreset = new TaggingPreset();
    138138        badPreset.setType("node,way,relation,closedway");
     
    155155     */
    156156    @Test
    157     public void testDataUrl() {
     157    void testDataUrl() {
    158158        // Red dot image, taken from https://en.wikipedia.org/wiki/Data_URI_scheme#HTML
    159159        assertNotNull(ImageProvider.get("data:image/png;base64," +
     
    167167     */
    168168    @Test
    169     public void testImageIcon() throws IOException {
     169    void testImageIcon() throws IOException {
    170170        ImageResource resource = new ImageProvider("presets/misc/housenumber_small").getResource();
    171171        testImage(12, 9, "housenumber_small-AUTO-null", resource.getImageIcon());
     
    182182     */
    183183    @Test
    184     public void testImageIconBounded() throws IOException {
     184    void testImageIconBounded() throws IOException {
    185185        ImageResource resource = new ImageProvider("presets/misc/housenumber_small").getResource();
    186186        testImage(8, 6, "housenumber_small-BOUNDED-08x08", resource.getImageIconBounded(new Dimension(8, 8)));
     
    194194     */
    195195    @Test
    196     public void testImageIconPadded() throws IOException {
     196    void testImageIconPadded() throws IOException {
    197197        ImageResource resource = new ImageProvider("presets/misc/housenumber_small").getResource();
    198198        testImage(8, 8, "housenumber_small-PADDED-08x08", resource.getPaddedIcon(new Dimension(8, 8)));
     
    204204        final BufferedImage image = (BufferedImage) icon.getImage();
    205205        final File referenceFile = getReferenceFile(reference);
    206         assertEquals("width", width, image.getWidth(null));
    207         assertEquals("height", height, image.getHeight(null));
     206        assertEquals(width, image.getWidth(null), "width");
     207        assertEquals(height, image.getHeight(null), "height");
    208208        assertImageEquals(reference, referenceFile, image, 0, 0, null);
    209209    }
     
    219219     */
    220220    @Test
    221     public void testGetImageIconBounded() {
     221    void testGetImageIconBounded() {
    222222        int scale = 2;
    223223        GuiSizesHelper.setPixelDensity(scale);
     
    240240    /**
    241241     * Test getting an image for a crosshair cursor.
     242     * @param guiScale coefficient of monitor pixel density to be set
     243     * @throws IOException in case of I/O error
    242244     */
    243245    @ParameterizedTest
    244246    @ValueSource(floats = {1.0f, 1.5f, 3.0f})
    245     public void testGetCursorImageForCrosshair(float guiScale) throws IOException {
     247    void testGetCursorImageForCrosshair(float guiScale) throws IOException {
    246248        GuiSizesHelper.setPixelDensity(guiScale);
    247249        Point hotSpot = new Point();
     
    255257    /**
    256258     * Test getting an image for a custom cursor with overlay.
     259     * @param guiScale coefficient of monitor pixel density to be set
     260     * @throws IOException in case of I/O error
    257261     */
    258262    @ParameterizedTest
    259263    @ValueSource(floats = {1.0f, 1.5f, 3.0f})
    260     public void testGetCursorImageWithOverlay(float guiScale) throws IOException {
     264    void testGetCursorImageWithOverlay(float guiScale) throws IOException {
    261265        GuiSizesHelper.setPixelDensity(guiScale);
    262266        Point hotSpot = new Point();
Note: See TracChangeset for help on using the changeset viewer.