Changeset 15362 in josm for trunk/test/unit/org
- Timestamp:
- 2019-09-19T16:01:03+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java
r14134 r15362 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNull;6 5 import static org.junit.Assert.assertTrue; 7 6 8 7 import java.util.ArrayList; 9 8 import java.util.Arrays; 9 import java.util.Collections; 10 10 import java.util.Iterator; 11 11 … … 38 38 39 39 /** 40 * Unit test of {@link SplitWayCommand#findVia }.40 * Unit test of {@link SplitWayCommand#findVias}. 41 41 */ 42 42 @Test 43 public void testFindVia () {43 public void testFindVias() { 44 44 // empty relation 45 assert Null(SplitWayCommand.findVia(new Relation(), null));45 assertTrue(SplitWayCommand.findVias(new Relation(), null).isEmpty()); 46 46 // restriction relation without via member 47 47 Relation r = new Relation(); 48 48 r.addMember(new RelationMember("", new Node())); 49 assert Null(SplitWayCommand.findVia(r, "restriction"));49 assertTrue(SplitWayCommand.findVias(r, "restriction").isEmpty()); 50 50 // restriction relation with via member 51 51 r = new Relation(); 52 52 OsmPrimitive via = new Node(); 53 53 r.addMember(new RelationMember("via", via)); 54 assertEquals( via, SplitWayCommand.findVia(r, "restriction"));54 assertEquals(Collections.singletonList(via), SplitWayCommand.findVias(r, "restriction")); 55 55 // destination_sign relation without sign nor intersection 56 56 r = new Relation(); 57 57 r.addMember(new RelationMember("", new Node())); 58 assert Null(SplitWayCommand.findVia(r, "destination_sign"));58 assertTrue(SplitWayCommand.findVias(r, "destination_sign").isEmpty()); 59 59 // destination_sign with sign 60 60 r = new Relation(); 61 61 via = new Node(); 62 62 r.addMember(new RelationMember("sign", via)); 63 assertEquals( via, SplitWayCommand.findVia(r, "destination_sign"));63 assertEquals(Collections.singletonList(via), SplitWayCommand.findVias(r, "destination_sign")); 64 64 // destination_sign with intersection 65 65 r = new Relation(); 66 66 via = new Node(); 67 67 r.addMember(new RelationMember("intersection", via)); 68 assertEquals( via, SplitWayCommand.findVia(r, "destination_sign"));68 assertEquals(Collections.singletonList(via), SplitWayCommand.findVias(r, "destination_sign")); 69 69 } 70 70
Note:
See TracChangeset
for help on using the changeset viewer.