Changeset 14153 in josm for trunk/test/unit
- Timestamp:
- 2018-08-13T02:18:54+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java
r14092 r14153 659 659 /* PropertyChangeListener */ 660 660 /* ----------------------------------------------------------------------------- */ 661 @SuppressWarnings("unchecked")662 661 @Test 663 662 public void testAddPropertyChangeListener() throws ReflectiveOperationException { … … 675 674 } 676 675 677 @SuppressWarnings("unchecked")678 676 @Test 679 677 public void testRemovePropertyChangeListener() throws ReflectiveOperationException { … … 711 709 public ArrayList<PropertyChangeEvent> events = new ArrayList<>(); 712 710 711 @Override 713 712 public void propertyChange(PropertyChangeEvent evt) { 714 713 events.add(evt); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
r14149 r14153 9 9 10 10 import java.awt.Component; 11 import java.awt.Window;12 11 import java.io.File; 13 12 import java.nio.file.Files; … … 21 20 import org.junit.Rule; 22 21 import org.junit.Test; 23 import org.openstreetmap.josm.Main;24 22 import org.openstreetmap.josm.TestUtils; 25 23 import org.openstreetmap.josm.data.Preferences; … … 69 67 @Before 70 68 public void setUp() throws ReflectiveOperationException { 71 if (!java.awt.GraphicsEnvironment.isHeadless()) {72 originalMainParent = Main.parent;73 Main.parent = new Window(null);74 }75 69 76 70 // some other tests actually go ahead and load plugins (notably at time of writing, … … 120 114 pluginList.clear(); 121 115 pluginList.addAll(this.originalPluginList); 122 123 if (!java.awt.GraphicsEnvironment.isHeadless()) {124 Main.parent = originalMainParent;125 }126 116 } 127 117 128 118 private Collection<PluginProxy> originalPluginList; 129 130 private Component originalMainParent;131 119 132 120 private File pluginDir; -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
r14149 r14153 15 15 import org.junit.Rule; 16 16 import org.junit.Test; 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.TestUtils; 19 18 import org.openstreetmap.josm.data.Preferences; 19 import org.openstreetmap.josm.gui.MainApplication; 20 20 import org.openstreetmap.josm.spi.preferences.Config; 21 21 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 115 115 116 116 final List<PluginInformation> updatedPlugins = PluginHandler.updatePlugins( 117 Main .parent,117 MainApplication.getMainFrame(), 118 118 null, 119 119 null, … … 183 183 184 184 final List<PluginInformation> updatedPlugins = PluginHandler.updatePlugins( 185 Main .parent,185 MainApplication.getMainFrame(), 186 186 null, 187 187 null, … … 257 257 258 258 final List<PluginInformation> updatedPlugins = ImmutableList.copyOf(PluginHandler.updatePlugins( 259 Main .parent,259 MainApplication.getMainFrame(), 260 260 null, 261 261 null, -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
r14138 r14153 13 13 import org.junit.Rule; 14 14 import org.junit.Test; 15 import org.openstreetmap.josm.Main;16 15 import org.openstreetmap.josm.TestUtils; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferenceTest; 18 18 import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin; … … 73 73 public void testFilterDeprecatedPlugins() { 74 74 List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "imagery")); 75 PluginHandler.filterDeprecatedPlugins(Main .parent, plugins);75 PluginHandler.filterDeprecatedPlugins(MainApplication.getMainFrame(), plugins); 76 76 assertEquals(2, plugins.size()); 77 77 assertFalse(plugins.contains("imagery")); … … 84 84 public void testFilterUnmaintainedPlugins() { 85 85 List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "gpsbabelgui")); 86 PluginHandler.filterUnmaintainedPlugins(Main .parent, plugins);86 PluginHandler.filterUnmaintainedPlugins(MainApplication.getMainFrame(), plugins); 87 87 assertEquals(2, plugins.size()); 88 88 assertFalse(plugins.contains("gpsbabelgui")); -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r14149 r14153 22 22 import org.junit.runners.model.Statement; 23 23 import org.openstreetmap.josm.JOSMFixture; 24 import org.openstreetmap.josm.Main;25 24 import org.openstreetmap.josm.TestUtils; 26 25 import org.openstreetmap.josm.actions.DeleteAction; -
trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
r14052 r14153 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.testutils; 3 4 import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; 3 5 4 6 import java.io.File; … … 12 14 import java.util.stream.Collectors; 13 15 16 import org.junit.runner.Description; 17 import org.junit.runners.model.Statement; 14 18 import org.openstreetmap.josm.TestUtils; 15 19 import org.openstreetmap.josm.tools.Logging; 16 20 17 import org.junit.runner.Description; 18 import org.junit.runners.model.Statement; 19 20 import com.google.common.collect.ImmutableList; 21 21 import com.github.tomakehurst.wiremock.WireMockServer; 22 22 import com.github.tomakehurst.wiremock.client.MappingBuilder; 23 23 import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder; … … 25 25 import com.github.tomakehurst.wiremock.core.Options; 26 26 import com.github.tomakehurst.wiremock.junit.WireMockRule; 27 import com.github.tomakehurst.wiremock.WireMockServer; 28 29 import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; 27 import com.google.common.collect.ImmutableList; 30 28 31 29 public class PluginServer { … … 75 73 76 74 public String getRemotePluginsListManifestSection() { 77 final Map<String, String> attrs = new HashMap< String, String>();75 final Map<String, String> attrs = new HashMap<>(); 78 76 JarFile jarFile = null; 79 77 … … 239 237 return super.apply(new Statement() { 240 238 @Override 241 @SuppressWarnings("unchecked")242 239 public void evaluate() throws Throwable { 243 240 PluginServer.this.applyToWireMockServer(PluginServerRule.this);
Note:
See TracChangeset
for help on using the changeset viewer.