Skip to content

Commit

Permalink
Add edge via member turn restriction unit test (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bentleysb authored and MikeGost committed Aug 7, 2018
1 parent d6deecf commit bf13971
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,14 @@ public void testTurnRestrictionWithTwoViaNodesInRelation()
.from(testAtlas.relation(1L));
Assert.assertEquals(Optional.empty(), possibleTurnRestriction);
}

@Test
public void testTurnRestrictionNoUTurn()
{
// Test edge as via member
final Atlas testAtlas = this.rule.getAtlasNoUTurn();
final Optional<TurnRestriction> possibleTurnRestriction = TurnRestriction
.from(testAtlas.relation(1L));
Assert.assertTrue(possibleTurnRestriction.isPresent());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,29 @@ public class ComplexTurnRestrictionTestCaseRule extends CoreTestRule
})
private Atlas relationWithTwoViaNodes;

@TestAtlas(

nodes = {

@Node(id = "1", coordinates = @Loc(value = ONE)),
@Node(id = "2", coordinates = @Loc(value = TWO)),
@Node(id = "3", coordinates = @Loc(value = THREE)),
@Node(id = "4", coordinates = @Loc(value = FOUR)),
@Node(id = "6", coordinates = @Loc(value = SIX))

}, edges = { @Edge(id = "102", coordinates = { @Loc(value = ONE), @Loc(value = TWO) }, tags = { "highway=trunk" }), @Edge(id = "203", coordinates = { @Loc(value = TWO), @Loc(value = THREE) }, tags = { "highway=trunk" }), @Edge(id = "304", coordinates = { @Loc(value = THREE), @Loc(value = FOUR) }, tags = { "highway=trunk" }), @Edge(id = "205", coordinates = { @Loc(value = TWO), @Loc(value = SIX) }, tags = { "highway=trunk" })

}, relations = {

@Relation(id = "1", tags = { "type=restriction",
"restriction=no_left_turn" }, members = {
@Member(id = "102", role = "from", type = "edge"),
@Member(id = "203", role = "via", type = "edge"),
@Member(id = "304", role = "to", type = "edge") })

})
private Atlas atlasNoUTurn;

public Atlas getAtlasNo()
{
return this.atlasNo;
Expand All @@ -110,4 +133,9 @@ public Atlas getRelationWithTwoViaNodes()
{
return this.relationWithTwoViaNodes;
}

public Atlas getAtlasNoUTurn()
{
return this.atlasNoUTurn;
}
}

0 comments on commit bf13971

Please sign in to comment.