TransactionChainProxy extends AbstractTransactionContextFactory<LocalTransactionChain> implements DOMStoreTransactionChain { @Override public DOMStoreReadTransaction newReadOnlyTransaction() { currentState.checkReady(); TransactionProxy transactionProxy = new TransactionProxy(this, TransactionType.READ_ONLY); priorReadOnlyTxPromises.put(transactionProxy.getIdentifier(), Futures.<Object>promise()); return transactionProxy; } TransactionChainProxy(final TransactionContextFactory parent, final LocalHistoryIdentifier historyId); @Override DOMStoreReadTransaction newReadOnlyTransaction(); @Override DOMStoreReadWriteTransaction newReadWriteTransaction(); @Override DOMStoreWriteTransaction newWriteOnlyTransaction(); @Override void close();  }
@SuppressWarnings("resource") @Test public void testNewReadOnlyTransaction() { DOMStoreTransaction dst = new TransactionChainProxy(mockComponentFactory, historyId).newReadOnlyTransaction(); Assert.assertTrue(dst instanceof DOMStoreReadTransaction); }
@Test public void testRateLimitingNotUsedInReadOnlyTxCreation() { try (TransactionChainProxy txChainProxy = new TransactionChainProxy(mockComponentFactory, historyId)) { txChainProxy.newReadOnlyTransaction(); verify(mockActorContext, times(0)).acquireTxCreationPermit(); } }