@Test public void abortTest() throws Exception { doReturn(DATA_TREE_CANDIDATE).when(IN_MEMORY_DOM_DATA_STORE).prepare(any()); doReturn("testDataTreeCandidate").when(DATA_TREE_CANDIDATE).toString(); final Field candidateField = InMemoryDOMStoreThreePhaseCommitCohort.class.getDeclaredField("candidate"); candidateField.setAccessible(true); inMemoryDOMStoreThreePhaseCommitCohort.preCommit(); DataTreeCandidate candidate = (DataTreeCandidate) candidateField.get(inMemoryDOMStoreThreePhaseCommitCohort); assertNotNull(candidate); inMemoryDOMStoreThreePhaseCommitCohort.abort(); candidate = (DataTreeCandidate) candidateField.get(inMemoryDOMStoreThreePhaseCommitCohort); assertNull(candidate); }
@Override public final ListenableFuture<Void> abort() { candidate = null; return SUCCESSFUL_FUTURE; }
InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { @Override public final ListenableFuture<Void> abort() { candidate = null; return SUCCESSFUL_FUTURE; } }
InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { @Override public final ListenableFuture<Void> abort() { candidate = null; return SUCCESSFUL_FUTURE; } InMemoryDOMStoreThreePhaseCommitCohort(final InMemoryDOMDataStore store,
                                           final SnapshotBackedWriteTransaction<String> writeTransaction,
                                           final DataTreeModification modification,
                                           final Exception operationError); }
InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { @Override public final ListenableFuture<Void> abort() { candidate = null; return SUCCESSFUL_FUTURE; } InMemoryDOMStoreThreePhaseCommitCohort(final InMemoryDOMDataStore store,
                                           final SnapshotBackedWriteTransaction<String> writeTransaction,
                                           final DataTreeModification modification,
                                           final Exception operationError); @SuppressWarnings("checkstyle:IllegalCatch") @Override final ListenableFuture<Boolean> canCommit(); @SuppressWarnings("checkstyle:IllegalCatch") @Override final ListenableFuture<Void> preCommit(); @Override final ListenableFuture<Void> abort(); @Override ListenableFuture<Void> commit(); }
InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { @Override public final ListenableFuture<Void> abort() { candidate = null; return SUCCESSFUL_FUTURE; } InMemoryDOMStoreThreePhaseCommitCohort(final InMemoryDOMDataStore store,
                                           final SnapshotBackedWriteTransaction<String> writeTransaction,
                                           final DataTreeModification modification,
                                           final Exception operationError); @SuppressWarnings("checkstyle:IllegalCatch") @Override final ListenableFuture<Boolean> canCommit(); @SuppressWarnings("checkstyle:IllegalCatch") @Override final ListenableFuture<Void> preCommit(); @Override final ListenableFuture<Void> abort(); @Override ListenableFuture<Void> commit();  }