You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2023/02/14 09:36:28 UTC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1652: IGNITE-18717 Fix parallel read and delete RowVersion for PageMemoryMvPartitionStorage

tkalkirill commented on code in PR #1652:
URL: https://github.com/apache/ignite-3/pull/1652#discussion_r1105533296


##########
modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java:
##########
@@ -2367,6 +2372,138 @@ void testFindNext() throws Exception {
         assertEquals(0L, tree.findNext(-1L, true));
     }
 
+    @Test
+    void testFindOneWithMapper() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        tree.put(0L);
+
+        assertEquals("row0", tree.findOne(0L, row -> "row" + row));
+        assertEquals("rownull", tree.findOne(1L, row -> "row" + row));
+    }
+
+    @Test
+    void testFindWithMapper() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        tree.put(0L);
+        tree.put(1L);
+
+        PeekTreeRowCursor<Long, String> cursor = tree.find(null, null, row -> "row" + row);
+
+        assertNull(cursor.peek());
+
+        assertTrue(cursor.hasNext());
+        assertEquals(0L, cursor.peek());
+        assertEquals("row0", cursor.next());
+
+        assertTrue(cursor.hasNext());
+        assertEquals(1L, cursor.peek());
+        assertEquals("row1", cursor.next());
+
+        assertFalse(cursor.hasNext());
+        assertNull(cursor.peek());
+        assertThrows(NoSuchElementException.class, cursor::next);
+    }
+
+    @Test
+    void testInvokeClosureWithOnUpdateCallbackForPut() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        // Checks insert.
+        CompletableFuture<Void> future0 = new CompletableFuture<>();

Review Comment:
   I'll use mokito, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org