Changeset 12754 in josm


Ignore:
Timestamp:
2017-09-06T10:17:46+02:00 (2 weeks ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - see #13036 - update unit tests

Location:
trunk/test/unit/org/openstreetmap/josm/plugins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java

    r10050 r12754  
    44import static org.junit.Assert.assertEquals;
    55
    6 import org.junit.BeforeClass;
     6import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.JOSMFixture;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    911
    1012/**
     
    1618     * Setup test.
    1719     */
    18     @BeforeClass
    19     public static void setUp() {
    20         JOSMFixture.createUnitTestFixture().init();
    21     }
     20    @Rule
     21    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     22    public JOSMTestRules test = new JOSMTestRules();
    2223
    2324    /**
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java

    r10050 r12754  
    44import static org.junit.Assert.assertEquals;
    55
    6 import org.junit.BeforeClass;
     6import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.JOSMFixture;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    911
    1012/**
     
    1618     * Setup test.
    1719     */
    18     @BeforeClass
    19     public static void setUp() {
    20         JOSMFixture.createUnitTestFixture().init();
    21     }
     20    @Rule
     21    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     22    public JOSMTestRules test = new JOSMTestRules();
    2223
    2324    /**
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java

    r11974 r12754  
    1111import java.util.List;
    1212
    13 import org.junit.BeforeClass;
     13import org.junit.Rule;
    1414import org.junit.Test;
    15 import org.openstreetmap.josm.JOSMFixture;
    1615import org.openstreetmap.josm.Main;
    1716import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferenceTest;
    1817import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin;
    1918import org.openstreetmap.josm.plugins.PluginHandler.PluginInformationAction;
     19import org.openstreetmap.josm.testutils.JOSMTestRules;
    2020import org.openstreetmap.josm.tools.Utils;
    2121
     22import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2223import nl.jqno.equalsverifier.EqualsVerifier;
    2324
     
    3031     * Setup test.
    3132     */
    32     @BeforeClass
    33     public static void setUp() {
    34         JOSMFixture.createUnitTestFixture().init();
    35     }
     33    @Rule
     34    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     35    public JOSMTestRules test = new JOSMTestRules().platform();
    3636
    3737    /**
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java

    r12636 r12754  
    1818import org.apache.commons.collections.MapUtils;
    1919import org.apache.commons.lang.exception.ExceptionUtils;
    20 import org.junit.BeforeClass;
    2120import org.junit.Rule;
    2221import org.junit.Test;
    23 import org.junit.rules.Timeout;
    24 import org.openstreetmap.josm.JOSMFixture;
    2522import org.openstreetmap.josm.Main;
    2623import org.openstreetmap.josm.data.gpx.GpxData;
     
    3128import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3229import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
     30import org.openstreetmap.josm.testutils.JOSMTestRules;
    3331
    3432import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    4038
    4139    /**
    42      * Global timeout applied to all test methods.
     40     * Setup test.
    4341     */
    4442    @Rule
    4543    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    46     public Timeout globalTimeout = Timeout.seconds(10*60);
    47 
    48     /**
    49      * Setup test.
    50      */
    51     @BeforeClass
    52     public static void setUp() {
    53         JOSMFixture.createUnitTestFixture().init(true);
    54     }
     44    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().timeout(10*60*1000);
    5545
    5646    /**
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java

    r10050 r12754  
    44import static org.junit.Assert.assertEquals;
    55
    6 import org.junit.BeforeClass;
     6import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.JOSMFixture;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    911
    1012/**
     
    1618     * Setup test.
    1719     */
    18     @BeforeClass
    19     public static void setUp() {
    20         JOSMFixture.createUnitTestFixture().init();
    21     }
     20    @Rule
     21    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     22    public JOSMTestRules test = new JOSMTestRules();
    2223
    2324    /**
Note: See TracChangeset for help on using the changeset viewer.