Changeset 11916 in josm for trunk/test


Ignore:
Timestamp:
2017-04-15T16:15:28+02:00 (2 years ago)
Author:
Don-vip
Message:

see #14653 - add support for multiple Overpass API output formats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java

    r11009 r11916  
    33
    44import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertTrue;
    56
    67import org.junit.Rule;
     
    89import org.openstreetmap.josm.data.Bounds;
    910import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;
     11import org.openstreetmap.josm.io.OverpassDownloadReader.OverpassOutpoutFormat;
    1012import org.openstreetmap.josm.testutils.JOSMTestRules;
    1113import org.openstreetmap.josm.tools.OverpassTurboQueryWizard;
     
    7779        assertEquals("// Failed to evaluate {{geocodeArea:foo-bar-baz-does-not-exist}}\n", query);
    7880    }
     81
     82    /**
     83     * Tests evaluating the overpass output format statements.
     84     */
     85    @Test
     86    public void testOutputFormatStatement() {
     87        for (OverpassOutpoutFormat oof : OverpassOutpoutFormat.values()) {
     88            assertTrue(OverpassDownloadReader.OUTPUT_FORMAT_STATEMENT.matcher("[out:"+oof.getDirective()+"]").matches());
     89        }
     90
     91        assertTrue(OverpassDownloadReader.OUTPUT_FORMAT_STATEMENT.matcher(
     92                "[out:pbf][timeout:25][bbox:{{bbox}}];\n" +
     93                "(\n" +
     94                "  node[\"amenity\"=\"pharmacy\"];\n" +
     95                "  way[\"amenity\"=\"pharmacy\"];\n" +
     96                "  relation[\"amenity\"=\"pharmacy\"];\n" +
     97                ");\n" +
     98                "(._;>;);\n" +
     99                "out meta;").matches());
     100    }
    79101}
Note: See TracChangeset for help on using the changeset viewer.