TransactionProxy extends AbstractDOMStoreTransaction<TransactionIdentifier> implements DOMStoreReadWriteTransaction { @Override public void delete(final YangInstanceIdentifier path) { checkModificationState("delete", path); if (path.isEmpty()) { deleteAllData(); } else { executeModification(new DeleteOperation(path)); } } @VisibleForTesting  TransactionProxy(final AbstractTransactionContextFactory<?> txContextFactory, final TransactionType type); @Override FluentFuture<Boolean> exists(final YangInstanceIdentifier path); @Override FluentFuture<Optional<NormalizedNode<?, ?>>> read(final YangInstanceIdentifier path); @Override void delete(final YangInstanceIdentifier path); @Override void merge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @Override void write(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @Override final void close(); @Override final AbstractThreePhaseCommitCohort<?> ready();  }
@Test public void testDelete() { dataStoreContextBuilder.shardBatchedModificationCount(1); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); expectBatchedModifications(actorRef, 1); TransactionProxy transactionProxy = new TransactionProxy(mockComponentFactory, WRITE_ONLY); transactionProxy.delete(TestModel.TEST_PATH); verifyOneBatchedModification(actorRef, new DeleteModification(TestModel.TEST_PATH), false); }
@Test public void testDeleteThrottlingWhenShardFound() { throttleOperation(transactionProxy -> { expectIncompleteBatchedModifications(); transactionProxy.delete(TestModel.TEST_PATH); transactionProxy.delete(TestModel.TEST_PATH); }); }
@Test public void testDeleteThrottlingWhenShardNotFound() { completeOperation(transactionProxy -> { expectBatchedModifications(2); transactionProxy.delete(TestModel.TEST_PATH); transactionProxy.delete(TestModel.TEST_PATH); }, false); }
@Test public void testDeleteCompletionForLocalShard() { completeOperationLocal(transactionProxy -> { transactionProxy.delete(TestModel.TEST_PATH); transactionProxy.delete(TestModel.TEST_PATH); }, createDataTree()); }
@Test public void testDeleteCompletion() { completeOperation(transactionProxy -> { expectBatchedModifications(2); transactionProxy.delete(TestModel.TEST_PATH); transactionProxy.delete(TestModel.TEST_PATH); }); }