Changeset 6377 in josm for trunk/test


Ignore:
Timestamp:
2013-11-07T22:14:53+01:00 (6 years ago)
Author:
simon04
Message:

see #9157 - make some errors in opening_hours fixable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java

    r6376 r6377  
    66import org.openstreetmap.josm.data.Preferences;
    77import org.openstreetmap.josm.data.validation.Severity;
    8 import org.openstreetmap.josm.data.validation.TestError;
    98
    109import java.util.List;
     
    3433    @Test
    3534    public void testCheckOpeningHourSyntax2() throws Exception {
    36         final List<TestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Tue");
     35        final List<OpeningHourTest.OpeningHoursTestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax("Mo-Tue");
    3736        assertThat(errors.size(), is(1));
    3837        assertThat(errors.get(0).getMessage(), is("Mo-Tue <--- (Please use the abbreviation \"Tu\" for \"tue\".)"));
     
    4241    @Test
    4342    public void testCheckOpeningHourSyntax3() throws Exception {
    44         final List<TestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax("Sa-Su 10.00-20.00");
     43        final List<OpeningHourTest.OpeningHoursTestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax("Sa-Su 10.00-20.00");
    4544        assertThat(errors.size(), is(2));
    4645        assertThat(errors.get(0).getMessage(), is("Sa-Su 10. <--- (Please use \":\" as hour/minute-separator)"));
    4746        assertThat(errors.get(0).getSeverity(), is(Severity.WARNING));
     47        assertThat(errors.get(0).getPrettifiedValue(), is("Sa-Su 10:00-20:00"));
    4848        assertThat(errors.get(1).getMessage(), is("Sa-Su 10.00-20. <--- (Please use \":\" as hour/minute-separator)"));
    4949        assertThat(errors.get(1).getSeverity(), is(Severity.WARNING));
     
    6262        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("badtext").get(0).getMessage(),
    6363                is("opening_hours - ba <--- (Unexpected token: \"b\" This means that the syntax is not valid at that point or it is currently not supported.)"));
     64        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("5.00 p.m-11.00 p.m").size(), is(1));
     65        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax("5.00 p.m-11.00 p.m").get(0).getMessage(),
     66                is("opening_hours - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)"));
    6467    }
    6568
Note: See TracChangeset for help on using the changeset viewer.