[ONOS-5170] GroupStore: add purgeGroupEntries
The GroupStore exposes purgeGroupEntry, which purges
from the store by a specific device.
Add purgeGroupEntries, to purge entries from all devices
from the GroupStore, and expose purgeGroupEntries to allow
applications to purge all group entries from the GroupStore
without specifying a device.
Change-Id: I735f011a1fbbfa3ce8f1dd57a591a81c4377b012
diff --git a/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java b/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
index 288d8de..a3ca1ec 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
@@ -236,6 +236,10 @@
groupStore.purgeGroupEntry(deviceId2);
assertThat(groupStore.getGroupCount(deviceId1), is(1));
assertThat(groupStore.getGroupCount(deviceId2), is(0));
+
+ groupStore.purgeGroupEntries();
+ assertThat(groupStore.getGroupCount(deviceId1), is(0));
+ assertThat(groupStore.getGroupCount(deviceId2), is(0));
}
/**