Changeset 12070 in josm for trunk/test/unit
- Timestamp:
- 2017-05-06T14:27:02+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r11943 r12070 21 21 import org.openstreetmap.josm.io.CertificateAmendment; 22 22 import org.openstreetmap.josm.io.OsmApi; 23 import org.openstreetmap.josm.testutils.JOSMTestRules; 23 24 import org.openstreetmap.josm.tools.I18n; 24 25 import org.openstreetmap.josm.tools.JosmRuntimeException; … … 140 141 141 142 private void setupGUI() { 142 Main.getLayerManager().resetState();143 JOSMTestRules.cleanLayerEnvironment(); 143 144 assertTrue(Main.getLayerManager().getLayers().isEmpty()); 144 145 assertNull(Main.getLayerManager().getEditLayer()); -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r11943 r12070 15 15 import org.openstreetmap.josm.JOSMFixture; 16 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 17 18 import org.openstreetmap.josm.data.projection.Projections; 18 19 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; … … 286 287 private void cleanUpFromJosmFixture() { 287 288 MemoryManagerTest.resetState(true); 288 Main.getLayerManager().resetState();289 cleanLayerEnvironment(); 289 290 Main.pref.resetToInitialState(); 290 291 Main.platform = null; 291 292 System.gc(); 293 } 294 295 /** 296 * Cleans the Layer manager and the SelectionEventManager. 297 * You don't need to call this during tests, the test environment will do it for you. 298 * @since 12070 299 */ 300 public static void cleanLayerEnvironment() { 301 // Get the instance before cleaning - this ensures that it is initialized. 302 SelectionEventManager eventManager = SelectionEventManager.getInstance(); 303 Main.getLayerManager().resetState(); 304 eventManager.resetState(); 292 305 } 293 306 … … 304 317 }); 305 318 // Remove all layers 306 Main.getLayerManager().resetState();319 cleanLayerEnvironment(); 307 320 MemoryManagerTest.resetState(allowMemoryManagerLeaks); 308 321
Note:
See TracChangeset
for help on using the changeset viewer.