Search in sources :

Example 1 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalAllowance.

@Test
public void testConditionalAllowance() {
    Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "yes @ (Mar 10-Aug 14)");
    assertTrue(acceptor.isRestrictedWayConditionallyPermitted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.jupiter.api.Test)

Example 2 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalAccept.

@Test
public void testConditionalAccept() {
    Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "no @ (Aug 10-Aug 14)");
    assertFalse(acceptor.isPermittedWayConditionallyRestricted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.jupiter.api.Test)

Example 3 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalAllowanceReject.

@Test
public void testConditionalAllowanceReject() {
    Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "no @ (Mar 10-Aug 14)");
    assertTrue(acceptor.isPermittedWayConditionallyRestricted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.jupiter.api.Test)

Example 4 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalAcceptNextYear.

@Test
public void testConditionalAcceptNextYear() {
    Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "no @ (2013 Mar 1-2013 Mar 31)");
    assertFalse(acceptor.isPermittedWayConditionallyRestricted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.jupiter.api.Test)

Example 5 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalSingleDay.

@Test
public void testConditionalSingleDay() {
    Calendar cal = getCalendar(2015, Calendar.DECEMBER, 27);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "no @ (Su)");
    assertTrue(acceptor.isPermittedWayConditionallyRestricted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.jupiter.api.Test)

Aggregations

ConditionalTagInspector (com.graphhopper.reader.ConditionalTagInspector)7 ReaderWay (com.graphhopper.reader.ReaderWay)7 Test (org.junit.jupiter.api.Test)7