xtern commented on code in PR #2674:
URL: https://github.com/apache/ignite-3/pull/2674#discussion_r1356612831


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursorImplTest.java:
##########
@@ -45,27 +58,26 @@
  * Tests for {@link AsyncSqlCursorImpl}.
  */
 public class AsyncSqlCursorImplTest {
-
     private static final ResultSetMetadata RESULT_SET_METADATA = new 
ResultSetMetadataImpl(Collections.emptyList());
+    private static final List<Integer> ROWS = IntStream.range(0, 
10).boxed().collect(Collectors.toList());
 
     /** Cursor should trigger commit of implicit transaction (if any) only if 
data is fully read. */
     @ParameterizedTest(name = "{0}")
     @MethodSource("transactions")
     public void testTriggerCommitAfterDataIsFullyRead(boolean implicit, 
QueryTransactionWrapper txWrapper) {
-        List<Integer> list = List.of(1, 2, 3);
 
         AsyncSqlCursorImpl<Integer> cursor = new 
AsyncSqlCursorImpl<>(SqlQueryType.QUERY, RESULT_SET_METADATA, txWrapper,
-                new 
AsyncWrapper<>(CompletableFuture.completedFuture(list.iterator()), 
Runnable::run));
+                new 
AsyncWrapper<>(CompletableFuture.completedFuture(ROWS.iterator()), 
Runnable::run));
 
         int requestRows = 2;
         BatchedResult<Integer> in1 = 
cursor.requestNextAsync(requestRows).join();
-        assertEquals(in1.items(), list.subList(0, requestRows));
+        assertEquals(ROWS.subList(0, requestRows), in1.items());

Review Comment:
   swapped args to (expected, result)



##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursorImplTest.java:
##########
@@ -45,27 +58,26 @@
  * Tests for {@link AsyncSqlCursorImpl}.
  */
 public class AsyncSqlCursorImplTest {
-
     private static final ResultSetMetadata RESULT_SET_METADATA = new 
ResultSetMetadataImpl(Collections.emptyList());
+    private static final List<Integer> ROWS = IntStream.range(0, 
10).boxed().collect(Collectors.toList());
 
     /** Cursor should trigger commit of implicit transaction (if any) only if 
data is fully read. */
     @ParameterizedTest(name = "{0}")
     @MethodSource("transactions")
     public void testTriggerCommitAfterDataIsFullyRead(boolean implicit, 
QueryTransactionWrapper txWrapper) {
-        List<Integer> list = List.of(1, 2, 3);
 
         AsyncSqlCursorImpl<Integer> cursor = new 
AsyncSqlCursorImpl<>(SqlQueryType.QUERY, RESULT_SET_METADATA, txWrapper,
-                new 
AsyncWrapper<>(CompletableFuture.completedFuture(list.iterator()), 
Runnable::run));
+                new 
AsyncWrapper<>(CompletableFuture.completedFuture(ROWS.iterator()), 
Runnable::run));
 
         int requestRows = 2;
         BatchedResult<Integer> in1 = 
cursor.requestNextAsync(requestRows).join();
-        assertEquals(in1.items(), list.subList(0, requestRows));
+        assertEquals(ROWS.subList(0, requestRows), in1.items());
 
         assertFalse(((NoOpTransaction) 
txWrapper.unwrap()).commitFuture().isDone(),
                 "Implicit transaction should have not been committed because 
there is more data.");
 
-        BatchedResult<Integer> in2 = 
cursor.requestNextAsync(requestRows).join();
-        assertEquals(in2.items(), list.subList(requestRows, list.size()));
+        BatchedResult<Integer> in2 = 
cursor.requestNextAsync(ROWS.size()).join();
+        assertEquals(ROWS.subList(requestRows, ROWS.size()), in2.items());

Review Comment:
   swapped args to (expected, result)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to