// Set up the configuration repository ...
configRepositorySource = new InMemoryRepositorySource();
configRepositorySource.setName("Configuration Repository");
configRepositorySource.setDefaultWorkspaceName(configurationWorkspaceName);
Graph config = Graph.create(configRepositorySource, context);
config.create("/a").and();
config.create("/a/b").and();
config.create("/a/b/Test Repository").and();
config.create("/a/b/Test Repository/dna:workspaces").and();
repositoryContext = new RepositoryContext() {
public ExecutionContext getExecutionContext() {
return context;
}
public Observer getObserver() {
return null;
}
@SuppressWarnings( "synthetic-access" )
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return connectionFactory;
}
@SuppressWarnings( "synthetic-access" )
public Subgraph getConfiguration( int depth ) {
Graph result = Graph.create(configRepositorySource, context);
result.useWorkspace(configurationWorkspaceName);
return result.getSubgraphOfDepth(depth).at("/a/b/Test Repository");
}
};
// Set up the source ...
source = new FederatedRepositorySource();