@Test public void testListScopes() { Collection<ScopePath> scopes = persister.listScopes("a", EMPTY_MAP); assertEquals(0, scopes.size()); persister.saveConfiguration(testConfig); scopes = persister.listScopes("a", EMPTY_MAP); assertEquals(testConfig.getDefiningScopePath(), scopes.iterator().next()); }
@Override public Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties) { final List<ScopePath> resultList = new ArrayList<ScopePath>(); for (final ScopePath tmpScopePath : savedObjects.keySet()) { for (final Scope tmpScope : tmpScopePath.getScopes()) { if (tmpScope.getName().equals(scopeName) && tmpScope.containsAllProperties(properties)) { resultList.add(tmpScopePath); } } } return resultList; }
InMemoryPersister implements ConfigPersister { @Override public Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties) { final List<ScopePath> resultList = new ArrayList<ScopePath>(); for (final ScopePath tmpScopePath : savedObjects.keySet()) { for (final Scope tmpScope : tmpScopePath.getScopes()) { if (tmpScope.getName().equals(scopeName) && tmpScope.containsAllProperties(properties)) { resultList.add(tmpScopePath); } } } return resultList; } }
InMemoryPersister implements ConfigPersister { @Override public Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties) { final List<ScopePath> resultList = new ArrayList<ScopePath>(); for (final ScopePath tmpScopePath : savedObjects.keySet()) { for (final Scope tmpScope : tmpScopePath.getScopes()) { if (tmpScope.getName().equals(scopeName) && tmpScope.containsAllProperties(properties)) { resultList.add(tmpScopePath); } } } return resultList; } InMemoryPersister(); }
InMemoryPersister implements ConfigPersister { @Override public Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties) { final List<ScopePath> resultList = new ArrayList<ScopePath>(); for (final ScopePath tmpScopePath : savedObjects.keySet()) { for (final Scope tmpScope : tmpScopePath.getScopes()) { if (tmpScope.getName().equals(scopeName) && tmpScope.containsAllProperties(properties)) { resultList.add(tmpScopePath); } } } return resultList; } InMemoryPersister(); @Override void saveConfiguration(final ComplexConfigDTO configDTO); @Override ComplexConfigDTO loadConfiguration(final ScopePath scopePath); @Override void updateConfiguration(final ComplexConfigDTO configDTO); @Override String getId(); @Override Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties); @Override void delete(final ScopePath scopePath, final boolean deleteChildren); @Override void deleteAllOccurences(final String scopeName, final Map<String, String> properties); }
InMemoryPersister implements ConfigPersister { @Override public Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties) { final List<ScopePath> resultList = new ArrayList<ScopePath>(); for (final ScopePath tmpScopePath : savedObjects.keySet()) { for (final Scope tmpScope : tmpScopePath.getScopes()) { if (tmpScope.getName().equals(scopeName) && tmpScope.containsAllProperties(properties)) { resultList.add(tmpScopePath); } } } return resultList; } InMemoryPersister(); @Override void saveConfiguration(final ComplexConfigDTO configDTO); @Override ComplexConfigDTO loadConfiguration(final ScopePath scopePath); @Override void updateConfiguration(final ComplexConfigDTO configDTO); @Override String getId(); @Override Collection<ScopePath> listScopes(final String scopeName, final Map<String, String> properties); @Override void delete(final ScopePath scopePath, final boolean deleteChildren); @Override void deleteAllOccurences(final String scopeName, final Map<String, String> properties); static final String ID; }