Changeset 9671 in josm for trunk/test
- Timestamp:
- 2016-01-29T19:36:59+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
r9669 r9671 43 43 try (InputStream is = TestUtils.getRegressionDataStream(12038, "data.osm")) { 44 44 DataSet ds = OsmReader.parseDataSet(is, null); 45 Main.map.mapView.addLayer(new OsmDataLayer(ds, null, null)); 46 for (Way w : ds.getWays()) { 47 if (w.getId() == 222191929L) { 48 ds.addSelected(w); 45 OsmDataLayer layer = new OsmDataLayer(ds, null, null); 46 Main.main.addLayer(layer); 47 try { 48 for (Way w : ds.getWays()) { 49 if (w.getId() == 222191929L) { 50 ds.addSelected(w); 51 } 49 52 } 50 }51 new PurgeAction().actionPerformed(null);52 for (Way w : ds.getWays()) {53 if (w.getId() == 222191929L) {54 assertTrue(w.isIncomplete());55 assertEquals(0, w.getNodesCount());53 new PurgeAction().actionPerformed(null); 54 for (Way w : ds.getWays()) { 55 if (w.getId() == 222191929L) { 56 assertTrue(w.isIncomplete()); 57 assertEquals(0, w.getNodesCount()); 58 } 56 59 } 60 } finally { 61 // Ensure we clean the place before leaving, even if test fails. 62 Main.main.removeLayer(layer); 57 63 } 58 64 } -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r9666 r9671 5 5 import static org.junit.Assert.assertNotNull; 6 6 import static org.junit.Assert.assertTrue; 7 import nl.jqno.equalsverifier.EqualsVerifier;8 import nl.jqno.equalsverifier.Warning;9 7 8 import org.junit.AfterClass; 10 9 import org.junit.BeforeClass; 11 10 import org.junit.Test; … … 18 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 18 19 import nl.jqno.equalsverifier.EqualsVerifier; 20 import nl.jqno.equalsverifier.Warning; 21 20 22 /** 21 23 * Unit tests of {@link ConflictAddCommand} class. 22 24 */ 23 25 public class ConflictAddCommandTest { 26 27 private static OsmDataLayer layer; 24 28 25 29 /** … … 29 33 public static void setUpBeforeClass() { 30 34 JOSMFixture.createUnitTestFixture().init(true); 31 Main.map.mapView.addLayer(new OsmDataLayer(new DataSet(), null, null)); 35 layer = new OsmDataLayer(new DataSet(), null, null); 36 Main.main.addLayer(layer); 37 } 38 39 /** 40 * Cleanup test resources. 41 */ 42 @AfterClass 43 public static void tearDownAfterClass() { 44 Main.main.removeLayer(layer); 32 45 } 33 46 -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r9666 r9671 5 5 import static org.junit.Assert.assertNotNull; 6 6 import static org.junit.Assert.assertTrue; 7 import nl.jqno.equalsverifier.EqualsVerifier;8 import nl.jqno.equalsverifier.Warning;9 7 8 import org.junit.AfterClass; 10 9 import org.junit.BeforeClass; 11 10 import org.junit.Test; … … 20 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 20 21 import nl.jqno.equalsverifier.EqualsVerifier; 22 import nl.jqno.equalsverifier.Warning; 23 22 24 /** 23 25 * Unit tests of {@link CoordinateConflictResolveCommand} class. 24 26 */ 25 27 public class CoordinateConflictResolveCommandTest { 28 29 private static OsmDataLayer layer; 26 30 27 31 /** … … 31 35 public static void setUpBeforeClass() { 32 36 JOSMFixture.createUnitTestFixture().init(true); 33 Main.map.mapView.addLayer(new OsmDataLayer(new DataSet(), null, null)); 37 layer = new OsmDataLayer(new DataSet(), null, null); 38 Main.main.addLayer(layer); 39 } 40 41 /** 42 * Cleanup test resources. 43 */ 44 @AfterClass 45 public static void tearDownAfterClass() { 46 Main.main.removeLayer(layer); 34 47 } 35 48
Note:
See TracChangeset
for help on using the changeset viewer.