Skip to content

Commit

Permalink
Implemented the DydraRepositoryManager#getRepositoryConfig() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed May 14, 2012
1 parent fd28626 commit ac69fca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/com/dydra/sesame/DydraRepositoryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Set;

import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.config.RepositoryConfig;
import org.openrdf.repository.config.RepositoryConfigException;
import org.openrdf.repository.manager.RemoteRepositoryManager;
import org.openrdf.repository.manager.RepositoryManager;
Expand Down Expand Up @@ -82,4 +83,12 @@ public boolean hasRepositoryConfig(@NotNull final String repositoryID)
throws RepositoryException, RepositoryConfigException {
return this.getRepositoryIDs().contains(repositoryID);
}

@Override @Nullable
public RepositoryConfig getRepositoryConfig(@NotNull final String repositoryID)
throws RepositoryException, RepositoryConfigException {
final RepositoryInfo repositoryInfo = this.getRepositoryInfo(repositoryID);
return (repositoryInfo == null) ? null :
new RepositoryConfig(repositoryID, repositoryInfo.getDescription());
}
}
10 changes: 8 additions & 2 deletions test/com/dydra/sesame/DydraRepositoryManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static org.hamcrest.CoreMatchers.*;
import java.util.*;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.config.RepositoryConfig;
import org.openrdf.repository.config.RepositoryConfigException;
import org.openrdf.repository.manager.RepositoryInfo;
import org.openrdf.repository.manager.SystemRepository;
Expand Down Expand Up @@ -83,8 +84,13 @@ public void testGetRepositoryInfo()
}

@Test
public void testGetRepositoryConfig() {
// TODO
public void testGetRepositoryConfig()
throws RepositoryException, RepositoryConfigException {
final RepositoryConfig config = manager.getRepositoryConfig(this.repositoryName);
assertNotNull(config);
assertNotNull(config.getID());
assertNotNull(config.getTitle());
assertNull(manager.getRepositoryConfig(UUID.randomUUID().toString()));
}

@Test
Expand Down

0 comments on commit ac69fca

Please sign in to comment.