Ignore:
Timestamp:
2017-08-24T23:29:01+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.toolbar. Replacement: gui.MainApplication.getToolbar()

File:
1 edited

Legend:

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

    r12636 r12637  
    1919import java.util.concurrent.Future;
    2020
     21import javax.swing.UIManager;
     22
    2123import org.junit.Rule;
    2224import org.junit.Test;
     25import org.openstreetmap.josm.Main;
    2326import org.openstreetmap.josm.TestUtils;
    2427import org.openstreetmap.josm.data.Version;
     
    2629import org.openstreetmap.josm.gui.SplashScreen.SplashProgressMonitor;
    2730import org.openstreetmap.josm.gui.layer.GpxLayer;
     31import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
    2832import org.openstreetmap.josm.plugins.PluginHandler;
    2933import org.openstreetmap.josm.plugins.PluginHandlerTestIT;
     
    4751    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4852    public JOSMTestRules test = new JOSMTestRules().main().https().devAPI().timeout(20000);
     53
     54    /**
     55     * Make sure {@link MainApplication#toolbar} is initialized.
     56     */
     57    public static void initToolbar() {
     58        if (MainApplication.toolbar == null) {
     59            MainApplication.toolbar = new ToolbarPreferences();
     60        }
     61    }
    4962
    5063    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
     
    132145    }
    133146
     147    /**
     148     * Unit test of {@link MainApplication#setupUIManager}.
     149     */
     150    @Test
     151    public void testSetupUIManager() {
     152        MainApplication.setupUIManager();
     153        assertEquals(Main.pref.get("laf", Main.platform.getDefaultStyle()), UIManager.getLookAndFeel().getClass().getCanonicalName());
     154    }
     155
    134156    private static PluginInformation newPluginInformation(String plugin) throws PluginListParseException {
    135157        return PluginListParser.createInfo(plugin+".jar", "https://svn.openstreetmap.org/applications/editors/josm/dist/"+plugin+".jar",
Note: See TracChangeset for help on using the changeset viewer.