Changeset 10122 in josm


Ignore:
Timestamp:
2016-04-08T22:13:47+02:00 (6 years ago)
Author:
Don-vip
Message:

add more debug messages to debug failing unit test

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java

    r10035 r10122  
    2727import javax.swing.event.ChangeListener;
    2828
     29import org.openstreetmap.josm.Main;
    2930import org.openstreetmap.josm.gui.help.HelpBrowser;
    3031import org.openstreetmap.josm.gui.help.HelpUtil;
     
    229230        }
    230231
    231         if (msg instanceof String) {
    232             msg = new JMultilineLabel((String) msg, true);
    233         }
    234 
    235232        final JOptionPane pane = new JOptionPane(
    236                 msg,
     233                msg instanceof String ? new JMultilineLabel((String) msg, true) : msg,
    237234                messageType,
    238235                JOptionPane.DEFAULT_OPTION,
     
    241238                defaultButton
    242239        );
     240
     241        // Log message. Useful for bug reports and unit tests
     242        switch (messageType) {
     243            case JOptionPane.ERROR_MESSAGE:
     244                Main.error(title + " - " + msg);
     245                break;
     246            case JOptionPane.WARNING_MESSAGE:
     247                Main.warn(title + " - " + msg);
     248                break;
     249            default:
     250                Main.info(title + " - " + msg);
     251        }
    243252
    244253        if (!GraphicsEnvironment.isHeadless()) {
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r10121 r10122  
    3939        try {
    4040            System.setProperty("josm.plugins", "buildings_tools,plastic_laf");
    41             assertEquals("buildings_tools,plastic_laf", System.getProperty("josm.plugins"));
    4241            SplashProgressMonitor monitor = new SplashProgressMonitor("foo", new ChangeListener() {
    4342                @Override
     
    4746            });
    4847            Collection<PluginInformation> plugins = MainApplication.updateAndLoadEarlyPlugins(null, monitor);
    49             assertEquals("buildings_tools,plastic_laf", System.getProperty("josm.plugins"));
    5048            assertEquals(2, plugins.size());
    5149            assertNotNull(PluginHandler.getPlugin("plastic_laf"));
Note: See TracChangeset for help on using the changeset viewer.