PoolingStorageConnector extends AbstractConnector { @Override public void executeUpdate(String query) throws SesameDriverException { WRITE.lock(); try { centralConnector.executeUpdate(query); } finally { WRITE.unlock(); } } PoolingStorageConnector(StorageConnector centralConnector); @Override TupleQueryResult executeSelectQuery(String query); @Override boolean executeBooleanQuery(String query); @Override void executeUpdate(String query); @Override List<Resource> getContexts(); @Override ValueFactory getValueFactory(); @Override void begin(); @Override void commit(); @Override void rollback(); @Override void close(); @Override void addStatements(Collection<Statement> statements); @Override void removeStatements(Collection<Statement> statements); @Override Collection<Statement> findStatements(Resource subject, IRI property, Value value, boolean includeInferred); @Override Collection<Statement> findStatements(Resource subject, IRI property, Value value,
                                                boolean includeInferred, IRI context); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred, IRI context); @Override T unwrap(Class<T> cls);  }
@Test public void testExecuteUpdate() throws Exception { connector.begin(); final String query = "Some query"; connector.executeUpdate(query); InOrder inOrder = inOrder(writeLock, centralMock); inOrder.verify(writeLock).lock(); inOrder.verify(centralMock).executeUpdate(query); inOrder.verify(writeLock).unlock(); }