use of org.codice.ddf.spatial.geocoding.GeoEntry in project ddf by codice.
the class TestGeoNamesQueryLuceneIndex method testQueryWithNoResults.
@Test
public void testQueryWithNoResults() throws IOException, ParseException, GeoEntryQueryException {
final int requestedMaxResults = 2;
final int actualResults = 0;
final String queryString = "another place";
final List<GeoEntry> results = directoryIndex.query(queryString, requestedMaxResults);
assertThat(results.size(), is(actualResults));
}
use of org.codice.ddf.spatial.geocoding.GeoEntry in project ddf by codice.
the class TestGeoNamesQueryLuceneIndex method testQueryWithLessThanMaxResults.
@Test
public void testQueryWithLessThanMaxResults() throws IOException, ParseException, GeoEntryQueryException {
final int requestedMaxResults = 2;
final int actualResults = 1;
final String queryString = "glendale";
final List<GeoEntry> results = directoryIndex.query(queryString, requestedMaxResults);
assertThat(results.size(), is(actualResults));
final GeoEntry firstResult = results.get(0);
// We don't store the alternate names, so we don't get them back with the query results.
verifyGeoEntry(firstResult, NAME_3, LAT_3, LON_3, FEATURE_CODE_3, POP_3, null, COUNTRY_CODE3);
}
Aggregations