Keep DataChange registrations and notifications local
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / utils / MockActorContext.java
index 12f80fb906a37eab9c0ad9da3cc1389665196fb1..5d3853f311880d791fc177c9a1082f026fb1c5de 100644 (file)
@@ -19,13 +19,14 @@ public class MockActorContext extends ActorContext {
     private Object executeShardOperationResponse;
     private Object executeRemoteOperationResponse;
     private Object executeLocalOperationResponse;
+    private Object executeLocalShardOperationResponse;
 
     public MockActorContext(ActorSystem actorSystem) {
-        super(actorSystem, null, new MockConfiguration());
+        super(actorSystem, null, new MockClusterWrapper(), new MockConfiguration());
     }
 
     public MockActorContext(ActorSystem actorSystem, ActorRef shardManager) {
-        super(actorSystem, shardManager, new MockConfiguration());
+        super(actorSystem, shardManager, new MockClusterWrapper(), new MockConfiguration());
     }
 
 
@@ -55,4 +56,19 @@ public class MockActorContext extends ActorContext {
         Object executeLocalOperationResponse) {
         this.executeLocalOperationResponse = executeLocalOperationResponse;
     }
+
+    public void setExecuteLocalShardOperationResponse(
+        Object executeLocalShardOperationResponse) {
+        this.executeLocalShardOperationResponse = executeLocalShardOperationResponse;
+    }
+
+    @Override public Object executeLocalOperation(ActorRef actor,
+        Object message, FiniteDuration duration) {
+        return this.executeLocalOperationResponse;
+    }
+
+    @Override public Object executeLocalShardOperation(String shardName,
+        Object message, FiniteDuration duration) {
+        return this.executeLocalShardOperationResponse;
+    }
 }