ClientBackedTransactionChain implements DOMStoreTransactionChain { @Override public synchronized void close() { final List<TransactionIdentifier> abortedSnapshots = new ArrayList<>(); for (AbstractClientHandle<?> snap : openSnapshots.keySet()) { final TransactionIdentifier id = snap.getIdentifier(); LOG.debug("Aborting recorded transaction {}", id); if (snap.abort()) { abortedSnapshots.add(id); } } openSnapshots.clear(); if (!abortedSnapshots.isEmpty()) { LOG.warn("Aborted unclosed transactions {}", abortedSnapshots, new Throwable("at")); } history.close(); } ClientBackedTransactionChain(final ClientLocalHistory history, final boolean debugAllocation); @Override DOMStoreReadTransaction newReadOnlyTransaction(); @Override DOMStoreReadWriteTransaction newReadWriteTransaction(); @Override DOMStoreWriteTransaction newWriteOnlyTransaction(); @Override synchronized void close();  }
@Test public void testClose() { chain.newReadOnlyTransaction(); chain.close(); Mockito.verify(snapshot).abort(); Mockito.verify(history).close(); }