OwlapiDataSource implements ReloadableDataSource { @Override public synchronized Connection getConnection() throws OntoDriverException { ensureOpen(); if (storageProperties == null) { throw new IllegalStateException("OntoDriver is not properly initialized. Cannot acquire connection."); } if (!connected) { connect(); } return driver.acquireConnection(); }  @Override synchronized Connection getConnection(); @Override void setStorageProperties(OntologyStorageProperties storageProperties); @Override void setProperties(Map<String, String> properties); @Override synchronized void reload(); @Override synchronized void close(); @Override boolean isOpen();  }
@Test public void testGetConnection() throws Exception { final File output = new File( System.getProperty("java.io.tmpdir") + File.separator + "datasource_" + System.currentTimeMillis() + ".owl"); output.deleteOnExit(); final OntologyStorageProperties p = OntologyStorageProperties.ontologyUri(URI.create("http: .physicalUri(output.toURI()) .driver(OwlapiDataSource.class.getCanonicalName()) .build(); dataSource.setStorageProperties(p); final Connection connection = dataSource.getConnection(); assertNotNull(connection); }