Changeset 12634 in josm for trunk/test


Ignore:
Timestamp:
2017-08-24T15:54:00+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.worker, replace it by gui.MainApplication.worker + code refactoring to make sure only editor packages use it

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

Legend:

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

    r12633 r12634  
    2121import org.openstreetmap.josm.Main.InitializationTask;
    2222import org.openstreetmap.josm.actions.AboutAction;
    23 import org.openstreetmap.josm.gui.DownloadParamType;
    2423import org.openstreetmap.josm.gui.MapFrameListener;
    2524import org.openstreetmap.josm.io.OnlineResource;
     
    4039    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4140    public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main().projection();
    42 
    43     /**
    44      * Unit test of {@link DownloadParamType#paramType} method.
    45      */
    46     @Test
    47     public void testParamType() {
    48         assertEquals(DownloadParamType.bounds, DownloadParamType.paramType("48.000,16.000,48.001,16.001"));
    49         assertEquals(DownloadParamType.fileName, DownloadParamType.paramType("data.osm"));
    50         assertEquals(DownloadParamType.fileUrl, DownloadParamType.paramType("file:///home/foo/data.osm"));
    51         assertEquals(DownloadParamType.fileUrl, DownloadParamType.paramType("file://C:\\Users\\foo\\data.osm"));
    52         assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("http://somewhere.com/data.osm"));
    53         assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("https://somewhere.com/data.osm"));
    54     }
    5541
    5642    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r12633 r12634  
    4747    @Rule
    4848    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    49     public JOSMTestRules test = new JOSMTestRules().platform().main();
     49    public JOSMTestRules test = new JOSMTestRules().main().https().devAPI().timeout(20000);
    5050
    5151    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
     
    8585    public void testShowHelp() throws Exception {
    8686        testShow("--help", MainApplication.getHelp().trim());
     87    }
     88
     89    /**
     90     * Unit test of {@link DownloadParamType#paramType} method.
     91     */
     92    @Test
     93    public void testParamType() {
     94        assertEquals(DownloadParamType.bounds, DownloadParamType.paramType("48.000,16.000,48.001,16.001"));
     95        assertEquals(DownloadParamType.fileName, DownloadParamType.paramType("data.osm"));
     96        assertEquals(DownloadParamType.fileUrl, DownloadParamType.paramType("file:///home/foo/data.osm"));
     97        assertEquals(DownloadParamType.fileUrl, DownloadParamType.paramType("file://C:\\Users\\foo\\data.osm"));
     98        assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("http://somewhere.com/data.osm"));
     99        assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("https://somewhere.com/data.osm"));
    87100    }
    88101
  • trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java

    r12633 r12634  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data;
     2package org.openstreetmap.josm.gui.io;
    33
    44import static org.junit.Assert.assertEquals;
     
    1818import org.openstreetmap.josm.Main;
    1919import org.openstreetmap.josm.TestUtils;
    20 import org.openstreetmap.josm.data.CustomConfigurator.PreferencesUtils;
     20import org.openstreetmap.josm.data.Preferences;
     21import org.openstreetmap.josm.data.PreferencesUtils;
     22import org.openstreetmap.josm.gui.io.CustomConfigurator;
    2123import org.openstreetmap.josm.testutils.JOSMTestRules;
    2224import org.openstreetmap.josm.tools.Utils;
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java

    r12633 r12634  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data;
     2package org.openstreetmap.josm.gui.layer;
    33
    44import static org.junit.Assert.assertEquals;
     
    2323import org.junit.Test;
    2424import org.openstreetmap.josm.Main;
    25 import org.openstreetmap.josm.data.AutosaveTask.AutosaveLayerInfo;
    2625import org.openstreetmap.josm.data.coor.LatLon;
    2726import org.openstreetmap.josm.data.osm.DataSet;
    2827import org.openstreetmap.josm.data.osm.Node;
     28import org.openstreetmap.josm.gui.layer.AutosaveTask;
    2929import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     30import org.openstreetmap.josm.gui.layer.AutosaveTask.AutosaveLayerInfo;
    3031import org.openstreetmap.josm.testutils.JOSMTestRules;
    3132
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java

    r10989 r12634  
    66import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.gui.MainApplication;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
    1010
     
    2828    @Test
    2929    public void testFullyAutomaticAuthorizationUI() {
    30         assertNotNull(new FullyAutomaticAuthorizationUI("", Main.worker));
     30        assertNotNull(new FullyAutomaticAuthorizationUI("", MainApplication.worker));
    3131    }
    3232}
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java

    r10989 r12634  
    66import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.gui.MainApplication;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
    1010
     
    2828    @Test
    2929    public void testManualAuthorizationUI() {
    30         assertNotNull(new ManualAuthorizationUI("", Main.worker));
     30        assertNotNull(new ManualAuthorizationUI("", MainApplication.worker));
    3131    }
    3232}
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java

    r10989 r12634  
    66import org.junit.Rule;
    77import org.junit.Test;
    8 import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.gui.MainApplication;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
    1010
     
    2828    @Test
    2929    public void testSemiAutomaticAuthorizationUI() {
    30         assertNotNull(new SemiAutomaticAuthorizationUI("", Main.worker));
     30        assertNotNull(new SemiAutomaticAuthorizationUI("", MainApplication.worker));
    3131    }
    3232}
Note: See TracChangeset for help on using the changeset viewer.