Skip to content

Commit

Permalink
TEST: fix testcase in PipedBulkInsertSetWithAttrTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 committed Jun 28, 2023
1 parent 9672dca commit a77c2d6
Showing 1 changed file with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -61,7 +62,7 @@ public void testInsertWithAttribute() {
}

Map<Integer, CollectionOperationStatus> insertResult = mc
.asyncLopPipedInsertBulk(KEY, INDEX, valueList, attr).get();
.asyncSopPipedInsertBulk(KEY, valueList, attr).get();
Assert.assertTrue(insertResult.isEmpty());

// check attribute
Expand All @@ -72,10 +73,8 @@ public void testInsertWithAttribute() {
Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount());

// check values
List<Object> 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<Object> 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);
Expand All @@ -101,7 +100,7 @@ public void testInsertWithDefaultAttribute() {
}

Map<Integer, CollectionOperationStatus> insertResult = mc
.asyncLopPipedInsertBulk(KEY, INDEX, valueList, attr).get();
.asyncSopPipedInsertBulk(KEY, valueList, attr).get();
Assert.assertTrue(insertResult.isEmpty());

// check attribute
Expand All @@ -112,10 +111,8 @@ public void testInsertWithDefaultAttribute() {
Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount());

// check values
List<Object> 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<Object> set = mc.asyncSopGet(KEY, 0, false, false).get();
Assert.assertEquals(valueList.size(), set.size());
} catch (Exception e) {
e.printStackTrace();
Assert.fail(e.getMessage());
Expand All @@ -133,7 +130,7 @@ public void testInsertWithoutAttributeCreate() {
}

Map<Integer, CollectionOperationStatus> insertResult = mc
.asyncLopPipedInsertBulk(KEY, INDEX, valueList,
.asyncSopPipedInsertBulk(KEY, valueList,
new CollectionAttributes()).get();
Assert.assertTrue(insertResult.isEmpty());

Expand All @@ -145,10 +142,8 @@ public void testInsertWithoutAttributeCreate() {
Assert.assertEquals(Long.valueOf(10), collectionAttributes.getCount());

// check values
List<Object> 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<Object> set = mc.asyncSopGet(KEY, 0, false, false).get();
Assert.assertEquals(valueList.size(), set.size());
} catch (Exception e) {
e.printStackTrace();
Assert.fail(e.getMessage());
Expand Down

0 comments on commit a77c2d6

Please sign in to comment.