@Test public void testQueryOmskJSON() throws WeatherException, JSONException { OpenWeatherMapSource source = new OpenWeatherMapSource(context); Location location = new SimpleLocation("lat=54.96&lon=73.38", true); JSONObject json = source.queryCurrentWeather(location); assertNotNull(json); assertEquals("Omsk", json.getString("name")); }
JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); }
OpenWeatherMapSource extends HttpWeatherSource implements WeatherSource { JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); } }
OpenWeatherMapSource extends HttpWeatherSource implements WeatherSource { JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); } OpenWeatherMapSource(Context context); }
OpenWeatherMapSource extends HttpWeatherSource implements WeatherSource { JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); } OpenWeatherMapSource(Context context); @Override Weather query(Location location); @Override Weather query(Location location, Locale locale); }
OpenWeatherMapSource extends HttpWeatherSource implements WeatherSource { JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); } OpenWeatherMapSource(Context context); @Override Weather query(Location location); @Override Weather query(Location location, Locale locale);  }