Changeset 12632 in josm


Ignore:
Timestamp:
2017-08-24T01:47:00+02:00 (4 weeks ago)
Author:
Don-vip
Message:

see #15182 - fix unit tests

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
37 edited

Legend:

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

    r12620 r12632  
    4747    @Rule
    4848    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    49     public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().mainMenu().projection();
     49    public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main().projection();
    5050
    5151    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java

    r12562 r12632  
    3131    @Rule
    3232    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().mainMenu().projection();
     33    public JOSMTestRules test = new JOSMTestRules().main().projection();
    3434
    3535    /** Class under test. */
  • trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java

    r12563 r12632  
    3838    @Rule
    3939    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    40     public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu();
     40    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
    4141
    4242    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r12562 r12632  
    4747    @Rule
    4848    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    49     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
     49    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
    5050
    5151    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java

    r12563 r12632  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
     28    public JOSMTestRules test = new JOSMTestRules().platform().main();
    2929
    3030    private MergeLayerAction action;
  • trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java

    r12563 r12632  
    3232    @Rule
    3333    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
     34    public JOSMTestRules test = new JOSMTestRules().platform().main();
    3535
    3636    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java

    r11921 r12632  
    3333    @Rule
    3434    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    35     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     35    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().main();
    3636
    3737    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java

    r12562 r12632  
    3939    @Rule
    4040    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    41     public JOSMTestRules test = new JOSMTestRules().mainMenu();
     41    public JOSMTestRules test = new JOSMTestRules().main();
    4242
    4343    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java

    r12562 r12632  
    4242    @Rule
    4343    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    44     public JOSMTestRules test = new JOSMTestRules().mainMenu().projection();
     44    public JOSMTestRules test = new JOSMTestRules().main().projection();
    4545
    4646    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java

    r12562 r12632  
    3131    @Rule
    3232    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().mainMenu();
     33    public JOSMTestRules test = new JOSMTestRules().main();
    3434
    3535    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java

    r12630 r12632  
    3030    @Rule
    3131    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    32     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
     32    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
    3333
    3434    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java

    r12630 r12632  
    2828    @Rule
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
     30    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
    3131
    3232    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java

    r12630 r12632  
    4141    @Rule
    4242    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
     43    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
    4444
    4545    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java

    r12630 r12632  
    2828    @Rule
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
     30    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
    3131
    3232    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java

    r12630 r12632  
    2828    @Rule
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
     30    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
    3131
    3232    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java

    r12630 r12632  
    2929    @Rule
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
     31    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
    3232
    3333    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java

    r12630 r12632  
    2727    @Rule
    2828    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
     29    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
    3030
    3131    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r12630 r12632  
    6060    @Rule
    6161    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    62     public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu();
     62    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
    6363
    6464    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r12564 r12632  
    3636    @Rule
    3737    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
     38    public JOSMTestRules test = new JOSMTestRules().platform().main();
    3939
    4040    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
  • trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java

    r12630 r12632  
    2929    @Rule
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     31    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    3232
    3333    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java

    r12564 r12632  
    5151    @Rule
    5252    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    53     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
     53    public JOSMTestRules test = new JOSMTestRules().platform().main();
    5454
    5555    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java

    r12630 r12632  
    2828    @Rule
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     30    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    3131
    3232    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java

    r12630 r12632  
    3434    @Rule
    3535    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     36    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    3737
    3838    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java

    r12568 r12632  
    3131    @Rule
    3232    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection().mapStyles();
     33    public JOSMTestRules test = new JOSMTestRules().main().platform().projection().mapStyles();
    3434
    3535    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java

    r12630 r12632  
    2222    @Rule
    2323    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     24    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    2525
    2626    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java

    r12564 r12632  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().preferences().projection().platform().mainMenu();
     28    public JOSMTestRules test = new JOSMTestRules().preferences().projection().platform().main();
    2929
    3030    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java

    r12564 r12632  
    4646    @Rule
    4747    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    48     public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu();
     48    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
    4949
    5050    private static final class TMSTileStubSource extends AbstractTMSTileSource {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java

    r12630 r12632  
    4242    @Rule
    4343    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    44     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection().i18n();
     44    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().i18n();
    4545
    4646    private static String getHtml(GpxLayer layer) {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/MarkerLayerTest.java

    r12630 r12632  
    2727    @Rule
    2828    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     29    public JOSMTestRules test = new JOSMTestRules().main().projection();
    3030
    3131    /**
     
    3434    @Test
    3535    public void testPlayHeadMarker() {
    36         MapFrame map = MainApplication.getMap();
    3736        try {
    3837            Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
     38            MapFrame map = MainApplication.getMap();
    3939            MarkerLayer layer = new MarkerLayer(new GpxData(), null, null, null);
    4040            assertNull(map.mapView.playHeadMarker);
     
    4343            Main.getLayerManager().removeLayer(layer);
    4444        } finally {
    45             map.mapView.playHeadMarker = null;
     45            if (MainApplication.isDisplayingMapView()) {
     46                MainApplication.getMap().mapView.playHeadMarker = null;
     47            }
    4648        }
    4749    }
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java

    r12564 r12632  
    2323    @Rule
    2424    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     25    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    2626
    2727    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java

    r12564 r12632  
    2323    @Rule
    2424    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection();
     25    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
    2626
    2727    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java

    r12564 r12632  
    2929    @Rule
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
     31    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
    3232
    3333    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java

    r12564 r12632  
    3232    @Rule
    3333    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().preferences().projection();
     34    public JOSMTestRules test = new JOSMTestRules().main().platform().preferences().projection();
    3535
    3636    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java

    r12557 r12632  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
     28    public JOSMTestRules test = new JOSMTestRules().platform().main();
    2929
    3030    /**
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java

    r12558 r12632  
    3434    @Rule
    3535    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().mainMenu();
     36    public JOSMTestRules test = new JOSMTestRules().main();
    3737
    3838    private static ImportHandler newHandler(String url) throws RequestHandlerBadRequestException {
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java

    r12564 r12632  
    8888    @Rule
    8989    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    90     public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu();
     90    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
    9191
    9292    /**
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r12568 r12632  
    6060    private boolean rlTraffic;
    6161    private boolean main;
    62     private boolean mainMenu;
    6362
    6463    /**
     
    227226
    228227    /**
    229      * Use the {@link Main#main}, {@code Main.contentPanePrivate}, {@code Main.mainPanel}, {@link Main#toolbar} global variables in this test.
     228     * Use the {@link Main#main}, {@code Main.contentPanePrivate}, {@code Main.mainPanel},
     229     *         {@link Main#menu}, {@link Main#toolbar} global variables in this test.
    230230     * @return this instance, for easy chaining
    231231     * @since 12557
    232232     */
    233233    public JOSMTestRules main() {
     234        platform();
    234235        main = true;
    235         return this;
    236     }
    237 
    238     /**
    239      * Use the {@link Main#menu} in this test.
    240      * @return this instance, for easy chaining
    241      * @since 12557
    242      */
    243     public JOSMTestRules mainMenu() {
    244         main();
    245         platform();
    246         mainMenu = true;
    247236        return this;
    248237    }
     
    362351                JOSMFixture.initMainPanel(true);
    363352                JOSMFixture.initToolbar();
    364             }
    365 
    366             if (mainMenu) {
    367353                Main.main.menu = new MainMenu();
    368354            }
Note: See TracChangeset for help on using the changeset viewer.