test_class.declarator: TAG = ServicesManagerTest.class.getSimpleName()
test_class.modifier: public static final
test_class.original_string: public static final String TAG = ServicesManagerTest.class.getSimpleName();
test_class.type: String
test_class.var_name: TAG
test_class.declarator: mServicesManger = null
test_class.modifier: private
test_class.original_string: private ServicesManager mServicesManger = null;
test_class.type: ServicesManager
test_class.var_name: mServicesManger
test_class.file: model/src/test/java/com/zeuschan/littlefreshweather/model/restapi/ServicesManagerTest.java
test_class.identifier: ServicesManagerTest
test_case.body: @Test
      public void testServicesManagerGetWeatherConditions() throws Exception {
          assertNotNull(mServicesManger);
          TestSubscriber<List<WeatherConditionEntity>> testSubscriber = TestSubscriber.create(new GetWeatherConditionsDelegate());
          mServicesManger.getWeatherConditionEntities().subscribe(testSubscriber);
          testSubscriber.awaitTerminalEvent();
          testSubscriber.assertNoErrors();
  
          /*final Logger logger = Logger.getLogger("testServicesManagerGetWeatherConditions");
          assertNotNull(mServicesManger);
          mServicesManger.getWeatherConditions()
                  .subscribe(new Subscriber<List<WeatherConditionEntity>>() {
                      @Override
                      public void onCompleted() {
                          logger.info("onCompleted");
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          logger.info("onError");
                      }
  
                      @Override
                      public void onNext(List<WeatherConditionEntity> weatherConditionEntities) {
                          logger.info("onNext");
                          mWeatherConditions = weatherConditionEntities;
                          for (WeatherConditionEntity condition :
                                  weatherConditionEntities) {
                              logger.info(condition.toString());
                          }
                      }
                  });
          assertNotNull(mWeatherConditions);
          assertFalse(mWeatherConditions.isEmpty());*/
      }
test_case.class_method_signature: ServicesManagerTest.testServicesManagerGetWeatherConditions()
test_case.full_signature: @Test public void testServicesManagerGetWeatherConditions()
test_case.identifier: testServicesManagerGetWeatherConditions
test_case.invocations: assertNotNull create subscribe getWeatherConditionEntities awaitTerminalEvent assertNoErrors
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testServicesManagerGetWeatherConditions()
focal_class.declarator: TAG = ServicesManager.class.getSimpleName()
focal_class.modifier: private static final
focal_class.original_string: private static final String TAG = ServicesManager.class.getSimpleName();
focal_class.type: String
focal_class.var_name: TAG
focal_class.declarator: DEFAULT_TIMEOUT = 5
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_TIMEOUT = 5;
focal_class.type: int
focal_class.var_name: DEFAULT_TIMEOUT
focal_class.declarator: ourInstance = new ServicesManager()
focal_class.modifier: private static
focal_class.original_string: private static ServicesManager ourInstance = new ServicesManager();
focal_class.type: ServicesManager
focal_class.var_name: ourInstance
focal_class.declarator: weatherInfoService
focal_class.modifier: private final
focal_class.original_string: private final WeatherInfoService weatherInfoService;
focal_class.type: WeatherInfoService
focal_class.var_name: weatherInfoService
focal_class.declarator: mNameMap = new android.support.v4.util.ArrayMap<>(6)
focal_class.modifier: private
focal_class.original_string: private Map<String, String> mNameMap = new android.support.v4.util.ArrayMap<>(6);
focal_class.type: Map<String, String>
focal_class.var_name: mNameMap
focal_class.declarator: mCityEntities = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<CityEntity> mCityEntities = new ArrayList<>();
focal_class.type: List<CityEntity>
focal_class.var_name: mCityEntities
focal_class.declarator: mWeatherCondtionEntities = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<WeatherConditionEntity> mWeatherCondtionEntities = new ArrayList<>();
focal_class.type: List<WeatherConditionEntity>
focal_class.var_name: mWeatherCondtionEntities
focal_class.declarator: mForecasts = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<WeatherEntity.Forecast> mForecasts = new ArrayList<>();
focal_class.type: List<WeatherEntity.Forecast>
focal_class.var_name: mForecasts
focal_class.file: model/src/main/java/com/zeuschan/littlefreshweather/model/restapi/ServicesManager.java
focal_class.identifier: ServicesManager
focal_class.interfaces: implements DataSource
focal_class.class_method_signature: ServicesManager.getInstance()
focal_class.full_signature: public static ServicesManager getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: ServicesManager
focal_class.signature: ServicesManager getInstance()
focal_class.class_method_signature: ServicesManager.ServicesManager()
focal_class.full_signature: private  ServicesManager()
focal_class.identifier: ServicesManager
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ServicesManager()
focal_class.class_method_signature: ServicesManager.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: ServicesManager.getCityEntities()
focal_class.full_signature: @Override public Observable<List<CityEntity>> getCityEntities()
focal_class.identifier: getCityEntities
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Observable<List<CityEntity>>
focal_class.signature: Observable<List<CityEntity>> getCityEntities()
focal_class.class_method_signature: ServicesManager.getWeatherConditionEntities()
focal_class.full_signature: @Override public Observable<List<WeatherConditionEntity>> getWeatherConditionEntities()
focal_class.identifier: getWeatherConditionEntities
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Observable<List<WeatherConditionEntity>>
focal_class.signature: Observable<List<WeatherConditionEntity>> getWeatherConditionEntities()
focal_class.class_method_signature: ServicesManager.getCityWeather(String cityId, boolean fromCache)
focal_class.full_signature: @Override public Observable<WeatherEntity> getCityWeather(String cityId, boolean fromCache)
focal_class.identifier: getCityWeather
focal_class.modifiers: @Override public
focal_class.parameters: (String cityId, boolean fromCache)
focal_class.return: Observable<WeatherEntity>
focal_class.signature: Observable<WeatherEntity> getCityWeather(String cityId, boolean fromCache)
focal_method.body: @Override
      public Observable<List<WeatherConditionEntity>> getWeatherConditionEntities() {
          Map<String, String> params = new android.support.v4.util.ArrayMap<>(2);
          params.put("search", Constants.SEARCH_ALL_COND);
          params.put("key", Constants.WEATHER_KEY);
  
          return weatherInfoService.getConditionInfos(params)
                  .map(new Func1<ConditionsResponse, List<WeatherConditionEntity>>() {
                      @Override
                      public List<WeatherConditionEntity> call(ConditionsResponse conditionsResponse) {
                          if (null == conditionsResponse) {
                              throw new WeatherServiceException("no data");
                          }
                          if (!conditionsResponse.getResultCode().equals(Constants.OK)) {
                              throw new WeatherServiceException("error code: " + conditionsResponse.getResultCode());
                          }
  
                          mWeatherCondtionEntities.clear();
                          List<ConditionsResponse.ConditionInfo> weatherConditionInfos = conditionsResponse.getConditions();
                          if (weatherConditionInfos != null) {
                              for (ConditionsResponse.ConditionInfo conditionInfo : weatherConditionInfos) {
                                  if (conditionInfo != null) {
                                      WeatherConditionEntity conditionEntity = new WeatherConditionEntity();
                                      conditionEntity.setWeatherCode(TextUtils.isEmpty(conditionInfo.getConditionCode()) ? WeatherConditionEntity.DEFAULT_VALUE : conditionInfo.getConditionCode());
                                      conditionEntity.setWeatherDescription(TextUtils.isEmpty(conditionInfo.getWeatherDescription()) ? WeatherConditionEntity.DEFAULT_VALUE : conditionInfo.getWeatherDescription());
                                      conditionEntity.setWeatherIconUrl(TextUtils.isEmpty(conditionInfo.getWeatherIconUrl()) ? WeatherConditionEntity.DEFAULT_VALUE : conditionInfo.getWeatherIconUrl());
                                      mWeatherCondtionEntities.add(conditionEntity);
                                  }
                              }
                          }
                          return mWeatherCondtionEntities;
                      }
                  });
      }
focal_method.class_method_signature: ServicesManager.getWeatherConditionEntities()
focal_method.full_signature: @Override public Observable<List<WeatherConditionEntity>> getWeatherConditionEntities()
focal_method.identifier: getWeatherConditionEntities
focal_method.invocations: put put map getConditionInfos equals getResultCode getResultCode clear getConditions setWeatherCode isEmpty getConditionCode getConditionCode setWeatherDescription isEmpty getWeatherDescription getWeatherDescription setWeatherIconUrl isEmpty getWeatherIconUrl getWeatherIconUrl add
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Observable<List<WeatherConditionEntity>>
focal_method.signature: Observable<List<WeatherConditionEntity>> getWeatherConditionEntities()