@Test public void shouldReturnRepositoryNames() throws Exception { assertTrue(repositoriesContainer.getRepositoryNames(null).isEmpty()); String url = "file:src/test/resources/config/simple-repo-config.json"; Map<String, String> params = new HashMap<String, String>(); params.put(RepositoryFactory.URL, url); Set<String> repositoryNames = repositoriesContainer.getRepositoryNames(params); Assert.assertTrue(repositoryNames.contains("Another Test Repository")); url = "file:src/test/resources/config/repo-config.json"; params.put(RepositoryFactory.URL, url); repositoryNames = repositoriesContainer.getRepositoryNames(params); Assert.assertEquals(2, repositoryNames.size()); Assert.assertTrue(repositoryNames.contains("Another Test Repository")); Assert.assertTrue(repositoryNames.contains("CND Sequencer Test Repository")); }
@Override public Set<String> getRepositoryNames( Map<?, ?> parameters ) throws RepositoryException { Set<String> repositoryNames = engine().getRepositoryNames(); String repositoryURL = repositoryURLFromParams(parameters); if (repositoryURL == null) { LOG.debug("No repository URL parameter found"); return repositoryNames; } if (repositoryURL.toLowerCase().startsWith(JNDI_PROTOCOL)) { Set<String> jndiRepositories = new JNDIRepositoryLookup().repositoryNames(parameters, repositoryURL); repositoryNames.addAll(jndiRepositories); } else { JcrRepository repository = new UrlRepositoryLookup().repository(parameters, repositoryURL); if (repository != null) { repositoryNames.add(repository.getName()); } } return repositoryNames; }
JcrRepositoriesContainer implements RepositoriesContainer { @Override public Set<String> getRepositoryNames( Map<?, ?> parameters ) throws RepositoryException { Set<String> repositoryNames = engine().getRepositoryNames(); String repositoryURL = repositoryURLFromParams(parameters); if (repositoryURL == null) { LOG.debug("No repository URL parameter found"); return repositoryNames; } if (repositoryURL.toLowerCase().startsWith(JNDI_PROTOCOL)) { Set<String> jndiRepositories = new JNDIRepositoryLookup().repositoryNames(parameters, repositoryURL); repositoryNames.addAll(jndiRepositories); } else { JcrRepository repository = new UrlRepositoryLookup().repository(parameters, repositoryURL); if (repository != null) { repositoryNames.add(repository.getName()); } } return repositoryNames; } }
JcrRepositoriesContainer implements RepositoriesContainer { @Override public Set<String> getRepositoryNames( Map<?, ?> parameters ) throws RepositoryException { Set<String> repositoryNames = engine().getRepositoryNames(); String repositoryURL = repositoryURLFromParams(parameters); if (repositoryURL == null) { LOG.debug("No repository URL parameter found"); return repositoryNames; } if (repositoryURL.toLowerCase().startsWith(JNDI_PROTOCOL)) { Set<String> jndiRepositories = new JNDIRepositoryLookup().repositoryNames(parameters, repositoryURL); repositoryNames.addAll(jndiRepositories); } else { JcrRepository repository = new UrlRepositoryLookup().repository(parameters, repositoryURL); if (repository != null) { repositoryNames.add(repository.getName()); } } return repositoryNames; }  }
JcrRepositoriesContainer implements RepositoriesContainer { @Override public Set<String> getRepositoryNames( Map<?, ?> parameters ) throws RepositoryException { Set<String> repositoryNames = engine().getRepositoryNames(); String repositoryURL = repositoryURLFromParams(parameters); if (repositoryURL == null) { LOG.debug("No repository URL parameter found"); return repositoryNames; } if (repositoryURL.toLowerCase().startsWith(JNDI_PROTOCOL)) { Set<String> jndiRepositories = new JNDIRepositoryLookup().repositoryNames(parameters, repositoryURL); repositoryNames.addAll(jndiRepositories); } else { JcrRepository repository = new UrlRepositoryLookup().repository(parameters, repositoryURL); if (repository != null) { repositoryNames.add(repository.getName()); } } return repositoryNames; }  @Override @SuppressWarnings( {"unchecked", "rawtypes"} ) JcrRepository getRepository( String repositoryName,
                                        Map parameters ); @Override Set<String> getRepositoryNames( Map<?, ?> parameters ); @Override Future<Boolean> shutdown(); @Override boolean shutdown( long timeout,
                             TimeUnit unit ); @Override Future<Boolean> shutdownRepository(String repositoryName); }
JcrRepositoriesContainer implements RepositoriesContainer { @Override public Set<String> getRepositoryNames( Map<?, ?> parameters ) throws RepositoryException { Set<String> repositoryNames = engine().getRepositoryNames(); String repositoryURL = repositoryURLFromParams(parameters); if (repositoryURL == null) { LOG.debug("No repository URL parameter found"); return repositoryNames; } if (repositoryURL.toLowerCase().startsWith(JNDI_PROTOCOL)) { Set<String> jndiRepositories = new JNDIRepositoryLookup().repositoryNames(parameters, repositoryURL); repositoryNames.addAll(jndiRepositories); } else { JcrRepository repository = new UrlRepositoryLookup().repository(parameters, repositoryURL); if (repository != null) { repositoryNames.add(repository.getName()); } } return repositoryNames; }  @Override @SuppressWarnings( {"unchecked", "rawtypes"} ) JcrRepository getRepository( String repositoryName,
                                        Map parameters ); @Override Set<String> getRepositoryNames( Map<?, ?> parameters ); @Override Future<Boolean> shutdown(); @Override boolean shutdown( long timeout,
                             TimeUnit unit ); @Override Future<Boolean> shutdownRepository(String repositoryName);  }