@Override protected void shutDownInternal() throws SailException { if (_store != null) { _store.close(); } } }
@Override protected void shutDownInternal() throws SailException { if (_store != null) { _store.close(); } } }
/** * Shutdown repository and store. * * @throws Exception mmm...hopefully never otherwise tests will fail. */ @AfterClass public static void shutdown() throws Exception { if (REPOSITORY != null) { REPOSITORY.shutDown(); } if (SAIL != null) { SAIL.shutDown(); } if (TRIPLE_STORE != null) { TRIPLE_STORE.close(); } if (QUAD_STORE != null) { QUAD_STORE.close(); } }
} finally { try { store.close(); } catch (Exception exception) { _log.error(MessageCatalog._00012_CUMULUS_SYSTEM_INTERNAL_FAILURE, exception);
} finally { try { store.close(); } catch (Exception exception) { _log.error(MessageCatalog._00012_CUMULUS_SYSTEM_INTERNAL_FAILURE, exception);
/** * Shutdown repository and store. * * @throws Exception mmm...hopefully never otherwise tests will fail. */ @AfterClass public static void shutdown() throws Exception { if (_repository != null) { _repository.shutDown(); } if (_sail != null) { _sail.shutDown(); } if (_tripleStore != null) { if (_tripleStore.isOpen()) { _tripleStore.clear(); } _tripleStore.close(); } if (_quadStore != null) { if (_quadStore.isOpen()) { _quadStore.clear(); } _quadStore.close(); } }
/** * Test if the quad store works with large iterators. * * @throws Exception If something bad happens... */ @Test public void testLargeQuadOperations() throws Exception { _quadStore = newQuadStore(); _quadStore.open(); try { Random random = new Random(4986723946726L); List<Statement> statements = randomStatements(random, (int) (1000 * 3.1415)); InputStream statementStream = statementIteratorToRdfStream(statements.iterator(), RDFFormat.NQUADS); _quadStore.bulkLoad(statementStream, RDFFormat.NQUADS); assertEquals( "Store contains different amount of quads than inserted!", statements.size(), numOfRes(_quadStore.query(SELECT_ALL_QUADS_PATTERN))); _quadStore.removeData(_quadStore.query(SELECT_ALL_QUADS_PATTERN)); assertEquals( "Store should be empty after deleting everything!", 0, numOfRes(_quadStore.query(SELECT_ALL_QUADS_PATTERN))); } finally { _quadStore.close(); } }
/** * Test if the triple store works with large iterators. * * @throws Exception If something bad happens... */ @Test public void testLargeTripleOperations() throws Exception { _tripleStore = newTripleStore(); _tripleStore.open(); try { Random random = new Random(452662401L); List<Statement> statements = randomStatements(random, (int) (1000 * 3.1415)); InputStream statementStream = statementIteratorToRdfStream(statements.iterator(), RDFFormat.NTRIPLES); _tripleStore.bulkLoad(statementStream, RDFFormat.NTRIPLES); assertEquals("Store contains different amount of triples than inserted!", statements.size(), numOfRes(_tripleStore.query(SELECT_ALL_TRIPLES_PATTERN))); _tripleStore.removeData(_tripleStore.query(SELECT_ALL_QUADS_PATTERN)); assertEquals( "Store should be empty after deleting everything!", 0, numOfRes(_tripleStore.query(SELECT_ALL_QUADS_PATTERN))); } finally { _tripleStore.close(); } } }