- protected InMemoryDOMDataStore store;
-
- @Before
- public void setUp(){
- store = new InMemoryDOMDataStore("test", MoreExecutors.sameThreadExecutor(),
- MoreExecutors.sameThreadExecutor());
- store.onGlobalContextUpdated(TestModel.createTestContext());
- }
-
- protected void commitTransaction(DOMStoreWriteTransaction transaction){
- DOMStoreThreePhaseCommitCohort cohort = transaction.ready();
- cohort.preCommit();
- cohort.commit();
- }
-
- protected Optional<NormalizedNode<?,?>> readData(YangInstanceIdentifier path) throws Exception{
- DOMStoreReadTransaction transaction = store.newReadOnlyTransaction();
- ListenableFuture<Optional<NormalizedNode<?, ?>>> future = transaction.read(path);
- return future.get();
- }
+ protected Optional<NormalizedNode> readData(final YangInstanceIdentifier path) throws Exception {
+ // FIXME: close the transaction
+ DOMStoreReadTransaction transaction = store.newReadOnlyTransaction();
+ ListenableFuture<Optional<NormalizedNode>> future = transaction.read(path);
+ return future.get();
+ }