source: osm/applications/editors/josm/plugins/reltoolbox/test/unit/relcontext/relationfix/AssociatedStreetFixerTest.java

Last change on this file was 36483, checked in by stoecker, 8 months ago

set eol-style, fix checkstyle issues, add ignores

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package relcontext.relationfix;
3
4import java.util.stream.Stream;
5
6import org.junit.jupiter.api.BeforeEach;
7import org.openstreetmap.josm.TestUtils;
8import org.openstreetmap.josm.data.osm.DataSet;
9import org.openstreetmap.josm.data.osm.Relation;
10import org.openstreetmap.josm.data.osm.RelationMember;
11import relcontext.ChosenRelation;
12import relcontext.actions.SortAndFixAction;
13
14/**
15 * Test class for {@link AssociatedStreetFixer}
16 */
17class AssociatedStreetFixerTest implements RelationFixerTest {
18 private AssociatedStreetFixer instance;
19
20 @BeforeEach
21 void setup() {
22 this.instance = new AssociatedStreetFixer();
23 this.instance.setFixAction(new SortAndFixAction(new ChosenRelation()));
24 }
25
26 @Override
27 public RelationFixer getInstance() {
28 return this.instance;
29 }
30
31 @Override
32 public Stream<Relation> getBadRelations() {
33 final Relation relation = TestUtils.newRelation("type=associatedStreet name=FooBar",
34 new RelationMember("street_misspelled", TestUtils.newWay("highway=residential name=Baz",
35 TestUtils.newNode(""), TestUtils.newNode(""))),
36 new RelationMember("house_misspelled", TestUtils.newNode("")));
37 final DataSet ds = new DataSet();
38 ds.addPrimitiveRecursive(relation);
39 return Stream.of(relation);
40 }
41
42 @Override
43 public Stream<Relation> getGoodRelations() {
44 final Relation relation = TestUtils.newRelation("type=associatedStreet name=FooBar",
45 new RelationMember("street", TestUtils.newWay("highway=residential name=FooBar", TestUtils.newNode(""), TestUtils.newNode(""))),
46 new RelationMember("house", TestUtils.newNode("")));
47 final DataSet ds = new DataSet();
48 ds.addPrimitiveRecursive(relation);
49 return Stream.of(relation);
50 }
51}
Note: See TracBrowser for help on using the repository browser.