use of com.chinaunicom.rundocker.store.Config in project mesosFramework by zhizuqiu.
the class Tools method getObjFromConfigUseJsonPath.
/**
* 使用jsonPath工具,获取config的json里面的值
*
* @param operator jsonPath参数
* @return 值
*/
public static Object getObjFromConfigUseJsonPath(String operator) {
Config config = AppDataStore.getConfig();
if (config == null) {
return null;
}
if (operator == null || operator.trim().isEmpty()) {
return config;
}
Object obj = null;
try {
String json = new Gson().toJson(config);
obj = JsonPath.read(json, operator);
} catch (Exception e) {
logger.error(e.getMessage());
}
return obj;
}
use of com.chinaunicom.rundocker.store.Config in project mesosFramework by zhizuqiu.
the class EtcdServiceTest method before.
@Before
public void before() {
// http://192.168.84.131:2379
Etcd etcd = EtcdClient.getInstance("http://10.124.142.127:5379");
etcdService = new EtcdService(etcd);
Config config = new Config();
config.setFrameworkName("dockerFramework");
AppDataStore.setConfig(config);
}
use of com.chinaunicom.rundocker.store.Config in project mesosFramework by zhizuqiu.
the class SchedulerServiceTest method be.
@Before
public void be() {
AppDataStore.setConfig(new Config());
AppDataStore.getConfig().setStoreMustachePath("springcloud/default.mustache");
}
use of com.chinaunicom.rundocker.store.Config in project mesosFramework by zhizuqiu.
the class ToolsTest method before.
@Before
public void before() {
String id = "/2048/1";
DockerJob dockerJob = new DockerJob();
dockerJob.setId(id);
AppDataStore.jobsPut(id.replaceAll("/", "."), dockerJob);
DockerStatus dockerStatus = new DockerStatus();
dockerStatus.setId(id);
AppDataStore.statusPut(id.replaceAll("/", "."), dockerStatus);
AppDataStore.setConfig(new Config());
AppDataStore.getConfig().setFrameworkName("2048");
}
Aggregations