Changeset 12558 in josm


Ignore:
Timestamp:
2017-08-02T21:45:32+02:00 (4 months ago)
Author:
Don-vip
Message:

see #15102 - unit tests update

Location:
trunk
Files:
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/NameFinder.java

    r12557 r12558  
    4242    /**
    4343     * Nominatim URL property.
    44      * @since xxx
     44     * @since 12557
    4545     */
    4646    public static final StringProperty NOMINATIM_URL_PROP = new StringProperty("nominatim-url", NOMINATIM_URL);
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java

    r12557 r12558  
    1818 * Superclass of {@link DownloadGpsTaskTest}, {@link DownloadOsmTaskTest} and {@link DownloadNotesTaskTest}.
    1919 */
    20 public abstract class AbstractDownloadTaskTest {
     20public abstract class AbstractDownloadTaskTestParent {
    2121
    2222    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java

    r12557 r12558  
    1414 * Unit tests for class {@link DownloadGpsTask}.
    1515 */
    16 public class DownloadGpsTaskTest extends AbstractDownloadTaskTest {
     16public class DownloadGpsTaskTest extends AbstractDownloadTaskTestParent {
    1717
    1818    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTaskTest.java

    r12557 r12558  
    1414 * Unit tests for class {@link DownloadNotesTask}.
    1515 */
    16 public class DownloadNotesTaskTest extends AbstractDownloadTaskTest {
     16public class DownloadNotesTaskTest extends AbstractDownloadTaskTestParent {
    1717
    1818    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskTest.java

    r12557 r12558  
    1414 * Unit tests for class {@link DownloadOsmTask}.
    1515 */
    16 public class DownloadOsmTaskTest extends AbstractDownloadTaskTest {
     16public class DownloadOsmTaskTest extends AbstractDownloadTaskTestParent {
    1717
    1818    /**
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java

    r10973 r12558  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import org.junit.BeforeClass;
    54import org.junit.Rule;
    65import org.junit.Test;
    76import org.junit.rules.ExpectedException;
    8 import org.openstreetmap.josm.JOSMFixture;
    97import org.openstreetmap.josm.Main;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1210import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     11import org.openstreetmap.josm.testutils.JOSMTestRules;
     12
     13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1314
    1415/**
     
    2627     * Setup test.
    2728     */
    28     @BeforeClass
    29     public static void setUpBeforeClass() {
    30         JOSMFixture.createUnitTestFixture().init(true);
    31     }
     29    @Rule
     30    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     31    public JOSMTestRules test = new JOSMTestRules();
    3232
    3333    private static AddNodeHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java

    r10973 r12558  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import org.junit.BeforeClass;
    54import org.junit.Rule;
    65import org.junit.Test;
    76import org.junit.rules.ExpectedException;
    8 import org.openstreetmap.josm.JOSMFixture;
    97import org.openstreetmap.josm.Main;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1210import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     11import org.openstreetmap.josm.testutils.JOSMTestRules;
     12
     13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1314
    1415/**
     
    2627     * Setup test.
    2728     */
    28     @BeforeClass
    29     public static void setUpBeforeClass() {
    30         JOSMFixture.createUnitTestFixture().init(true);
    31     }
     29    @Rule
     30    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     31    public JOSMTestRules test = new JOSMTestRules();
    3232
    3333    private static AddWayHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java

    r10973 r12558  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import org.junit.BeforeClass;
    54import org.junit.Rule;
    65import org.junit.Test;
    76import org.junit.rules.ExpectedException;
    8 import org.openstreetmap.josm.JOSMFixture;
    97import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1011
    1112/**
     
    2324     * Setup test.
    2425     */
    25     @BeforeClass
    26     public static void setUpBeforeClass() {
    27         JOSMFixture.createUnitTestFixture().init(true);
    28     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules().platform();
    2929
    3030    private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java

    r10973 r12558  
    66import java.io.File;
    77
    8 import org.junit.BeforeClass;
    98import org.junit.Rule;
    109import org.junit.Test;
    1110import org.junit.rules.ExpectedException;
    12 import org.openstreetmap.josm.JOSMFixture;
    1311import org.openstreetmap.josm.Main;
    1412import org.openstreetmap.josm.TestUtils;
    1513import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1614import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     15import org.openstreetmap.josm.testutils.JOSMTestRules;
    1716import org.openstreetmap.josm.tools.Utils;
     17
     18import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1819
    1920/**
     
    3132     * Setup test.
    3233     */
    33     @BeforeClass
    34     public static void setUpBeforeClass() {
    35         JOSMFixture.createUnitTestFixture().init(true);
    36     }
     34    @Rule
     35    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     36    public JOSMTestRules test = new JOSMTestRules().mainMenu();
    3737
    3838    private static ImportHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java

    r10973 r12558  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import org.junit.BeforeClass;
    54import org.junit.Rule;
    65import org.junit.Test;
    76import org.junit.rules.ExpectedException;
    8 import org.openstreetmap.josm.JOSMFixture;
    97import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1011
    1112/**
     
    2324     * Setup test.
    2425     */
    25     @BeforeClass
    26     public static void setUpBeforeClass() {
    27         JOSMFixture.createUnitTestFixture().init(true);
    28     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules();
    2929
    3030    private static LoadAndZoomHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java

    r10973 r12558  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import org.junit.BeforeClass;
    54import org.junit.Rule;
    65import org.junit.Test;
    76import org.junit.rules.ExpectedException;
    8 import org.openstreetmap.josm.JOSMFixture;
    97import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     8import org.openstreetmap.josm.testutils.JOSMTestRules;
     9
     10import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1011
    1112/**
     
    2324     * Setup test.
    2425     */
    25     @BeforeClass
    26     public static void setUpBeforeClass() {
    27         JOSMFixture.createUnitTestFixture().init(true);
    28     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules();
    2929
    3030    private static LoadObjectHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java

    r11621 r12558  
    88import java.util.Map;
    99
     10import org.junit.Rule;
    1011import org.junit.Test;
    1112import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1213import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     14import org.openstreetmap.josm.testutils.JOSMTestRules;
     15
     16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1317
    1418/**
     
    1620 */
    1721public class RequestHandlerTest {
     22
     23    /**
     24     * Setup test.
     25     */
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules();
    1829
    1930    Map<String, String> getRequestParameter(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r12557 r12558  
    215215     * Use the {@link Main#main} application in this test.
    216216     * @return this instance, for easy chaining
    217      * @since xxx
     217     * @since 12557
    218218     */
    219219    public JOSMTestRules main() {
     
    225225     * Use the {@link Main#menu} in this test.
    226226     * @return this instance, for easy chaining
    227      * @since xxx
     227     * @since 12557
    228228     */
    229229    public JOSMTestRules mainMenu() {
    230230        main();
     231        platform();
    231232        mainMenu = true;
    232233        return this;
Note: See TracChangeset for help on using the changeset viewer.