Bug 6540: EOS - handle edge case with pruning pending owner change commits
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / entityownership / AbstractEntityOwnershipTest.java
index 23b5563a3297acc4d91f05d06cbd6237e49fa172..eb797eebd1afebe6143a094ba2e0b7f0130d7ba2 100644 (file)
@@ -246,6 +246,20 @@ public class AbstractEntityOwnershipTest extends AbstractActorTest {
         });
     }
 
+    static void verifyNoOwnerSet(TestActorRef<? extends EntityOwnershipShard> shard, String entityType,
+            YangInstanceIdentifier entityId) {
+        YangInstanceIdentifier entityPath = entityPath(entityType, entityId).node(ENTITY_OWNER_QNAME);
+        try {
+            NormalizedNode<?, ?> node = AbstractShardTest.readStore(shard, entityPath);
+            if(node != null) {
+                Assert.fail("Owner " + node.getValue() + " was set for " + entityPath);
+            }
+
+        } catch (Exception e) {
+            throw new AssertionError("read failed", e);
+        }
+    }
+
     static void verifyRaftState(final TestActorRef<? extends EntityOwnershipShard> shard, Consumer<OnDemandRaftState> verifier)
             throws Exception {
         AssertionError lastError = null;