Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (3 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/unit/org/openstreetmap/josm/gui/layer/LayerTest.java

    r15496 r17275  
    22package org.openstreetmap.josm.gui.layer;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNotNull;
    7 import static org.junit.Assert.assertNull;
    8 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertNotNull;
     7import static org.junit.jupiter.api.Assertions.assertNull;
     8import static org.junit.jupiter.api.Assertions.assertTrue;
    99
    1010import java.io.File;
    1111
    12 import org.junit.Before;
    13 import org.junit.Rule;
    14 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeEach;
     13import org.junit.jupiter.api.Test;
     14import org.junit.jupiter.api.extension.RegisterExtension;
    1515import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    1616import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    2222 * @author Michael Zangl
    2323 */
    24 public class LayerTest {
     24class LayerTest {
    2525    /**
    2626     * We need projection
    2727     */
    28     @Rule
     28    @RegisterExtension
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3030    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
     
    3535     * Create test layer
    3636     */
    37     @Before
     37    @BeforeEach
    3838    public void setUp() {
    3939        testLayer = new LayerManagerTest.TestLayer();
     
    4444     */
    4545    @Test
    46     public void testIsInfoResizable() {
     46    void testIsInfoResizable() {
    4747        assertFalse(testLayer.isInfoResizable());
    4848    }
     
    5252     */
    5353    @Test
    54     public void testAssociatedFile() {
     54    void testAssociatedFile() {
    5555        assertNull(testLayer.getAssociatedFile());
    5656
     
    6464     */
    6565    @Test
    66     public void testGetName() {
     66    void testGetName() {
    6767        assertEquals("Test Layer", testLayer.getName());
    6868    }
     
    7272     */
    7373    @Test
    74     public void testSetName() {
     74    void testSetName() {
    7575        testLayer.setName("Test Layer2");
    7676        assertEquals("Test Layer2", testLayer.getName());
     
    8989     */
    9090    @Test
    91     public void testRename() {
     91    void testRename() {
    9292        assertFalse(testLayer.isRenamed());
    9393        testLayer.rename("Test Layer2");
     
    100100     */
    101101    @Test
    102     public void testBackgroundLayer() {
     102    void testBackgroundLayer() {
    103103        assertFalse(testLayer.isBackgroundLayer());
    104104        testLayer.setBackgroundLayer(true);
     
    110110     */
    111111    @Test
    112     public void testVisible() {
     112    void testVisible() {
    113113        assertTrue(testLayer.isVisible());
    114114        testLayer.setVisible(false);
     
    122122     */
    123123    @Test
    124     public void testToggleVisible() {
     124    void testToggleVisible() {
    125125        assertTrue(testLayer.isVisible());
    126126        testLayer.toggleVisible();
     
    134134     */
    135135    @Test
    136     public void testOpacity() {
     136    void testOpacity() {
    137137        assertEquals(1, testLayer.getOpacity(), 1e-3);
    138138
     
    152152     */
    153153    @Test
    154     public void testIsProjectionSupported() {
     154    void testIsProjectionSupported() {
    155155        assertFalse(testLayer.isProjectionSupported(null));
    156156        assertTrue(testLayer.isProjectionSupported(ProjectionRegistry.getProjection()));
     
    161161     */
    162162    @Test
    163     public void testNameSupportedProjections() {
     163    void testNameSupportedProjections() {
    164164        assertNotNull(testLayer.nameSupportedProjections());
    165165    }
     
    169169     */
    170170    @Test
    171     public void testIsSavable() {
     171    void testIsSavable() {
    172172        assertFalse(testLayer.isSavable());
    173173    }
     
    177177     */
    178178    @Test
    179     public void testCheckSaveConditions() {
     179    void testCheckSaveConditions() {
    180180        assertTrue(testLayer.checkSaveConditions());
    181181    }
Note: See TracChangeset for help on using the changeset viewer.