@Test public void testAddSeaCloudsApplicationData() throws Exception { Yaml yamlParser = new Yaml(); URL resource = Resources.getResource(TOSCA_DAM_FILE_PATH); Map toscaDamMap = (Map) yamlParser.load(FileUtils.openInputStream(new File(resource.getFile()))); int oldSize = dataStore.listSeaCloudsApplicationData().size(); SeaCloudsApplicationData seaCloudsApplicationData = new SeaCloudsApplicationData(toscaDamMap); dataStore.addSeaCloudsApplicationData(seaCloudsApplicationData); int newSize = dataStore.listSeaCloudsApplicationData().size(); assertEquals(oldSize, newSize-1); SeaCloudsApplicationData seaCloudsApplicationDataById = dataStore.getSeaCloudsApplicationDataById(seaCloudsApplicationData.getSeaCloudsApplicationId()); assertEquals(seaCloudsApplicationData, seaCloudsApplicationDataById); }
public SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication) { ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG); treeMap.put(newApplication.getSeaCloudsApplicationId(), newApplication); dataStore.commit(); return newApplication; }
SeaCloudsApplicationDataStorage { public SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication) { ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG); treeMap.put(newApplication.getSeaCloudsApplicationId(), newApplication); dataStore.commit(); return newApplication; } }
SeaCloudsApplicationDataStorage { public SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication) { ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG); treeMap.put(newApplication.getSeaCloudsApplicationId(), newApplication); dataStore.commit(); return newApplication; } private  SeaCloudsApplicationDataStorage(boolean persistency); }
SeaCloudsApplicationDataStorage { public SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication) { ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG); treeMap.put(newApplication.getSeaCloudsApplicationId(), newApplication); dataStore.commit(); return newApplication; } private  SeaCloudsApplicationDataStorage(boolean persistency); static SeaCloudsApplicationDataStorage getInstance(); SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication); SeaCloudsApplicationData getSeaCloudsApplicationDataById(String id); List<SeaCloudsApplicationData> listSeaCloudsApplicationData(); SeaCloudsApplicationData removeSeaCloudsApplicationDataById(String id); void clearDataStore(); }
SeaCloudsApplicationDataStorage { public SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication) { ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG); treeMap.put(newApplication.getSeaCloudsApplicationId(), newApplication); dataStore.commit(); return newApplication; } private  SeaCloudsApplicationDataStorage(boolean persistency); static SeaCloudsApplicationDataStorage getInstance(); SeaCloudsApplicationData addSeaCloudsApplicationData(SeaCloudsApplicationData newApplication); SeaCloudsApplicationData getSeaCloudsApplicationDataById(String id); List<SeaCloudsApplicationData> listSeaCloudsApplicationData(); SeaCloudsApplicationData removeSeaCloudsApplicationDataById(String id); void clearDataStore();  }