Changeset 13616 in josm for trunk/test
- Timestamp:
- 2018-04-11T22:38:52+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/command/DeleteCommandTest.java
r13079 r13616 162 162 @Test(expected = IllegalArgumentException.class) 163 163 public void testConsistencyDataset() { 164 testData.layer. data.removePrimitive(testData.existingNode);164 testData.layer.getDataSet().removePrimitive(testData.existingNode); 165 165 new DeleteCommand(Arrays.asList(testData.existingNode, testData.existingWay)); 166 166 } -
trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java
r13079 r13616 63 63 // to check that algorithm ignores it: 64 64 Relation relationParent3 = testData.createRelation(102, new RelationMember("child", testData.existingRelation)); 65 PurgeCommand command = new PurgeCommand(testData.layer. data,65 PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(), 66 66 Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingNode2, testData.existingWay, 67 67 testData.existingRelation, relationParent, relationParent2), … … 84 84 @Test 85 85 public void testUndo() { 86 PurgeCommand command = new PurgeCommand(testData.layer. data,86 PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(), 87 87 Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingWay), 88 88 Arrays.<OsmPrimitive>asList(testData.existingWay)); … … 108 108 ArrayList<OsmPrimitive> deleted = new ArrayList<>(); 109 109 ArrayList<OsmPrimitive> added = new ArrayList<>(); 110 PurgeCommand command = new PurgeCommand(testData.layer. data, Arrays.<OsmPrimitive>asList(testData.existingNode),110 PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(), Arrays.<OsmPrimitive>asList(testData.existingNode), 111 111 Arrays.<OsmPrimitive>asList(testData.existingRelation)); 112 112 command.fillModifiedData(modified, deleted, added); … … 122 122 @Test 123 123 public void testGetParticipatingPrimitives() { 124 PurgeCommand command = new PurgeCommand(testData.layer. data, Arrays.<OsmPrimitive>asList(testData.existingNode),124 PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(), Arrays.<OsmPrimitive>asList(testData.existingNode), 125 125 Arrays.<OsmPrimitive>asList(testData.existingRelation)); 126 126 assertArrayEquals(new Object[] {testData.existingNode }, command.getParticipatingPrimitives().toArray()); … … 133 133 public void testDescription() { 134 134 List<OsmPrimitive> shortList = Arrays.<OsmPrimitive>asList(testData.existingWay); 135 assertTrue(new PurgeCommand(testData.layer. data, shortList, Arrays.<OsmPrimitive>asList()).getDescriptionText()135 assertTrue(new PurgeCommand(testData.layer.getDataSet(), shortList, Arrays.<OsmPrimitive>asList()).getDescriptionText() 136 136 .matches("Purged 1 object")); 137 137 List<OsmPrimitive> longList = Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingNode2, 138 138 testData.existingWay); 139 assertTrue(new PurgeCommand(testData.layer. data, longList, Arrays.<OsmPrimitive>asList()).getDescriptionText()139 assertTrue(new PurgeCommand(testData.layer.getDataSet(), longList, Arrays.<OsmPrimitive>asList()).getDescriptionText() 140 140 .matches("Purged 3 objects")); 141 141 } -
trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java
r13079 r13616 51 51 @Test 52 52 public void testExecute() { 53 SelectCommand command = new SelectCommand(testData.layer. data, Arrays.asList(testData.existingNode, testData.existingWay));53 SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode, testData.existingWay)); 54 54 55 testData.layer. data.setSelected(Arrays.asList(testData.existingNode2));55 testData.layer.getDataSet().setSelected(Arrays.asList(testData.existingNode2)); 56 56 57 57 command.executeCommand(); … … 68 68 public void testExecuteAfterModify() { 69 69 List<OsmPrimitive> list = new ArrayList<>(Arrays.asList(testData.existingNode, testData.existingWay)); 70 SelectCommand command = new SelectCommand(testData.layer. data, list);70 SelectCommand command = new SelectCommand(testData.layer.getDataSet(), list); 71 71 72 72 list.remove(testData.existingNode); … … 85 85 @Test 86 86 public void testUndo() { 87 SelectCommand command = new SelectCommand(testData.layer. data, Arrays.asList(testData.existingNode, testData.existingWay));88 testData.layer. data.setSelected(Arrays.asList(testData.existingNode2));87 SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode, testData.existingWay)); 88 testData.layer.getDataSet().setSelected(Arrays.asList(testData.existingNode2)); 89 89 90 90 command.executeCommand(); … … 111 111 ArrayList<OsmPrimitive> deleted = new ArrayList<>(); 112 112 ArrayList<OsmPrimitive> added = new ArrayList<>(); 113 SelectCommand command = new SelectCommand(testData.layer. data, Arrays.asList(testData.existingNode, testData.existingWay));113 SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode, testData.existingWay)); 114 114 command.fillModifiedData(modified, deleted, added); 115 115 // intentionally empty. … … 124 124 @Test 125 125 public void testGetParticipatingPrimitives() { 126 SelectCommand command = new SelectCommand(testData.layer. data, Arrays.asList(testData.existingNode));126 SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode)); 127 127 command.executeCommand(); 128 128 assertArrayEquals(new Object[] {testData.existingNode}, command.getParticipatingPrimitives().toArray()); … … 134 134 @Test 135 135 public void testDescription() { 136 DataSet ds = testData.layer. data;136 DataSet ds = testData.layer.getDataSet(); 137 137 assertTrue(new SelectCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode)) 138 138 .getDescriptionText().matches("Selected 1 object")); -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r13079 r13616 49 49 @Test 50 50 public void testExecuteUndoCommand() { 51 DataSet ds = testData.layer. data;51 DataSet ds = testData.layer.getDataSet(); 52 52 Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2); 53 53 ConflictAddCommand cmd = new ConflictAddCommand(ds, conflict); … … 66 66 public void testGetDescriptionIcon() { 67 67 Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2); 68 assertNotNull(new ConflictAddCommand(testData.layer. data, conflict).getDescriptionIcon());68 assertNotNull(new ConflictAddCommand(testData.layer.getDataSet(), conflict).getDescriptionIcon()); 69 69 } 70 70 -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java
r12636 r13616 77 77 78 78 // active layer, should change 79 testData1.layer. data.setSelected(testData1.existingNode.getPrimitiveId());79 testData1.layer.getDataSet().setSelected(testData1.existingNode.getPrimitiveId()); 80 80 assertSelectionEquals(listeners, new HashSet<OsmPrimitive>(Arrays.asList(testData1.existingNode))); 81 81 82 testData1.layer. data.clearSelection(testData1.existingNode.getPrimitiveId());82 testData1.layer.getDataSet().clearSelection(testData1.existingNode.getPrimitiveId()); 83 83 assertSelectionEquals(listeners, new HashSet<OsmPrimitive>(Arrays.asList())); 84 84 85 testData1.layer. data.addSelected(testData1.existingNode2.getPrimitiveId());85 testData1.layer.getDataSet().addSelected(testData1.existingNode2.getPrimitiveId()); 86 86 assertSelectionEquals(listeners, new HashSet<OsmPrimitive>(Arrays.asList(testData1.existingNode2))); 87 87 … … 91 91 92 92 // This should not trigger anything, since the layer is not active any more. 93 testData1.layer. data.clearSelection(testData1.existingNode.getPrimitiveId());93 testData1.layer.getDataSet().clearSelection(testData1.existingNode.getPrimitiveId()); 94 94 assertSelectionEquals(listeners, null); 95 95 96 testData2.layer. data.setSelected(testData2.existingNode.getPrimitiveId());96 testData2.layer.getDataSet().setSelected(testData2.existingNode.getPrimitiveId()); 97 97 assertSelectionEquals(listeners, new HashSet<OsmPrimitive>(Arrays.asList(testData2.existingNode))); 98 98 … … 104 104 105 105 // no event triggered now 106 testData2.layer. data.setSelected(testData2.existingNode2.getPrimitiveId());106 testData2.layer.getDataSet().setSelected(testData2.existingNode2.getPrimitiveId()); 107 107 assertSelectionEquals(listeners, null); 108 108 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r13489 r13616 26 26 import org.openstreetmap.josm.command.SequenceCommand; 27 27 import org.openstreetmap.josm.data.osm.DataSet; 28 import org.openstreetmap.josm.data.osm.IPrimitive; 28 29 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 30 import org.openstreetmap.josm.data.osm.OsmUtils; … … 233 234 List<TestError> errors = test.getErrors(); 234 235 assertEquals(errorsCount, errors.size()); 235 Set<Set< OsmPrimitive>> primitives = new HashSet<>();236 Set<Set<IPrimitive>> primitives = new HashSet<>(); 236 237 for (TestError e : errors) { 237 238 primitives.add(new HashSet<>(e.getPrimitives()));
Note:
See TracChangeset
for help on using the changeset viewer.