Changeset 12726 in josm for trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
- Timestamp:
- 2017-09-04T23:45:49+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r12672 r12726 6 6 import static org.junit.Assert.assertTrue; 7 7 8 import org.junit.After;9 8 import org.junit.Before; 10 9 import org.junit.Rule; 11 10 import org.junit.Test; 11 import org.openstreetmap.josm.command.CommandTest.CommandTestData; 12 12 import org.openstreetmap.josm.data.conflict.Conflict; 13 13 import org.openstreetmap.josm.data.osm.DataSet; … … 15 15 import org.openstreetmap.josm.data.osm.User; 16 16 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.MainApplication;18 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 18 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 28 27 public class ConflictAddCommandTest { 29 28 30 private OsmDataLayer layer;31 32 29 /** 33 30 * Setup test. … … 36 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 34 public JOSMTestRules test = new JOSMTestRules().platform(); 35 private CommandTestData testData; 38 36 39 37 /** … … 42 40 @Before 43 41 public void setUp() { 44 layer = new OsmDataLayer(new DataSet(), null, null); 45 MainApplication.getLayerManager().addLayer(layer); 46 } 47 48 /** 49 * Cleanup test resources. 50 */ 51 @After 52 public void tearDown() { 53 MainApplication.getLayerManager().removeLayer(layer); 42 testData = new CommandTestData(); 54 43 } 55 44 … … 59 48 @Test 60 49 public void testExecuteUndoCommand() { 61 DataSet ds = MainApplication.getLayerManager().getEditDataSet();62 Conflict<Node> conflict = new Conflict<>( new Node(), new Node());50 DataSet ds = testData.layer.data; 51 Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2); 63 52 ConflictAddCommand cmd = new ConflictAddCommand(ds, conflict); 64 53 assertTrue(cmd.executeCommand()); … … 75 64 @Test 76 65 public void testGetDescriptionIcon() { 77 OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer(); 78 Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); 79 assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon()); 66 Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2); 67 assertNotNull(new ConflictAddCommand(testData.layer.data, conflict).getDescriptionIcon()); 80 68 } 81 69
Note:
See TracChangeset
for help on using the changeset viewer.