Small enhancement to ClusteringServicesIT 05/805/1
authorGiovanni Meo <gmeo@cisco.com>
Tue, 6 Aug 2013 14:14:11 +0000 (16:14 +0200)
committerGiovanni Meo <gmeo@cisco.com>
Tue, 6 Aug 2013 14:14:11 +0000 (16:14 +0200)
- Enhance the clusteringServicesIT to be able to cover the case of the
double update.

Change-Id: Ic28c760ec06dc21ace51bcffb5b79255a289fa1a
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
opendaylight/clustering/integrationtest/src/test/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusteringServicesIT.java

index 80f5558bcf853d91e03cf35ed95ceac3bb1419b0..e40454dea2259c085e07fe3db3e9800dfef1209a 100644 (file)
@@ -362,6 +362,25 @@ public class ClusteringServicesIT {
             assertTrue(up.value.equals("baz"));\r
             assertTrue(up.cacheName.equals(cache1));\r
 \r
+            /**********************************/\r
+            /* RE-UPDATE AN EXISTING KEY CASE */\r
+            /**********************************/\r
+            // Start monitoring the updates\r
+            res = listener.restart(1);\r
+            // modify the cache\r
+            cm11.put(k1, "baz");\r
+            // Wait\r
+            res.await(100L, TimeUnit.SECONDS);\r
+            // Analyze the updates\r
+            ups = listener.getUpdates();\r
+            assertTrue(ups.size() == 1);\r
+            // Validate we get an update with expect fields\r
+            up = ups.get(0);\r
+            assertTrue(up.t.equals(UpdateType.CHANGED));\r
+            assertTrue(up.key.equals(k1));\r
+            assertTrue(up.value.equals("baz"));\r
+            assertTrue(up.cacheName.equals(cache1));\r
+\r
             /********************************/\r
             /* REMOVAL OF EXISTING KEY CASE */\r
             /********************************/\r