Adjust to mdsal DOM read/exists FluentFuture change
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / modification / AbstractModificationTest.java
index d02f78dc860210c5fad0e6bb0836bfa12ac53226..9daa3429fd32096d5d840068ece2e8089761005b 100644 (file)
@@ -8,37 +8,37 @@
 
 package org.opendaylight.controller.cluster.datastore.modification;
 
-import com.google.common.base.Optional;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+import java.util.Optional;
 import org.junit.Before;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 public abstract class AbstractModificationTest {
 
-  protected InMemoryDOMDataStore store;
+    protected InMemoryDOMDataStore store;
 
-  @Before
-  public void setUp(){
-    store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService());
-    store.onGlobalContextUpdated(TestModel.createTestContext());
-  }
+    @Before
+    public void setUp() {
+        store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService());
+        store.onGlobalContextUpdated(TestModel.createTestContext());
+    }
 
-  protected void commitTransaction(final DOMStoreWriteTransaction transaction){
-    DOMStoreThreePhaseCommitCohort cohort = transaction.ready();
-    cohort.preCommit();
-    cohort.commit();
-  }
+    protected void commitTransaction(final DOMStoreWriteTransaction transaction) {
+        DOMStoreThreePhaseCommitCohort cohort = transaction.ready();
+        cohort.preCommit();
+        cohort.commit();
+    }
 
-  protected Optional<NormalizedNode<?,?>> readData(final 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 {
+        DOMStoreReadTransaction transaction = store.newReadOnlyTransaction();
+        ListenableFuture<Optional<NormalizedNode<?, ?>>> future = transaction.read(path);
+        return future.get();
+    }
 }