Bug 2187: Implement add-shard-replica RPC
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / IntegrationTestKit.java
index 40d123e..9cc6d83 100644 (file)
@@ -35,14 +35,18 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public class IntegrationTestKit extends ShardTestKit {
 
-    DatastoreContext.Builder datastoreContextBuilder;
-    DatastoreSnapshot restoreFromSnapshot;
+    protected DatastoreContext.Builder datastoreContextBuilder;
+    protected DatastoreSnapshot restoreFromSnapshot;
 
     public IntegrationTestKit(ActorSystem actorSystem, Builder datastoreContextBuilder) {
         super(actorSystem);
         this.datastoreContextBuilder = datastoreContextBuilder;
     }
 
+    public DatastoreContext.Builder getDatastoreContextBuilder() {
+        return datastoreContextBuilder;
+    }
+
     public DistributedDataStore setupDistributedDataStore(String typeName, String... shardNames) {
         return setupDistributedDataStore(typeName, "module-shards.conf", true, SchemaContextHelper.full(), shardNames);
     }
@@ -80,6 +84,7 @@ public class IntegrationTestKit extends ShardTestKit {
             waitUntilLeader(dataStore.getActorContext(), shardNames);
         }
 
+        datastoreContextBuilder = DatastoreContext.newBuilderFrom(datastoreContext);
         return dataStore;
     }
 
@@ -143,7 +148,7 @@ public class IntegrationTestKit extends ShardTestKit {
         assertEquals("Data node", nodeToWrite, optional.get());
     }
 
-    void doCommit(final DOMStoreThreePhaseCommitCohort cohort) throws Exception {
+    public void doCommit(final DOMStoreThreePhaseCommitCohort cohort) throws Exception {
         Boolean canCommit = cohort.canCommit().get(7, TimeUnit.SECONDS);
         assertEquals("canCommit", true, canCommit);
         cohort.preCommit().get(5, TimeUnit.SECONDS);