Changeset 12643 in josm for trunk/test


Ignore:
Timestamp:
2017-08-25T10:18:53+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.main.menu. Replacement: gui.MainApplication.getMenu()

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

Legend:

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

    r12642 r12643  
    191191        MainApplicationTest.initToolbar();
    192192    }
     193
     194    /**
     195     * Make sure {@code MainApplication.menu} is initialized.
     196     */
     197    public static void initMainMenu() {
     198        MainApplicationTest.initMainMenu();
     199    }
    193200}
  • trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java

    r12636 r12643  
    88import org.junit.Rule;
    99import org.junit.Test;
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.actions.AlignInLineAction.InvalidSelection;
    1211import org.openstreetmap.josm.actions.AlignInLineAction.Line;
     
    4342    public void setUp() {
    4443        // Enable "Align in line" feature.
    45         action = Main.main.menu.alignInLine;
     44        action = MainApplication.getMenu().alignInLine;
    4645        action.setEnabled(true);
    4746    }
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r12636 r12643  
    1717import org.junit.Rule;
    1818import org.junit.Test;
    19 import org.openstreetmap.josm.Main;
    2019import org.openstreetmap.josm.TestUtils;
    2120import org.openstreetmap.josm.actions.search.SearchAction;
     
    8887                assertEquals(2, found.size());
    8988
    90                 Main.main.menu.joinAreas.join(Utils.filteredCollection(found, Way.class));
     89                MainApplication.getMenu().joinAreas.join(Utils.filteredCollection(found, Way.class));
    9190
    9291                Collection<OsmPrimitive> found2 = SearchAction.searchAndReturn("type:way ref="+ref, SearchAction.SearchMode.replace);
  • trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java

    r12636 r12643  
    1313import org.junit.Rule;
    1414import org.junit.Test;
    15 import org.openstreetmap.josm.Main;
    1615import org.openstreetmap.josm.command.DeleteCommand;
    1716import org.openstreetmap.josm.command.SequenceCommand;
     
    4847    public void setUp() {
    4948        if (action == null) {
    50             action = Main.main.menu.simplifyWay;
     49            action = MainApplication.getMenu().simplifyWay;
    5150            action.setEnabled(true);
    5251        }
  • trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java

    r12641 r12643  
    1414import org.junit.Rule;
    1515import org.junit.Test;
    16 import org.openstreetmap.josm.Main;
    1716import org.openstreetmap.josm.actions.SplitWayAction.Strategy;
    1817import org.openstreetmap.josm.data.coor.EastNorth;
     
    5150    public void setUp() {
    5251        if (action == null) {
    53             action = Main.main.menu.splitWay;
     52            action = MainApplication.getMenu().splitWay;
    5453            action.setEnabled(true);
    5554        }
  • trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java

    r12636 r12643  
    88import org.junit.Rule;
    99import org.junit.Test;
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.data.coor.LatLon;
    1211import org.openstreetmap.josm.data.osm.DataSet;
     
    4039    public void setUp() {
    4140        if (action == null) {
    42             action = Main.main.menu.unglueNodes;
     41            action = MainApplication.getMenu().unglueNodes;
    4342            action.setEnabled(true);
    4443        }
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r12642 r12643  
    9191            Main.main.panel = MainApplication.mainPanel;
    9292        }
     93    }
     94
     95    /**
     96     * Make sure {@code MainApplication.menu} is initialized.
     97     */
     98    @SuppressWarnings("deprecation")
     99    public static void initMainMenu() {
     100        MainApplication.menu = new MainMenu();
     101        Main.main.menu = MainApplication.menu;
    93102    }
    94103
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r12636 r12643  
    1818import org.openstreetmap.josm.data.projection.Projections;
    1919import org.openstreetmap.josm.gui.MainApplication;
    20 import org.openstreetmap.josm.gui.MainMenu;
    2120import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    2221import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
     
    351350                JOSMFixture.initMainPanel(true);
    352351                JOSMFixture.initToolbar();
    353                 Main.main.menu = new MainMenu();
     352                JOSMFixture.initMainMenu();
    354353            }
    355354        }
Note: See TracChangeset for help on using the changeset viewer.