Changeset 9933 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2016-03-05T18:33:11+01:00 (8 years ago)
Author:
simon04
Message:

see #8460 - Validate that public transport routes (version 2) do not contain a gap

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  
    3636import java.util.Map;
    3737
     38import org.openstreetmap.josm.data.osm.Node;
     39import org.openstreetmap.josm.data.osm.OsmUtils;
     40import org.openstreetmap.josm.data.osm.Relation;
     41import org.openstreetmap.josm.data.osm.RelationMember;
     42import org.openstreetmap.josm.data.osm.Way;
    3843import org.openstreetmap.josm.gui.progress.AbstractProgressMonitor;
    3944import org.openstreetmap.josm.gui.progress.CancelHandler;
     
    545550    // CHECKSTYLE.ON: MethodLength
    546551    // 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    }
    547582}
Note: See TracChangeset for help on using the changeset viewer.