Search in sources :

Example 1 with RepositoryManager

use of org.eclipse.rdf4j.repository.manager.RepositoryManager in project jopa by kbss-cvut.

the class StorageConnectorTest method connectorIsAbleToConnectToAlreadyInitializedLocalNativeStorage.

@Test
void connectorIsAbleToConnectToAlreadyInitializedLocalNativeStorage() throws Exception {
    final String repoId = "repositoryTest";
    final URI repoUri = Paths.get(getProjectRootPath() + File.separator + "repositories" + File.separator + repoId).toUri();
    this.repositoryFolder = new File(getProjectRootPath() + File.separator + "repositories");
    SailImplConfig backend = new NativeStoreConfig();
    final SailRepositoryConfig repoType = new SailRepositoryConfig(backend);
    final RepositoryConfig config = new RepositoryConfig(repoId, repoType);
    final RepositoryManager repoManager = RepositoryProvider.getRepositoryManagerOfRepository(repoUri.toString());
    repoManager.addRepositoryConfig(config);
    repoManager.getRepository(repoId);
    final StorageConnector connector = new StorageConnector(TestUtils.createDriverConfig(repoUri.toString()));
    assertTrue(connector.isOpen());
    connector.close();
}
Also used : SailImplConfig(org.eclipse.rdf4j.sail.config.SailImplConfig) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) RepositoryConfig(org.eclipse.rdf4j.repository.config.RepositoryConfig) NativeStoreConfig(org.eclipse.rdf4j.sail.nativerdf.config.NativeStoreConfig) RepositoryManager(org.eclipse.rdf4j.repository.manager.RepositoryManager) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) URI(java.net.URI) File(java.io.File) SailRepositoryConfig(org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig) Test(org.junit.jupiter.api.Test)

Aggregations

File (java.io.File)1 URI (java.net.URI)1 RepositoryConfig (org.eclipse.rdf4j.repository.config.RepositoryConfig)1 RepositoryManager (org.eclipse.rdf4j.repository.manager.RepositoryManager)1 SailRepositoryConfig (org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig)1 SailImplConfig (org.eclipse.rdf4j.sail.config.SailImplConfig)1 NativeStoreConfig (org.eclipse.rdf4j.sail.nativerdf.config.NativeStoreConfig)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Test (org.junit.jupiter.api.Test)1