From e1611ae8f35ec698512810ae1cba70853b684912 Mon Sep 17 00:00:00 2001 From: Guian Gumpac Date: Thu, 13 Jun 2024 12:09:59 -0700 Subject: [PATCH] Added crossSlot test --- .../test/java/glide/cluster/ClusterTransactionTests.java | 8 ++++---- .../src/test/java/glide/cluster/CommandTests.java | 3 ++- .../src/test/java/glide/standalone/TransactionTests.java | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java index 981d0e1165..4acecfea6f 100644 --- a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java +++ b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java @@ -189,7 +189,7 @@ public void watch() { assertEquals(OK, clusterClient.watch(keys).get()); assertEquals(OK, clusterClient.set(key2, helloString).get()); setFoobarTransaction.set(key1, foobarString).set(key2, foobarString).set(key3, foobarString); - assertEquals(null, clusterClient.exec(setFoobarTransaction).get()); + assertEquals(null, clusterClient.exec(setFoobarTransaction).get()); // Sanity check assertEquals(null, clusterClient.get(key1).get()); assertEquals(helloString, clusterClient.get(key2).get()); assertEquals(null, clusterClient.get(key3).get()); @@ -199,14 +199,14 @@ public void watch() { assertEquals(OK, clusterClient.watch(keys).get()); assertEquals(helloString, clusterClient.get(key2).get()); assertArrayEquals(expectedExecResponse, clusterClient.exec(setFoobarTransaction).get()); - assertEquals(foobarString, clusterClient.get(key1).get()); + assertEquals(foobarString, clusterClient.get(key1).get()); // Sanity check assertEquals(foobarString, clusterClient.get(key2).get()); assertEquals(foobarString, clusterClient.get(key3).get()); // Transaction executes command successfully with unmodified watched keys assertEquals(OK, clusterClient.watch(keys).get()); assertArrayEquals(expectedExecResponse, clusterClient.exec(setFoobarTransaction).get()); - assertEquals(foobarString, clusterClient.get(key1).get()); + assertEquals(foobarString, clusterClient.get(key1).get()); // Sanity check assertEquals(foobarString, clusterClient.get(key2).get()); assertEquals(foobarString, clusterClient.get(key3).get()); @@ -215,7 +215,7 @@ public void watch() { assertEquals(OK, clusterClient.watch(new String[] {key4}).get()); setHelloTransaction.set(key1, helloString).set(key2, helloString).set(key3, helloString); assertArrayEquals(expectedExecResponse, clusterClient.exec(setHelloTransaction).get()); - assertEquals(helloString, clusterClient.get(key1).get()); + assertEquals(helloString, clusterClient.get(key1).get()); // Sanity check assertEquals(helloString, clusterClient.get(key2).get()); assertEquals(helloString, clusterClient.get(key3).get()); diff --git a/java/integTest/src/test/java/glide/cluster/CommandTests.java b/java/integTest/src/test/java/glide/cluster/CommandTests.java index 1ef67f178d..f318f80e12 100644 --- a/java/integTest/src/test/java/glide/cluster/CommandTests.java +++ b/java/integTest/src/test/java/glide/cluster/CommandTests.java @@ -783,7 +783,8 @@ public static Stream callCrossSlotCommandsWhichShouldPass() { Arguments.of("del", clusterClient.del(new String[] {"abc", "zxy", "lkn"})), Arguments.of("mget", clusterClient.mget(new String[] {"abc", "zxy", "lkn"})), Arguments.of("mset", clusterClient.mset(Map.of("abc", "1", "zxy", "2", "lkn", "3"))), - Arguments.of("touch", clusterClient.touch(new String[] {"abc", "zxy", "lkn"}))); + Arguments.of("touch", clusterClient.touch(new String[] {"abc", "zxy", "lkn"})), + Arguments.of("watch", clusterClient.watch(new String[] {"ghi", "zxy", "lkn"}))); } @SneakyThrows diff --git a/java/integTest/src/test/java/glide/standalone/TransactionTests.java b/java/integTest/src/test/java/glide/standalone/TransactionTests.java index b7c6a74b51..0e50a98481 100644 --- a/java/integTest/src/test/java/glide/standalone/TransactionTests.java +++ b/java/integTest/src/test/java/glide/standalone/TransactionTests.java @@ -278,7 +278,7 @@ public void watch() { assertEquals(OK, client.set(key2, helloString).get()); setFoobarTransaction.set(key1, foobarString).set(key2, foobarString).set(key3, foobarString); assertEquals(null, client.exec(setFoobarTransaction).get()); - assertEquals(null, client.get(key1).get()); + assertEquals(null, client.get(key1).get()); // Sanity check assertEquals(helloString, client.get(key2).get()); assertEquals(null, client.get(key3).get()); @@ -287,14 +287,14 @@ public void watch() { assertEquals(OK, client.watch(keys).get()); assertEquals(helloString, client.get(key2).get()); assertArrayEquals(expectedExecResponse, client.exec(setFoobarTransaction).get()); - assertEquals(foobarString, client.get(key1).get()); + assertEquals(foobarString, client.get(key1).get()); // Sanity check assertEquals(foobarString, client.get(key2).get()); assertEquals(foobarString, client.get(key3).get()); // Transaction executes command successfully with unmodified watched keys assertEquals(OK, client.watch(keys).get()); assertArrayEquals(expectedExecResponse, client.exec(setFoobarTransaction).get()); - assertEquals(foobarString, client.get(key1).get()); + assertEquals(foobarString, client.get(key1).get()); // Sanity check assertEquals(foobarString, client.get(key2).get()); assertEquals(foobarString, client.get(key3).get()); @@ -303,7 +303,7 @@ public void watch() { assertEquals(OK, client.watch(new String[] {key4}).get()); setHelloTransaction.set(key1, helloString).set(key2, helloString).set(key3, helloString); assertArrayEquals(expectedExecResponse, client.exec(setHelloTransaction).get()); - assertEquals(helloString, client.get(key1).get()); + assertEquals(helloString, client.get(key1).get()); // Sanity check assertEquals(helloString, client.get(key2).get()); assertEquals(helloString, client.get(key3).get());