Changeset 12563 in josm


Ignore:
Timestamp:
2017-08-03T21:43:11+02:00 (3 months ago)
Author:
Don-vip
Message:

fix unit tests

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

Legend:

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

    r12559 r12563  
    151151
    152152        initContentPane();
    153         initMainPanel();
     153        initMainPanel(false);
    154154        initToolbar();
    155155        if (Main.main == null) {
     
    157157        } else {
    158158            if (Main.main.panel == null) {
    159                 initMainPanel();
     159                initMainPanel(false);
    160160                Main.main.panel = Main.mainPanel;
    161161            }
     
    177177    /**
    178178     * Make sure {@code Main.mainPanel} is initialized.
     179     * @param reAddListeners {@code true} to re-add listeners
    179180     */
    180     public static void initMainPanel() {
     181    public static void initMainPanel(boolean reAddListeners) {
    181182        if (Main.mainPanel == null) {
    182183            Main.mainPanel = new MainPanel(Main.getLayerManager());
     184        }
     185        if (reAddListeners) {
     186            Main.mainPanel.reAddListeners();
    183187        }
    184188    }
  • trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java

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

    r12562 r12563  
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.data.osm.DataSet;
    12 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    1312import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer;
    1413import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    3635    @Before
    3736    public void setUp() {
    38         try {
    39             LayerListDialog.getInstance();
    40         } catch (IllegalStateException e) {
    41             LayerListDialog.createInstance(Main.getLayerManager());
    42             Main.trace(e);
    43         }
    4437        if (action == null) {
    4538            action = new MergeLayerAction();
  • trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java

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

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

    r11978 r12563  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().platform().commands();
     28    public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
    2929
    3030    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java

    r12521 r12563  
    3939    @Rule
    4040    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    41     public JOSMTestRules test = new JOSMTestRules().commands();
     41    public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection();
    4242
    4343    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java

    r11978 r12563  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().platform().commands();
     28    public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
    2929
    3030    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java

    r11978 r12563  
    2626    @Rule
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().platform().commands();
     28    public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
    2929
    3030    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java

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

    r10945 r12563  
    2525    @Rule
    2626    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules().platform().commands();
     27    public JOSMTestRules test = new JOSMTestRules().platform().platform().mainMenu().projection();
    2828
    2929    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r12521 r12563  
    5959    @Rule
    6060    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    61     public JOSMTestRules test = new JOSMTestRules().platform().projection().commands();
     61    public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu();
    6262
    6363    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java

    r10945 r12563  
    3434    @Rule
    3535    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().commands();
     36    public JOSMTestRules test = new JOSMTestRules().main();
    3737
    3838    /**
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r12562 r12563  
    341341                new MainApplication();
    342342                JOSMFixture.initContentPane();
    343                 JOSMFixture.initMainPanel();
     343                JOSMFixture.initMainPanel(true);
    344344                JOSMFixture.initToolbar();
    345345            }
Note: See TracChangeset for help on using the changeset viewer.