@Test public void testGlobalSettingsPriority() { final String SETTINGS = "settings"; final String SETTING_NAME = "hello"; final String GLOBAL_VAL = "world"; final String SETTING_VAL = "human"; AliyunAccount account = new AliyunAccount("foo", "bar"); Odps odps = new Odps(account); Map<String, String> globalSettings = new HashMap<>(); globalSettings.put(SETTING_NAME, GLOBAL_VAL); odps.setGlobalSettings(globalSettings); Task task = new SQLTask(); Gson gson = new GsonBuilder().disableHtmlEscaping().create(); Map<String, String> settings = new HashMap<>(); settings.put(SETTING_NAME, SETTING_VAL); gson.toJson(settings); task.setProperty(SETTINGS, gson.toJson(settings)); task.loadGlobalSettings(); String settingsStr = task.getProperties().get(SETTINGS); assertNotNull(settingsStr); JsonParser parser = new JsonParser(); JsonObject jsonObject = parser.parse(settingsStr).getAsJsonObject(); assertEquals(SETTING_VAL, jsonObject.get(SETTING_NAME).getAsString()); }
public void setGlobalSettings(Map<String, String> settings) { Task.setGlobalSettings(settings); }
Odps { public void setGlobalSettings(Map<String, String> settings) { Task.setGlobalSettings(settings); } }
Odps { public void setGlobalSettings(Map<String, String> settings) { Task.setGlobalSettings(settings); } Odps(Account account);  Odps(Account account, AppAccount appAccount);  Odps(Odps odps); }
Odps { public void setGlobalSettings(Map<String, String> settings) { Task.setGlobalSettings(settings); } Odps(Account account);  Odps(Account account, AppAccount appAccount);  Odps(Odps odps); void setAccount(Account account); void setAppAccount(AppAccount appAccount); Projects projects(); Tables tables(); Instances instances(); Resources resources(); Functions functions(); Volumes volumes(); Account getAccount(); AppAccount getAppAccount(); String getEndpoint(); void setEndpoint(String endpoint); String getDefaultProject(); void setDefaultProject(String defaultProject); void setUserAgent(String userAgent); String getUserAgent(); LogView logview(); XFlows xFlows(); OfflineModels offlineModels(); @Override Odps clone(); RestClient getRestClient(); String getLogViewHost(); void setLogViewHost(String host); void setAccountFormat(AccountFormat format); AccountFormat getAccountFormat(); void setGlobalSettings(Map<String, String> settings); Map<String, String> getGlobalSettings(); }
Odps { public void setGlobalSettings(Map<String, String> settings) { Task.setGlobalSettings(settings); } Odps(Account account);  Odps(Account account, AppAccount appAccount);  Odps(Odps odps); void setAccount(Account account); void setAppAccount(AppAccount appAccount); Projects projects(); Tables tables(); Instances instances(); Resources resources(); Functions functions(); Volumes volumes(); Account getAccount(); AppAccount getAppAccount(); String getEndpoint(); void setEndpoint(String endpoint); String getDefaultProject(); void setDefaultProject(String defaultProject); void setUserAgent(String userAgent); String getUserAgent(); LogView logview(); XFlows xFlows(); OfflineModels offlineModels(); @Override Odps clone(); RestClient getRestClient(); String getLogViewHost(); void setLogViewHost(String host); void setAccountFormat(AccountFormat format); AccountFormat getAccountFormat(); void setGlobalSettings(Map<String, String> settings); Map<String, String> getGlobalSettings();  }