CCSManageSvImpl implements ICCSManageSv { @Override public List<String> listSubPath(CCSOperationParam param) throws PaasException { if (!PaaSConstant.UNIX_SEPERATOR.equals(param.getPath())){ param.validate(); if (!exists(param)) throw new PaasException(BundleKeyConstants.PATH_NOT_EXISTS, param.getPath()); } CcsServiceUserConfig config = getCcsServiceUserConfig(param.getUserId(), param.getServiceId()); ZKClient client = null; try { client = ZookeeperClientUtil.getZkClientFromPool(config.getZkAddress(), config.getZkUserName(), CiperUtil.decrypt(ConfigCenterConstants.operators, config.getZkPassword()),config.getServiceId()); if (!PaaSConstant.UNIX_SEPERATOR.equals(param.getPath())){ return client.getChildren(appendCustomUserRootNode(param.getUserId(), param.getServiceId()) + param.getPath()); }else{ return client.getChildren(appendCustomUserRootNode(param.getUserId(), param.getServiceId())); } } catch (Exception e) { logger.error(e.getMessage(),e); throw new PaasException(ResourceUtil.getMessage(BundleKeyConstants.CONFIG_ERROR), e); } }  @Override void add(CCSOperationParam param, String data); @Override void add(CCSOperationParam param, byte[] data); @Override boolean exists(CCSOperationParam param); @Override void modify(CCSOperationParam param, String data); @Override void modify(CCSOperationParam param, byte[] data); @Override String get(CCSOperationParam param); @Override byte[] readBytes(CCSOperationParam param); @Override void delete(CCSOperationParam param); @Override List<String> listSubPath(CCSOperationParam param); @Override Map<String,String> listAllPath(CCSOperationParam param); List<String> formatPath(List<String> children,CCSOperationParam param); @Override List<CCSSubListDTO> listSubPathAndData(CCSOperationParam param); @Override List<String> getServices(CCSOperationParam param); Map<String, String> getResult(); void setResult(Map<String, String> result); static Map<String,String> result; }
@Test public void testListSubPath() throws Exception { CCSOperationParam ccsOperationParam = new CCSOperationParam(); ccsOperationParam.setUserId(userId); ccsOperationParam.setServiceId(serviceId); ccsOperationParam.setPath("/test"); List<String> children = manageSv.listSubPath(ccsOperationParam); assertEquals(1, children.size()); }