- Timestamp:
- 2015-06-03T01:27:41+02:00 (10 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r8303 r8450 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.junit.Assert.assertSame; 4 5 import static org.junit.Assert.assertTrue; 5 6 … … 98 99 // Expected result: Dataset contain one closed way, clockwise 99 100 Collection<Way> resultingWays = dataSet.getWays(); 100 assertTrue(String.format("Expect one way after perform action. %d found", 101 resultingWays.size()), 102 resultingWays.size() == 1); 101 assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()), 102 resultingWays.size(), 1); 103 103 Way resultingWay = resultingWays.iterator().next(); 104 104 assertTrue("Resulting way is not closed", … … 174 174 // Expected result: Dataset contain one closed way, clockwise 175 175 Collection<Way> resultingWays = dataSet.getWays(); 176 assertTrue(String.format("Expect one way after perform action. %d found", 177 resultingWays.size()), 178 resultingWays.size() == 1); 176 assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()), 177 resultingWays.size(), 1); 179 178 Way resultingWay = resultingWays.iterator().next(); 180 179 assertTrue("Resulting way is not closed", -
trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
r8276 r8450 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.junit.Assert.assertSame; 4 5 import static org.junit.Assert.assertTrue; 5 6 … … 80 81 81 82 // Ensures 3 ways. 82 assertTrue(String.format("Found %d ways after split action instead of 3.", 83 dataSet.getWays().size()), 84 dataSet.getWays().size() == 3); 83 assertSame(String.format("Found %d ways after split action instead of 3.", dataSet.getWays().size()), 84 dataSet.getWays().size(), 3); 85 85 86 86 // Ensures way w1 is unchanged. 87 87 assertTrue("Unselected ways disappear during split action.", 88 88 dataSet.getWays().contains(w1)); 89 assert True("Unselected way seems to have change during split action.",90 w1.getNodesCount() ==3);89 assertSame("Unselected way seems to have change during split action.", 90 w1.getNodesCount(), 3); 91 91 for(int i = 0; i < 3; i++) { 92 assert True("Node change in unselected way during split action.",93 w1.getNode(i) ==w1NodesArray[i]);92 assertSame("Node change in unselected way during split action.", 93 w1.getNode(i), w1NodesArray[i]); 94 94 } 95 95 } -
trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
r8294 r8450 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.junit.Assert.assert True;4 import static org.junit.Assert.assertFalse; 5 5 6 6 import java.util.Arrays; … … 32 32 public void notify(String msg, int messageType) { 33 33 return; 34 } ;34 } 35 35 } 36 36 … … 82 82 83 83 // Ensures node n2 remove from w 84 assertTrue("Node n2 wasn't removed from way w.", 85 !w.containsNode(n2)); 84 assertFalse("Node n2 wasn't removed from way w.", w.containsNode(n2)); 86 85 } 87 86 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r8343 r8450 2 2 package org.openstreetmap.josm.actions.mapmode; 3 3 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertSame; 4 6 import static org.junit.Assert.assertTrue; 7 import static org.junit.Assert.fail; 5 8 6 9 import java.awt.Cursor; … … 43 46 this.currentDataSet = dataSet; 44 47 }; 48 @Override 45 49 public EastNorth getEastNorth(int x, int y) { 46 50 return new EastNorth(x, y); 47 51 } 52 @Override 48 53 public void addMouseListener(MouseListener ml) {} 54 @Override 49 55 public void removeMouseListener(MouseListener ml) {} 50 56 public void addMouseMotionListener(MouseListener ml) {} 51 57 public void removeMouseMotionListener(MouseListener ml) {} 52 58 public void mvRepaint() {} 59 @Override 53 60 public void setVirtualNodesEnabled(boolean enabled) {} 61 @Override 54 62 public void setNewCursor(Cursor cursor, Object reference) {} 63 @Override 55 64 public void setNewCursor(int cursor, Object reference) {} 65 @Override 56 66 public boolean isActiveLayerVisible() { 57 67 return true; … … 64 74 } 65 75 }; 76 @Override 66 77 public void requestClearRect() {} 78 @Override 67 79 public Point2D getPoint2D(EastNorth p) { 68 80 return new Point2D.Double(p.getX(), p.getY()); 69 81 } 82 @Override 70 83 public void setActiveLayer(Layer layer) {} 84 @Override 71 85 public Layer getActiveLayer() { 72 86 return layer; 73 87 } 88 @Override 74 89 protected DataSet getCurrentDataSet() { 75 90 return currentDataSet; … … 81 96 */ 82 97 class PreferencesMock extends Preferences { 98 @Override 83 99 public synchronized int getInteger(String key, int def) { 84 100 if (key == "edit.initial-move-delay") { … … 101 117 } catch (Exception e) { 102 118 e.printStackTrace(); 103 assertTrue("Can't setup testing environnement", false);119 fail("Can't setup testing environnement"); 104 120 } 105 121 } 122 @Override 106 123 public void mergeNodes(OsmDataLayer layer, Collection<Node> nodes, 107 124 Node targetLocationNode) { 108 assertTrue(String.format("Should merge two nodes, %d found", 109 nodes.size()), 110 nodes.size() == 2); 125 assertSame(String.format("Should merge two nodes, %d found", nodes.size()), 126 nodes.size(), 2); 111 127 nodesMerged = true; 112 128 } … … 182 198 // As result of test, we must find a 2 nodes way, from EN(0, 0) to EN(100, 0) 183 199 assertTrue("Nodes are not merged", nodesMerged); 184 assertTrue(String.format("Expect exactly one way, found %d\n", 185 dataSet.getWays().size()), 186 dataSet.getWays().size() == 1); 200 assertSame(String.format("Expect exactly one way, found %d\n", dataSet.getWays().size()), 201 dataSet.getWays().size(), 1); 187 202 Way rw = dataSet.getWays().iterator().next(); 188 assertTrue("Way shouldn't be deleted\n", 189 !rw.isDeleted()); 190 assertTrue(String.format("Way shouldn't have 2 nodes, %d found\n", 191 w.getNodesCount()), 192 rw.getNodesCount() == 2); 203 assertFalse("Way shouldn't be deleted\n", rw.isDeleted()); 204 assertSame(String.format("Way shouldn't have 2 nodes, %d found\n", w.getNodesCount()), 205 rw.getNodesCount(), 2); 193 206 Node r1 = rw.firstNode(); 194 207 Node r2 = rw.lastNode(); … … 198 211 r2 = tmp; 199 212 } 200 assertTrue(String.format("East should be 0, found %f\n", 201 r1.getEastNorth().east()), 202 Double.compare(r1.getEastNorth().east(), 0) == 0); 203 assertTrue(String.format("East should be 100, found %f\n", 204 r2.getEastNorth().east()), 205 Double.compare(r2.getEastNorth().east(), 100) == 0); 213 assertSame(String.format("East should be 0, found %f\n", r1.getEastNorth().east()), 214 Double.compare(r1.getEastNorth().east(), 0), 0); 215 assertSame(String.format("East should be 100, found %f\n", r2.getEastNorth().east()), 216 Double.compare(r2.getEastNorth().east(), 100), 0); 206 217 } 207 218 } -
trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java
r7937 r8450 1 1 package org.openstreetmap.josm.data; 2 3 import static org.junit.Assert.assertEquals; 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertTrue; 2 6 3 7 import org.junit.Test; 4 8 import org.openstreetmap.josm.data.coor.LatLon; 5 6 import static org.junit.Assert.assertTrue;7 9 8 10 public class BoundsTest { … … 12 14 Bounds b1 = new Bounds(0, 170, 50, -170); 13 15 assertTrue(b1.crosses180thMeridian()); 14 assert True(!b1.contains(new LatLon(-10, -180)));16 assertFalse(b1.contains(new LatLon(-10, -180))); 15 17 assertTrue(b1.contains(new LatLon(0, -180))); 16 18 assertTrue(b1.contains(new LatLon(50, -180))); 17 assert True(!b1.contains(new LatLon(60, -180)));18 assert True(!b1.contains(new LatLon(-10, 180)));19 assertFalse(b1.contains(new LatLon(60, -180))); 20 assertFalse(b1.contains(new LatLon(-10, 180))); 19 21 assertTrue(b1.contains(new LatLon(0, 180))); 20 22 assertTrue(b1.contains(new LatLon(50, 180))); 21 assert True(!b1.contains(new LatLon(60, 180)));23 assertFalse(b1.contains(new LatLon(60, 180))); 22 24 23 25 Bounds b2 = new Bounds(60, 170, 90, -170); 24 assert True(!b1.intersects(b2));25 assert True(!b2.intersects(b1));26 assertFalse(b1.intersects(b2)); 27 assertFalse(b2.intersects(b1)); 26 28 27 29 Bounds b3 = new Bounds(25, 170, 90, -170); … … 30 32 assertTrue(b2.intersects(b3)); 31 33 assertTrue(b3.intersects(b2)); 32 34 33 35 b3.extend(b1); 34 assert True(b3.equals(new Bounds(0, 170, 90, -170)));36 assertEquals(b3, new Bounds(0, 170, 90, -170)); 35 37 assertTrue(b1.intersects(b3)); 36 38 assertTrue(b3.intersects(b1)); 37 39 assertTrue(b2.intersects(b3)); 38 40 assertTrue(b3.intersects(b2)); 39 41 40 42 b3.extend(new LatLon(0, 0)); 41 assert True(b3.equals(new Bounds(0, 0, 90, -170)));43 assertEquals(b3, new Bounds(0, 0, 90, -170)); 42 44 } 43 45 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/APIDataSetTest.java
r7937 r8450 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertTrue; 5 6 import static org.junit.Assert.fail; 6 7 … … 139 140 140 141 assertEquals(3, toAdd.size()); 141 assert Equals(true,toAdd.indexOf(r2) < toAdd.indexOf(r1));142 assert Equals(true,toAdd.indexOf(r3) < toAdd.indexOf(r1));142 assertTrue(toAdd.indexOf(r2) < toAdd.indexOf(r1)); 143 assertTrue(toAdd.indexOf(r3) < toAdd.indexOf(r1)); 143 144 } 144 145 … … 186 187 187 188 assertEquals(4, toDelete.size()); 188 assert Equals(true,toDelete.indexOf(r2) < toDelete.indexOf(r1));189 assert Equals(true,toDelete.indexOf(r3) < toDelete.indexOf(r1));189 assertTrue(toDelete.indexOf(r2) < toDelete.indexOf(r1)); 190 assertTrue(toDelete.indexOf(r3) < toDelete.indexOf(r1)); 190 191 } 191 192 … … 226 227 227 228 assertEquals(4, toDelete.size()); 228 assert Equals(true,toDelete.indexOf(way) < toDelete.indexOf(n1));229 assert Equals(true,toDelete.indexOf(way) < toDelete.indexOf(n2));230 assert Equals(true,toDelete.indexOf(r1) < toDelete.indexOf(way));229 assertTrue(toDelete.indexOf(way) < toDelete.indexOf(n1)); 230 assertTrue(toDelete.indexOf(way) < toDelete.indexOf(n2)); 231 assertTrue(toDelete.indexOf(r1) < toDelete.indexOf(way)); 231 232 } 232 233 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r7937 r8450 5 5 import static org.junit.Assert.assertFalse; 6 6 import static org.junit.Assert.assertNotNull; 7 import static org.junit.Assert.assertNotSame; 8 import static org.junit.Assert.assertSame; 7 9 import static org.junit.Assert.assertTrue; 8 10 … … 91 93 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 92 94 assertTrue(visitor.getConflicts().isEmpty()); 93 assert True(n1 !=n2); // make sure we have a clone95 assertNotSame(n1, n2); // make sure we have a clone 94 96 assertEquals(1, n2.getId()); 95 97 assertEquals(1, n2.getVersion()); 96 assert Equals(false,n2.isModified());98 assertFalse(n2.isModified()); 97 99 assertEquals("value1", n2.get("key1")); 98 100 99 101 // merge target not modified after merging 100 assert True(!n2.isModified());102 assertFalse(n2.isModified()); 101 103 } 102 104 … … 127 129 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 128 130 assertTrue(visitor.getConflicts().isEmpty()); 129 assert True(n ==n2); // make sure the merged node is still the original node130 assert True(n2.getDataSet() ==my);131 assertSame(n, n2); // make sure the merged node is still the original node 132 assertSame(n2.getDataSet(), my); 131 133 assertEquals(1, n2.getId()); 132 134 assertEquals(2, n2.getVersion()); 133 assert Equals(false,n2.isModified());135 assertFalse(n2.isModified()); 134 136 assertEquals("value1-new", n2.get("key1")); 135 137 assertEquals("value2", n2.get("key2")); 136 138 137 139 // the merge target should not be modified 138 assert True(!n2.isModified());140 assertFalse(n2.isModified()); 139 141 } 140 142 … … 168 170 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 169 171 assertEquals(1,visitor.getConflicts().size()); 170 assert True(n ==n2);171 assert True(n1 !=n2);172 assert True(n1.getDataSet() ==their);172 assertSame(n, n2); 173 assertNotSame(n1, n2); 174 assertSame(n1.getDataSet(), their); 173 175 } 174 176 … … 201 203 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 202 204 assertEquals(1,visitor.getConflicts().size()); 203 assert True(n ==n2);204 assert True(n1 !=n2);205 assert True(n1.getDataSet() ==their);205 assertSame(n, n2); 206 assertNotSame(n1, n2); 207 assertSame(n1.getDataSet(), their); 206 208 } 207 209 … … 228 230 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 229 231 assertEquals(0,visitor.getConflicts().size()); 230 assert Equals(true,n2.isVisible());231 assert True(n ==n2);232 assert True(n.getDataSet() ==my);233 assert True(n1.getDataSet() ==their);232 assertTrue(n2.isVisible()); 233 assertSame(n, n2); 234 assertSame(n.getDataSet(), my); 235 assertSame(n1.getDataSet(), their); 234 236 } 235 237 … … 253 255 254 256 assertEquals(0, visitor.getConflicts().size()); 255 assert True(n.getDataSet() ==my);256 assert True(n1.getDataSet() ==their);257 assertSame(n.getDataSet(), my); 258 assertSame(n1.getDataSet(), their); 257 259 } 258 260 … … 279 281 assertEquals(0,visitor.getConflicts().size()); 280 282 Node n2 = (Node)my.getNodes().toArray()[0]; 281 assert True(n2 ==n);283 assertSame(n2, n); 282 284 assertTrue(n2.isDeleted()); 283 285 } … … 322 324 assertEquals(0,visitor.getConflicts().size()); 323 325 assertEquals("value1",n2.get("key1")); 324 assert Equals(true,n1.getTimestamp().equals(n2.getTimestamp()));326 assertTrue(n1.getTimestamp().equals(n2.getTimestamp())); 325 327 assertEquals(theirUser,n2.getUser()); 326 assert True(n2 ==n);327 assert True(n2 !=n1);328 assert True(n2.getDataSet() ==my);328 assertSame(n2, n); 329 assertNotSame(n2, n1); 330 assertSame(n2.getDataSet(), my); 329 331 } 330 332 … … 356 358 assertEquals(0,visitor.getConflicts().size()); 357 359 assertEquals("value1",n2.get("key1")); 358 assert Equals(true,n1.getTimestamp().equals(n2.getTimestamp()));359 assert Equals(false,n2.isIncomplete());360 assert True(n2 ==n);360 assertTrue(n1.getTimestamp().equals(n2.getTimestamp())); 361 assertFalse(n2.isIncomplete()); 362 assertSame(n2, n); 361 363 } 362 364 … … 423 425 assertEquals(1,merged.getNode(0).getId()); 424 426 assertEquals(2,merged.getNode(1).getId()); 425 assert True(merged ==myWay);426 assert True(merged.getDataSet() ==my);427 assertSame(merged, myWay); 428 assertSame(merged.getDataSet(), my); 427 429 428 430 Node mergedNode = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 429 assert True(mergedNode ==n1);431 assertSame(mergedNode, n1); 430 432 mergedNode = (Node)my.getPrimitiveById(2, OsmPrimitiveType.NODE); 431 assert True(mergedNode ==n2);432 433 assert True(!merged.isModified());433 assertSame(mergedNode, n2); 434 435 assertFalse(merged.isModified()); 434 436 } 435 437 … … 498 500 assertEquals("value1",merged.getNode(2).get("key1")); 499 501 500 assertTrue(merged.getNode(0) == n1); 501 assertTrue(merged.getNode(1) != n5); // must be clone of the original node in their 502 assertTrue(merged.getNode(2) == n2); 503 504 assertTrue(!merged.isModified()); // the target wasn't modified before merging, it 505 // mustn't be after merging 502 assertSame(merged.getNode(0), n1); 503 assertNotSame(merged.getNode(1), n5); // must be clone of the original node in their 504 assertSame(merged.getNode(2), n2); 505 506 assertFalse(merged.isModified()); // the target wasn't modified before merging, it mustn't be after merging 506 507 } 507 508 … … 613 614 Way merged = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 614 615 assertEquals(1,visitor.getConflicts().size()); 615 assert Equals(true,visitor.getConflicts().hasConflictForMy(myWay));616 assert Equals(true,visitor.getConflicts().hasConflictForTheir(theirWay));616 assertTrue(visitor.getConflicts().hasConflictForMy(myWay)); 617 assertTrue(visitor.getConflicts().hasConflictForTheir(theirWay)); 617 618 assertEquals(myWay,merged); 618 619 } … … 669 670 assertEquals(1111, merged.getUser().getId()); 670 671 assertEquals(theirWay.getTimestamp(), merged.getTimestamp()); 671 assert True(merged ==myWay);672 assert True(merged.getNode(0) ==n1);673 assert True(merged.getNode(1) ==n2);674 675 assert True(!merged.isModified());672 assertSame(merged, myWay); 673 assertSame(merged.getNode(0), n1); 674 assertSame(merged.getNode(1), n2); 675 676 assertFalse(merged.isModified()); 676 677 } 677 678 … … 723 724 assertEquals(1111, merged.getUser().getId()); 724 725 assertEquals(theirWay.getTimestamp(), merged.getTimestamp()); 725 assert True(merged ==myWay);726 assert True(merged.getNode(0) ==n1);727 assert True(merged.getNode(1) ==n2);728 729 assert True(!merged.isModified());726 assertSame(merged, myWay); 727 assertSame(merged.getNode(0), n1); 728 assertSame(merged.getNode(1), n2); 729 730 assertFalse(merged.isModified()); 730 731 } 731 732 … … 830 831 831 832 Node n = (Node)my.getPrimitiveById(1,OsmPrimitiveType.NODE); 832 assert True(n != null);833 assertNotNull(n); 833 834 834 835 assertEquals(1, visitor.getConflicts().size()); … … 926 927 OsmPrimitive p= my.getPrimitiveById(1, OsmPrimitiveType.NODE); 927 928 assertNotNull(p); 928 assert True(!p.isIncomplete());929 assertFalse(p.isIncomplete()); 929 930 p= my.getPrimitiveById(2, OsmPrimitiveType.NODE); 930 931 assertNotNull(p); 931 assert True(!p.isIncomplete());932 assertFalse(p.isIncomplete()); 932 933 p= my.getPrimitiveById(3,OsmPrimitiveType.WAY); 933 934 assertNotNull(p); 934 assert True(!p.isIncomplete());935 assertFalse(p.isIncomplete()); 935 936 936 937 Way w = (Way)my.getPrimitiveById(3,OsmPrimitiveType.WAY); 937 938 assertNotNull(w); 938 assert True(!p.isIncomplete());939 assertFalse(p.isIncomplete()); 939 940 assertEquals(2, w.getNodesCount()); 940 assert True(!w.getNode(0).isIncomplete());941 assert True(!w.getNode(1).isIncomplete());941 assertFalse(w.getNode(0).isIncomplete()); 942 assertFalse(w.getNode(1).isIncomplete()); 942 943 } 943 944 -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r7081 r8450 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.junit.Assert.assertFalse; 4 5 import static org.junit.Assert.assertTrue; 5 6 … … 58 59 59 60 assertTrue(n2.isDisabledAndHidden()); 60 assert True(!n1.isDisabled());61 assertFalse(n1.isDisabled()); 61 62 } 62 63 -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java
r7937 r8450 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertNull; 6 import static org.junit.Assert.assertSame; 4 7 import static org.junit.Assert.assertTrue; 5 8 … … 27 30 public void emptyNode() { 28 31 Node n = new Node(); 29 assert True(n.getKeys().size() ==0);30 assert True(!n.hasKeys());31 assert True(!n.hasKey("nosuchkey"));32 assertSame(n.getKeys().size(), 0); 33 assertFalse(n.hasKeys()); 34 assertFalse(n.hasKey("nosuchkey")); 32 35 assertTrue(n.keySet().isEmpty()); 33 36 … … 43 46 n.put("akey", "avalue"); 44 47 assertTrue(n.get("akey").equals("avalue")); 45 assert True(n.getKeys().size() ==1);48 assertSame(n.getKeys().size(), 1); 46 49 47 assert True(n.keySet().size() ==1);50 assertSame(n.keySet().size(), 1); 48 51 assertTrue(n.keySet().contains("akey")); 49 52 } … … 59 62 assertTrue(n.get("key.1").equals("value.1")); 60 63 assertTrue(n.get("key.2").equals("value.2")); 61 assert True(n.getKeys().size() ==2);64 assertSame(n.getKeys().size(), 2); 62 65 assertTrue(n.hasKeys()); 63 66 assertTrue(n.hasKey("key.1")); 64 67 assertTrue(n.hasKey("key.2")); 65 assert True(!n.hasKey("nosuchkey"));68 assertFalse(n.hasKey("nosuchkey")); 66 69 } 67 70 … … 75 78 n.put("key.2", "value.2"); 76 79 77 n.remove("nosuchkey"); 78 assert True(n.getKeys().size() ==2); // still 2 tags ?80 n.remove("nosuchkey"); // should work 81 assertSame(n.getKeys().size(), 2); // still 2 tags ? 79 82 80 83 n.remove("key.1"); 81 assert True(n.getKeys().size() ==1);82 assert True(!n.hasKey("key.1"));83 assert True(n.get("key.1") == null);84 assertSame(n.getKeys().size(), 1); 85 assertFalse(n.hasKey("key.1")); 86 assertNull(n.get("key.1")); 84 87 assertTrue(n.hasKey("key.2")); 85 88 assertTrue(n.get("key.2").equals("value.2")); 86 89 87 90 n.remove("key.2"); 88 assert True(n.getKeys().size() ==0);89 assert True(!n.hasKey("key.1"));90 assert True(n.get("key.1") == null);91 assert True(!n.hasKey("key.2"));92 assert True(n.get("key.2") == null);91 assertSame(n.getKeys().size(), 0); 92 assertFalse(n.hasKey("key.1")); 93 assertNull(n.get("key.1")); 94 assertFalse(n.hasKey("key.2")); 95 assertNull(n.get("key.2")); 93 96 } 94 97 … … 104 107 105 108 n.removeAll(); 106 assert True(n.getKeys().size() ==0);109 assertSame(n.getKeys().size(), 0); 107 110 } 108 111 … … 141 144 n2.put("key.2", "value.4"); 142 145 143 assert True(!n1.hasEqualSemanticAttributes(n2));146 assertFalse(n1.hasEqualSemanticAttributes(n2)); 144 147 } 145 148 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java
r7937 r8450 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertTrue; 5 6 6 7 import java.util.Date; … … 28 29 assertEquals(1, node.getId()); 29 30 assertEquals(2, node.getVersion()); 30 assert Equals(true,node.isVisible());31 assertTrue(node.isVisible()); 31 32 assertEquals("testuser", node.getUser().getName()); 32 33 assertEquals(3, node.getUser().getId()); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r7937 r8450 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertTrue; 5 6 import static org.junit.Assert.fail; 6 7 … … 28 29 assertEquals(1, way.getId()); 29 30 assertEquals(2, way.getVersion()); 30 assert Equals(true,way.isVisible());31 assertTrue(way.isVisible()); 31 32 assertEquals("testuser", way.getUser().getName()); 32 33 assertEquals(3, way.getUser().getId()); -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r7151 r8450 2 2 package org.openstreetmap.josm.data.projection; 3 3 4 import static org.junit.Assert.assertSame; 4 5 import static org.junit.Assert.assertTrue; 5 6 … … 60 61 } 61 62 } 62 assert True(errs.toString(), errs.length() ==0);63 assertSame(errs.toString(), errs.length(), 0); 63 64 } 64 65 -
trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java
r7937 r8450 3 3 4 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertSame; 5 6 import static org.junit.Assert.assertThat; 6 import static org.junit.Assert.assertTrue;7 7 8 8 import java.io.FileInputStream; … … 67 67 System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); // route(lcn Sal Salier-Radweg(412 members) 68 68 69 assert True(comparator.compare(p1, p2) ==-1); // p1 < p270 assert True(comparator.compare(p2, p1) ==1); // p2 > p169 assertSame(comparator.compare(p1, p2), -1); // p1 < p2 70 assertSame(comparator.compare(p2, p1), 1); // p2 > p1 71 71 72 assert True(comparator.compare(p1, p3) ==-1); // p1 < p373 assert True(comparator.compare(p3, p1) ==1); // p3 > p174 assert True(comparator.compare(p2, p3) ==1); // p2 > p375 assert True(comparator.compare(p3, p2) ==-1); // p3 < p272 assertSame(comparator.compare(p1, p3), -1); // p1 < p3 73 assertSame(comparator.compare(p3, p1), 1); // p3 > p1 74 assertSame(comparator.compare(p2, p3), 1); // p2 > p3 75 assertSame(comparator.compare(p3, p2), -1); // p3 < p2 76 76 77 77 Relation[] relations = new ArrayList<>(ds.getRelations()).toArray(new Relation[0]); -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r8391 r8450 5 5 import static org.fest.reflect.core.Reflection.method; 6 6 import static org.junit.Assert.assertEquals; 7 import static org.junit.Assert.assertFalse; 7 8 import static org.junit.Assert.assertTrue; 8 9 import static org.junit.Assert.fail; … … 697 698 698 699 model.setFrozen(false); 699 assert True(!model.isFrozen());700 assertFalse(model.isFrozen()); 700 701 } 701 702 -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/PresetClassificationsTest.java
r7937 r8450 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 4 import static org.junit.Assert.assertFalse; 4 5 import static org.junit.Assert.assertTrue; 5 6 … … 54 55 w.addNode(new Node()); 55 56 w.addNode(new Node()); 56 assert True("unclosed way should not match building preset", !getMatchingPresetNames("building", w).contains("Building"));57 assertFalse("unclosed way should not match building preset", getMatchingPresetNames("building", w).contains("Building")); 57 58 w.addNode(n1); 58 59 assertTrue("closed way should match building preset", getMatchingPresetNames("building", w).contains("Building")); … … 64 65 assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram).contains("Railway Route")); 65 66 assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram).contains("Public Transport Route")); 66 assert True("railway=tram should not match 'Bus route'", !getMatchingPresetNames("route", tram).contains("Bus route"));67 assertFalse("railway=tram should not match 'Bus route'", getMatchingPresetNames("route", tram).contains("Bus route")); 67 68 } 68 69 } -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r7937 r8450 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNotNull; 6 import static org.junit.Assert.assertSame; 5 7 import static org.junit.Assert.assertTrue; 6 8 … … 64 66 for (String file : new String[]{"osm.jos", "osm.joz"}) { 65 67 List<Layer> layers = testRead(file); 66 assert True(layers.size() ==1);68 assertSame(layers.size(), 1); 67 69 assertTrue(layers.get(0) instanceof OsmDataLayer); 68 70 OsmDataLayer osm = (OsmDataLayer) layers.get(0); … … 80 82 for (String file : new String[]{"gpx.jos", "gpx.joz", "nmea.jos"}) { 81 83 List<Layer> layers = testRead(file); 82 assert True(layers.size() ==1);84 assertSame(layers.size(), 1); 83 85 assertTrue(layers.get(0) instanceof GpxLayer); 84 86 GpxLayer gpx = (GpxLayer) layers.get(0); … … 95 97 public void testReadGpxAndMarker() throws IOException, IllegalDataException { 96 98 List<Layer> layers = testRead("gpx_markers.joz"); 97 assert True(layers.size() ==2);99 assertSame(layers.size(), 2); 98 100 GpxLayer gpx = null; 99 101 MarkerLayer marker = null; … … 105 107 } 106 108 } 107 assert True(gpx != null);108 assert True(marker != null);109 assertNotNull(gpx); 110 assertNotNull(marker); 109 111 assertEquals(gpx.getName(), "GPX layer name"); 110 112 assertEquals(marker.getName(), "Marker layer name");
Note:
See TracChangeset
for help on using the changeset viewer.