From a77c2d6a56016152b0d64ae2c652b2d0e9caaf38 Mon Sep 17 00:00:00 2001 From: brido4125 Date: Wed, 28 Jun 2023 15:33:19 +0900 Subject: [PATCH] TEST: fix testcase in PipedBulkInsertSetWithAttrTest. --- .../PipedBulkInsertSetWithAttrTest.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/test/manual/net/spy/memcached/emptycollection/PipedBulkInsertSetWithAttrTest.java b/src/test/manual/net/spy/memcached/emptycollection/PipedBulkInsertSetWithAttrTest.java index c78ab719c..693fe37d0 100644 --- a/src/test/manual/net/spy/memcached/emptycollection/PipedBulkInsertSetWithAttrTest.java +++ b/src/test/manual/net/spy/memcached/emptycollection/PipedBulkInsertSetWithAttrTest.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; import net.spy.memcached.collection.BaseIntegrationTest; import net.spy.memcached.collection.CollectionAttributes; @@ -61,7 +62,7 @@ public void testInsertWithAttribute() { } Map insertResult = mc - .asyncLopPipedInsertBulk(KEY, INDEX, valueList, attr).get(); + .asyncSopPipedInsertBulk(KEY, valueList, attr).get(); Assert.assertTrue(insertResult.isEmpty()); // check attribute @@ -72,10 +73,8 @@ public void testInsertWithAttribute() { Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount()); // check values - List list2 = mc.asyncLopGet(KEY, 0, 10, false, false).get(); - for (int i = 0; i < list2.size(); i++) { - Assert.assertEquals(10 - i, list2.get(i)); - } + Set set = mc.asyncSopGet(KEY, 0, false, false).get(); + Assert.assertEquals(valueList.size(), set.size()); // check expire time Thread.sleep(EXPIRE_TIME_IN_SEC * 1000L + 1000L); @@ -101,7 +100,7 @@ public void testInsertWithDefaultAttribute() { } Map insertResult = mc - .asyncLopPipedInsertBulk(KEY, INDEX, valueList, attr).get(); + .asyncSopPipedInsertBulk(KEY, valueList, attr).get(); Assert.assertTrue(insertResult.isEmpty()); // check attribute @@ -112,10 +111,8 @@ public void testInsertWithDefaultAttribute() { Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount()); // check values - List list2 = mc.asyncLopGet(KEY, 0, 10, false, false).get(); - for (int i = 0; i < list2.size(); i++) { - Assert.assertEquals(10 - i, list2.get(i)); - } + Set set = mc.asyncSopGet(KEY, 0, false, false).get(); + Assert.assertEquals(valueList.size(), set.size()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); @@ -133,7 +130,7 @@ public void testInsertWithoutAttributeCreate() { } Map insertResult = mc - .asyncLopPipedInsertBulk(KEY, INDEX, valueList, + .asyncSopPipedInsertBulk(KEY, valueList, new CollectionAttributes()).get(); Assert.assertTrue(insertResult.isEmpty()); @@ -145,10 +142,8 @@ public void testInsertWithoutAttributeCreate() { Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount()); // check values - List list2 = mc.asyncLopGet(KEY, 0, 10, false, false).get(); - for (int i = 0; i < list2.size(); i++) { - Assert.assertEquals(10 - i, list2.get(i)); - } + Set set = mc.asyncSopGet(KEY, 0, false, false).get(); + Assert.assertEquals(valueList.size(), set.size()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage());