use of org.opendaylight.mdsal.dom.broker.ShardedDOMDataTree in project controller by opendaylight.
the class DistributedShardFrontendTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
shardedDOMDataTree = new ShardedDOMDataTree();
client = mock(DataStoreClient.class);
cursor = mock(DOMDataTreeWriteCursor.class);
clientTransaction = mock(ClientTransaction.class);
clientHistory = mock(ClientLocalHistory.class);
commitCohort = mock(DOMStoreThreePhaseCommitCohort.class);
doReturn(SUCCESS_FUTURE).when(commitCohort).canCommit();
doReturn(SUCCESS_FUTURE).when(commitCohort).preCommit();
doReturn(SUCCESS_FUTURE).when(commitCohort).commit();
doReturn(SUCCESS_FUTURE).when(commitCohort).abort();
doReturn(clientTransaction).when(client).createTransaction();
doReturn(clientTransaction).when(clientHistory).createTransaction();
doNothing().when(clientHistory).close();
doNothing().when(client).close();
doReturn(clientHistory).when(client).createLocalHistory();
doReturn(cursor).when(clientTransaction).openCursor();
doNothing().when(cursor).close();
doNothing().when(cursor).write(any(), any());
doNothing().when(cursor).merge(any(), any());
doNothing().when(cursor).delete(any());
doReturn(commitCohort).when(clientTransaction).ready();
}
Aggregations