Changeset 16159 in josm for trunk/test/unit
- Timestamp:
- 2020-03-17T20:09:38+01:00 (5 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
r15455 r16159 4 4 import static org.junit.Assert.assertEquals; 5 5 import static org.junit.Assert.assertNull; 6 7 import java.util.Collections; 6 8 7 9 import javax.swing.JLabel; … … 21 23 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker; 22 24 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 23 24 import com.google.common.collect.ImmutableMap;25 25 26 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 85 85 TestUtils.assumeWorkingJMockit(); 86 86 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 87 ImmutableMap.<String, Object>of("<html>There are no layers the source layer<br>'onion'<br>could be merged to.</html>", 0)87 Collections.singletonMap("<html>There are no layers the source layer<br>'onion'<br>could be merged to.</html>", 0) 88 88 ); 89 89 -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
r14410 r16159 32 32 import org.openstreetmap.josm.testutils.mockers.WindowMocker; 33 33 34 import com.google.common.collect.ImmutableMap;35 36 34 import mockit.Invocation; 37 35 import mockit.Mock; … … 122 120 TestUtils.assumeWorkingJMockit(); 123 121 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( 124 ImmutableMap.<String, Object>of(122 Collections.singletonMap( 125 123 "<html>JOSM is currently running with an anonymous user. It cannot download<br>" 126 124 + "your changesets from the OSM server unless you enter your OSM user name<br>" -
trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java
r14807 r16159 4 4 import static org.junit.Assert.assertEquals; 5 5 import static org.junit.Assert.assertNull; 6 7 import java.util.Collections; 6 8 7 9 import javax.swing.JOptionPane; … … 16 18 import org.openstreetmap.josm.tools.PlatformManager; 17 19 18 import com.google.common.collect.ImmutableMap;19 20 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 21 21 import mockit.Expectations; … … 157 157 }}; 158 158 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 159 ImmutableMap.<String, Object>of(159 Collections.singletonMap( 160 160 "<html>The current URL <tt>https://josm.openstreetmap.de/javadoc</tt><br>is an external " 161 161 + "URL. Editing is only possible for help topics<br>on the help server " -
trunk/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java
r14187 r16159 2 2 package org.openstreetmap.josm.gui.io; 3 3 4 import java.util.Collections; 4 5 import java.util.Optional; 5 6 … … 22 23 import org.openstreetmap.josm.testutils.JOSMTestRules; 23 24 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 24 25 import com.google.common.collect.ImmutableMap;26 25 27 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 90 89 public void testSingleUploadInstance() { 91 90 TestUtils.assumeWorkingJMockit(); 92 new JOptionPaneSimpleMocker( ImmutableMap.of(91 new JOptionPaneSimpleMocker(Collections.singletonMap( 93 92 "A background upload is already in progress. Kindly wait for it to finish before uploading new changes", JOptionPane.OK_OPTION 94 93 )); -
trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
r14366 r16159 9 9 import java.awt.GraphicsEnvironment; 10 10 import java.net.URL; 11 import java.util.Collections; 11 12 12 13 import javax.swing.JOptionPane; … … 22 23 import org.openstreetmap.josm.testutils.mockers.WindowMocker; 23 24 import org.openstreetmap.josm.tools.UserCancelException; 24 25 import com.google.common.collect.ImmutableMap;26 25 27 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 80 79 final OAuthWizardMocker oaWizardMocker = new OAuthWizardMocker(); 81 80 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 82 ImmutableMap.<String, Object>of(81 Collections.singletonMap( 83 82 "<html>Could not retrieve the list of your open changesets because<br>JOSM does not know " 84 83 + "your identity.<br>You have either chosen to work anonymously or you are not " … … 113 112 final OAuthWizardMocker oaWizardMocker = new OAuthWizardMocker(); 114 113 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 115 ImmutableMap.<String, Object>of("There are no open changesets", JOptionPane.OK_OPTION)114 Collections.singletonMap("There are no open changesets", JOptionPane.OK_OPTION) 116 115 ); 117 116 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r15502 r16159 12 12 import java.text.DateFormat; 13 13 import java.util.Collection; 14 import java.util.Collections; 14 15 import java.util.Iterator; 15 16 … … 39 40 import org.openstreetmap.josm.tools.Logging; 40 41 import org.openstreetmap.josm.tools.date.DateUtils; 41 42 import com.google.common.collect.ImmutableMap;43 42 44 43 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 295 294 TestUtils.assumeWorkingJMockit(); 296 295 final ExtendedDialogMocker edMocker = new ExtendedDialogMocker( 297 ImmutableMap.<String, Object>of("The document contains no data.", "Cancel")296 Collections.singletonMap("The document contains no data.", "Cancel") 298 297 ); 299 298 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r14138 r16159 5 5 import static org.junit.Assert.assertNotNull; 6 6 import static org.junit.Assert.assertNull; 7 8 import java.util.Collections; 7 9 8 10 import org.junit.Rule; … … 17 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 20 import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; 19 20 import com.google.common.collect.ImmutableMap;21 21 22 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 36 36 private static PleaseWaitRunnable createTask(String file) throws Exception { 37 37 // click "Download" when presented with the appropriate HelpAwareOptionPane 38 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( ImmutableMap.of(38 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(Collections.singletonMap( 39 39 "DownloadAlongPanel", "Download" 40 40 )) { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r14332 r16159 7 7 import static org.junit.Assert.assertNull; 8 8 import static org.junit.Assert.assertTrue; 9 10 import java.util.Collections; 9 11 10 12 import org.awaitility.Awaitility; … … 21 23 import org.openstreetmap.josm.testutils.TileSourceRule; 22 24 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 23 24 import com.google.common.collect.ImmutableMap;25 25 26 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 45 45 TestUtils.assumeWorkingJMockit(); 46 46 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 47 ImmutableMap.<String, Object>of("There are no imagery layers.", 0)47 Collections.singletonMap("There are no imagery layers.", 0) 48 48 ); 49 49 -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java
r14149 r16159 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.preferences.advanced; 3 4 import java.util.Collections; 3 5 4 6 import javax.swing.JOptionPane; … … 10 12 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 13 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 12 13 import com.google.common.collect.ImmutableMap;14 14 15 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 32 32 public void testAction() { 33 33 TestUtils.assumeWorkingJMockit(); 34 new JOptionPaneSimpleMocker( ImmutableMap.of(34 new JOptionPaneSimpleMocker(Collections.singletonMap( 35 35 "All the preferences of this group are default, nothing to save", JOptionPane.OK_OPTION 36 36 )); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
r14213 r16159 12 12 import java.nio.file.Files; 13 13 import java.util.Collection; 14 import java.util.Collections; 14 15 15 16 import javax.swing.JOptionPane; … … 35 36 import com.github.tomakehurst.wiremock.junit.WireMockRule; 36 37 import com.google.common.collect.ImmutableList; 37 import com.google.common.collect.ImmutableMap;38 38 39 39 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 137 137 new PluginServer.RemotePlugin(this.referenceDummyJarNew), 138 138 new PluginServer.RemotePlugin(this.referenceBazJarOld), 139 new PluginServer.RemotePlugin(null, ImmutableMap.of("Plugin-Version", "2"), "irrelevant_plugin")139 new PluginServer.RemotePlugin(null, Collections.singletonMap("Plugin-Version", "2"), "irrelevant_plugin") 140 140 ); 141 141 pluginServer.applyToWireMockServer(this.pluginServerRule); … … 143 143 144 144 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( 145 ImmutableMap.<String, Object>of(145 Collections.singletonMap( 146 146 "<html>The following plugin has been downloaded <strong>successfully</strong>:" 147 147 + "<ul><li>baz_plugin (6)</li></ul>" … … 268 268 269 269 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( 270 ImmutableMap.<String, Object>of(270 Collections.singletonMap( 271 271 "<html>You have to restart JOSM for some settings to take effect." 272 272 + "<br/><br/>Would you like to restart now?</html>", … … 581 581 new PluginServer.RemotePlugin(this.referenceDummyJarOld), 582 582 new PluginServer.RemotePlugin(this.referenceBazJarOld), 583 new PluginServer.RemotePlugin(null, ImmutableMap.of("Plugin-Version", "123"), "irrelevant_plugin")583 new PluginServer.RemotePlugin(null, Collections.singletonMap("Plugin-Version", "123"), "irrelevant_plugin") 584 584 ); 585 585 pluginServer.applyToWireMockServer(this.pluginServerRule); … … 587 587 588 588 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( 589 ImmutableMap.<String, Object>of(589 Collections.singletonMap( 590 590 "All installed plugins are up to date. JOSM does not have to download newer versions.", 591 591 "OK" … … 740 740 741 741 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(); 742 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( ImmutableMap.<String, Object>of(742 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(Collections.singletonMap( 743 743 "<html>The following plugin has been downloaded <strong>successfully</strong>:" 744 744 + "<ul><li>dummy_plugin (31772)</li></ul></html>", … … 845 845 final PluginServer pluginServer = new PluginServer( 846 846 new PluginServer.RemotePlugin(this.referenceDummyJarNew), 847 new PluginServer.RemotePlugin(this.referenceBazJarNew, ImmutableMap.of(847 new PluginServer.RemotePlugin(this.referenceBazJarNew, Collections.singletonMap( 848 848 "6800_Plugin-Url", "6;http://localhost:" + this.pluginServerRule.port() + bazOldServePath 849 849 )) … … 860 860 Config.getPref().putList("plugins", ImmutableList.of()); 861 861 862 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( ImmutableMap.of(862 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(Collections.singletonMap( 863 863 "<html>The following plugin has been downloaded <strong>successfully</strong>:" 864 864 + "<ul><li>baz_plugin (6)</li></ul>" -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
r14213 r16159 10 10 import java.io.IOException; 11 11 import java.nio.file.Files; 12 import java.util.Collections; 12 13 import java.util.List; 13 14 … … 254 255 final PluginServer pluginServer = new PluginServer( 255 256 new PluginServer.RemotePlugin(this.referenceDummyJarNew), 256 new PluginServer.RemotePlugin(this.referenceBazJarNew, ImmutableMap.of( 257 "Plugin-Mainversion", "5500" 258 )) 257 new PluginServer.RemotePlugin(this.referenceBazJarNew, Collections.singletonMap("Plugin-Mainversion", "5500")) 259 258 ); 260 259 pluginServer.applyToWireMockServer(this.pluginServerRule); … … 312 311 final PluginServer pluginServer = new PluginServer( 313 312 new PluginServer.RemotePlugin(this.referenceBazJarOld), 314 new PluginServer.RemotePlugin(this.referenceQuxJarNewer, ImmutableMap.of(313 new PluginServer.RemotePlugin(this.referenceQuxJarNewer, Collections.singletonMap( 315 314 "7499_Plugin-Url", "346;http://localhost:" + this.pluginServerRule.port() + "/dont/bother.jar" 316 315 )) … … 319 318 Config.getPref().putList("plugins", ImmutableList.of("qux_plugin", "baz_plugin")); 320 319 321 new ExtendedDialogMocker( ImmutableMap.of("JOSM version 7,500 required for plugin qux_plugin.", "Download Plugin"));320 new ExtendedDialogMocker(Collections.singletonMap("JOSM version 7,500 required for plugin qux_plugin.", "Download Plugin")); 322 321 323 322 Files.copy(this.referenceQuxJarOld.toPath(), this.targetQuxJar.toPath()); -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
r15737 r16159 9 9 import java.util.ArrayList; 10 10 import java.util.Arrays; 11 import java.util.Collections; 11 12 import java.util.List; 12 13 import java.util.stream.Collectors; … … 27 28 import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; 28 29 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 29 30 import com.google.common.collect.ImmutableMap;31 30 32 31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 104 103 TestUtils.assumeWorkingJMockit(); 105 104 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 106 ImmutableMap.<String, Object>of(105 Collections.singletonMap( 107 106 "<html>The following plugin is no longer necessary and has been deactivated:" + 108 107 "<ul><li>imagery (integrated into main program)</li></ul></html>", … … 129 128 TestUtils.assumeWorkingJMockit(); 130 129 final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( 131 ImmutableMap.<String, Object>of(130 Collections.singletonMap( 132 131 "<html>Loading of the plugin \"gpsbabelgui\" was requested.<br>" + 133 132 "This plugin is no longer developed and very likely will produce errors.<br>" +
Note:
See TracChangeset
for help on using the changeset viewer.