source: josm/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java@ 284

Last change on this file since 284 was 203, checked in by imi, 18 years ago
  • Fixed a bug in the Merger/Conflict to auto-resolve marked changes without real changes
  • Fixed bug in split way, that reversed the order of segments in one way.
  • Fixed bug where dialogs did not update anymore after loading a dataset twice
File size: 1.3 KB
Line 
1package org.openstreetmap.josm.data.osm;
2
3import org.openstreetmap.josm.data.coor.LatLon;
4import org.openstreetmap.josm.testframework.MotherObject;
5
6public class NodeTest extends MotherObject {
7
8 private Node node;
9
10 @Override protected void setUp() throws Exception {
11 super.setUp();
12 node = createNode();
13 }
14
15 public void testVisit() {
16 OsmPrimitiveTest.TestCalledVisitor v = new OsmPrimitiveTest.TestCalledVisitor();
17 node.visit(v);
18 assertEquals("Node", v.called);
19 }
20
21 public void testCloneFromRealEqual() {
22 Node node2 = createNode(23,3,4);
23 assertFalse(node2.realEqual(node, false));
24 assertFalse(node.realEqual(node2, false));
25 node.cloneFrom(node2);
26 assertTrue(node2.realEqual(node, false));
27 assertTrue(node.realEqual(node2, false));
28 }
29
30 public void testNodeNode() {
31 Node node2 = new Node(node);
32 assertTrue(node2.realEqual(node, false));
33 }
34
35 public void testNodeLatLon() {
36 LatLon latLon = new LatLon(1,2);
37 node = new Node(latLon);
38 assertEquals(node.coor, latLon);
39 }
40
41 public void testCompareToNodeTypeBiggestOrComparedAfterId() {
42 assertEquals(1, node.compareTo(createSegment()));
43 assertEquals(1, node.compareTo(createWay()));
44 Node node2 = createNode(23,1,2);
45 assertEquals(-1, node.compareTo(node2));
46 assertEquals(1, node2.compareTo(node));
47 }
48}
Note: See TracBrowser for help on using the repository browser.