Changeset 14349 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14182 r14349 11 11 import java.awt.Composite; 12 12 import java.awt.Graphics2D; 13 import java.awt.GraphicsEnvironment;14 13 import java.awt.GridBagLayout; 15 14 import java.awt.Rectangle; … … 1103 1102 public boolean checkSaveConditions() { 1104 1103 if (isDataSetEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(() -> { 1105 if (GraphicsEnvironment.isHeadless()) {1106 return 2;1107 }1108 1104 return new ExtendedDialog( 1109 1105 MainApplication.getMainFrame(), -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r14138 r14349 35 35 import org.openstreetmap.josm.io.OsmReader; 36 36 import org.openstreetmap.josm.testutils.JOSMTestRules; 37 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker; 37 38 import org.openstreetmap.josm.tools.date.DateUtils; 39 40 import com.google.common.collect.ImmutableMap; 38 41 39 42 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 280 283 @Test 281 284 public void testCheckSaveConditions() { 285 TestUtils.assumeWorkingJMockit(); 286 final ExtendedDialogMocker edMocker = new ExtendedDialogMocker( 287 ImmutableMap.<String, Object>of("The document contains no data.", "Cancel") 288 ); 289 282 290 assertFalse(layer.checkSaveConditions()); 283 291 fillDataSet(ds); 284 292 assertTrue(layer.checkSaveConditions()); 285 } 286 293 294 assertEquals(1, edMocker.getInvocationLog().size()); 295 Object[] invocationLogEntry = edMocker.getInvocationLog().get(0); 296 assertEquals(2, (int) invocationLogEntry[0]); 297 assertEquals("Empty document", invocationLogEntry[2]); 298 } 299 300 /** 301 * Checks that unnamed layer number increases 302 */ 287 303 @Test 288 304 public void testLayerNameIncreases() throws Exception { … … 293 309 } 294 310 311 /** 312 * Checks that named layer got no number 313 */ 295 314 @Test 296 315 public void testLayerUnnumberedName() { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
r14337 r14349 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.TestUtils; 11 12 import org.openstreetmap.josm.gui.ExtendedDialog; 12 13 import org.openstreetmap.josm.gui.layer.GpxLayerTest; … … 34 35 @Test 35 36 public void testAction() throws Exception { 37 TestUtils.assumeWorkingJMockit(); 36 38 final ExtendedDialogMocker edMocker = new ExtendedDialogMocker() { 39 @Override 37 40 protected String getString(final ExtendedDialog instance) { 38 41 return ((JLabel) ((JPanel) this.getContent(instance)).getComponent(2)).getText();
Note:
See TracChangeset
for help on using the changeset viewer.
