Changeset 9968 in josm for trunk/test/unit
- Timestamp:
- 2016-03-12T19:18:29+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/actions
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
r9661 r9968 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNull; 5 6 import static org.junit.Assert.assertSame; 6 7 import static org.junit.Assert.assertTrue; … … 102 103 } 103 104 105 /** 106 * Unit test of {@link SplitWayAction#findVia}. 107 */ 108 @Test 109 public void testFindVia() { 110 // empty relation 111 assertNull(SplitWayAction.findVia(new Relation(), null)); 112 // restriction relation without via member 113 Relation r = new Relation(); 114 r.addMember(new RelationMember("", new Node())); 115 assertNull(SplitWayAction.findVia(r, "restriction")); 116 // restriction relation with via member 117 r = new Relation(); 118 OsmPrimitive via = new Node(); 119 r.addMember(new RelationMember("via", via)); 120 assertEquals(via, SplitWayAction.findVia(r, "restriction")); 121 // destination_sign relation without sign nor intersection 122 r = new Relation(); 123 r.addMember(new RelationMember("", new Node())); 124 assertNull(SplitWayAction.findVia(r, "destination_sign")); 125 // destination_sign with sign 126 r = new Relation(); 127 via = new Node(); 128 r.addMember(new RelationMember("sign", via)); 129 assertEquals(via, SplitWayAction.findVia(r, "destination_sign")); 130 // destination_sign with intersection 131 r = new Relation(); 132 via = new Node(); 133 r.addMember(new RelationMember("intersection", via)); 134 assertEquals(via, SplitWayAction.findVia(r, "destination_sign")); 135 } 136 137 /** 138 * Unit tests of route relations. 139 */ 104 140 @Test 105 141 public void testRouteRelation() { … … 143 179 dataSet.setSelected(Arrays.asList(w2, n3, n4, n5)); 144 180 145 146 181 final SplitWayAction.Strategy strategy = new SplitWayAction.Strategy() { 147 182 … … 174 209 assertFirstLastNodeIs(((Way) route.getMemberPrimitivesList().get(5)), n6); 175 210 assertFirstLastNodeIs(((Way) route.getMemberPrimitivesList().get(5)), n7); 176 177 211 } 178 212
Note:
See TracChangeset
for help on using the changeset viewer.