Changeset 9933 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2016-03-05T18:33:11+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r9907 r9933 36 36 import java.util.Map; 37 37 38 import org.openstreetmap.josm.data.osm.Node; 39 import org.openstreetmap.josm.data.osm.OsmUtils; 40 import org.openstreetmap.josm.data.osm.Relation; 41 import org.openstreetmap.josm.data.osm.RelationMember; 42 import org.openstreetmap.josm.data.osm.Way; 38 43 import org.openstreetmap.josm.gui.progress.AbstractProgressMonitor; 39 44 import org.openstreetmap.josm.gui.progress.CancelHandler; … … 545 550 // CHECKSTYLE.ON: MethodLength 546 551 // CHECKSTYLE.ON: AnonInnerLength 552 553 /** 554 * Creates a new way with the given tags (see {@link OsmUtils#createPrimitive(java.lang.String)}) and the nodes added 555 * 556 * @param tags the tags to set 557 * @param nodes the nodes to add 558 * @return a new way 559 */ 560 public static Way newWay(String tags, Node... nodes) { 561 final Way way = (Way) OsmUtils.createPrimitive("way " + tags); 562 for (Node node : nodes) { 563 way.addNode(node); 564 } 565 return way; 566 } 567 568 /** 569 * Creates a new relation with the given tags (see {@link OsmUtils#createPrimitive(java.lang.String)}) and the members added 570 * 571 * @param tags the tags to set 572 * @param members the members to add 573 * @return a new relation 574 */ 575 public static Relation newRelation(String tags, RelationMember... members) { 576 final Relation relation = (Relation) OsmUtils.createPrimitive("relation " + tags); 577 for (RelationMember member : members) { 578 relation.addMember(member); 579 } 580 return relation; 581 } 547 582 }
Note:
See TracChangeset
for help on using the changeset viewer.