use of org.opendaylight.controller.cluster.datastore.DataTreeCohortActor.CanCommit in project controller by opendaylight.
the class DataTreeCohortActorTest method testAbortAfterCanCommit.
@Test
public void testAbortAfterCanCommit() throws Exception {
ActorRef cohortActor = newCohortActor("testAbortAfterCanCommit");
TransactionIdentifier txId = nextTransactionId();
askAndAwait(cohortActor, new CanCommit(txId, CANDIDATES, MOCK_SCHEMA, cohortActor));
verify(mockCohort).canCommit(txId, CANDIDATES, MOCK_SCHEMA);
askAndAwait(cohortActor, new Abort(txId));
verify(mockPostCanCommit).abort();
resetMockCohort();
askAndAwait(cohortActor, new CanCommit(txId, CANDIDATES, MOCK_SCHEMA, cohortActor));
verify(mockCohort).canCommit(txId, CANDIDATES, MOCK_SCHEMA);
}
use of org.opendaylight.controller.cluster.datastore.DataTreeCohortActor.CanCommit in project controller by opendaylight.
the class DataTreeCohortActorTest method testAbortAfterPreCommit.
@Test
public void testAbortAfterPreCommit() throws Exception {
ActorRef cohortActor = newCohortActor("testAbortAfterPreCommit");
TransactionIdentifier txId = nextTransactionId();
askAndAwait(cohortActor, new CanCommit(txId, CANDIDATES, MOCK_SCHEMA, cohortActor));
verify(mockCohort).canCommit(txId, CANDIDATES, MOCK_SCHEMA);
askAndAwait(cohortActor, new PreCommit(txId));
verify(mockPostCanCommit).preCommit();
askAndAwait(cohortActor, new Abort(txId));
verify(mockPostPreCommit).abort();
}
Aggregations