Changeset 14369 in josm for trunk/test/unit/org
- Timestamp:
- 2018-10-27T13:03:51+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java
r14138 r14369 5 5 import static org.junit.Assert.assertNull; 6 6 7 import javax.swing.JOptionPane; 8 7 9 import org.junit.Rule; 8 10 import org.junit.Test; 11 import org.openstreetmap.josm.TestUtils; 9 12 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 10 14 import org.openstreetmap.josm.tools.LanguageInfo.LocaleType; 15 16 import com.google.common.collect.ImmutableMap; 11 17 12 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 89 95 @Test 90 96 public void testEditAction() { 97 TestUtils.assumeWorkingJMockit(); 91 98 IHelpBrowser browser = newHelpBrowser(); 92 99 assertNull(browser.getUrl()); … … 97 104 new HelpBrowser.EditAction(browser).actionPerformed(null); 98 105 106 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 107 ImmutableMap.<String, Object>of( 108 "<html>The current URL <tt>https://josm.openstreetmap.de/javadoc</tt><br>is an external " 109 + "URL. Editing is only possible for help topics<br>on the help server " 110 + "<tt>https://josm.openstreetmap.de</tt>.</html>", 111 JOptionPane.OK_OPTION 112 ) 113 ); 114 99 115 browser.openUrl(URL_3); 100 116 assertEquals(URL_3, browser.getUrl()); 101 117 new HelpBrowser.EditAction(browser).actionPerformed(null); 118 119 assertEquals(1, jopsMocker.getInvocationLog().size()); 120 Object[] invocationLogEntry = jopsMocker.getInvocationLog().get(0); 121 assertEquals(JOptionPane.OK_OPTION, (int) invocationLogEntry[0]); 122 assertEquals("Warning", invocationLogEntry[2]); 102 123 } 103 124
Note:
See TracChangeset
for help on using the changeset viewer.