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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlMultiStatementTest.java:
##########
@@ -24,86 +24,77 @@
 import static org.apache.ignite.lang.ErrorGroups.Sql.RUNTIME_ERR;
 import static org.apache.ignite.lang.ErrorGroups.Sql.STMT_VALIDATION_ERR;
 import static 
org.apache.ignite.lang.ErrorGroups.Transactions.TX_FAILED_READ_WRITE_OPERATION_ERR;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.concurrent.CompletableFuture;
-import org.apache.ignite.internal.sql.BaseSqlIntegrationTest;
-import org.apache.ignite.internal.sql.engine.property.SqlPropertiesHelper;
+import org.apache.ignite.internal.sql.BaseSqlMultiStatementTest;
 import org.apache.ignite.internal.tx.InternalTransaction;
-import org.apache.ignite.internal.util.AsyncCursor.BatchedResult;
 import org.apache.ignite.tx.Transaction;
-import org.jetbrains.annotations.Nullable;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 
 /**
  * Tests to verify the execution of queries with multiple statements.
  */
 @SuppressWarnings("ThrowableNotThrown")
-public class ItSqlMultiStatementTest extends BaseSqlIntegrationTest {
+public class ItSqlMultiStatementTest extends BaseSqlMultiStatementTest {
     @AfterEach
     void dropTables() {
         dropAllTables();
     }
 
-    @AfterEach
-    void checkNoPendingTransactions() {
-        assertEquals(0, txManager().pending());
-    }
-
     @Test
     void basicMultiStatementQuery() {
         String sql = "CREATE TABLE test (id INT PRIMARY KEY, val INT);"
                 + "INSERT INTO test VALUES (0, 0);"
+                + "UPDATE test SET val=1 where id=0;"
                 + "EXPLAIN PLAN FOR SELECT * FROM test;"
-                + "SELECT * FROM test";
+                + "SELECT * FROM test;"
+                + "DELETE FROM test";
 
         List<AsyncSqlCursor<List<Object>>> cursors = 
fetchAllCursors(runScript(sql));
-        assertNotNull(cursors);
-
         Iterator<AsyncSqlCursor<List<Object>>> curItr = cursors.iterator();
 
         validateSingleResult(curItr.next(), true);
         validateSingleResult(curItr.next(), 1L);
+        validateSingleResult(curItr.next(), 1L);
         assertNotNull(curItr.next()); // skip EXPLAIN.
-        validateSingleResult(curItr.next(), 0, 0);
+        validateSingleResult(curItr.next(), 0, 1);
+        validateSingleResult(curItr.next(), 1L);
 
         assertFalse(curItr.hasNext());
 
+        cursors.forEach(AsyncSqlCursor::closeAsync);
+
         // Ensures that the script is executed completely, even if the cursor 
data has not been read.

Review Comment:
   `fetchAllCursors` method does not fetches data from cursors.



-- 
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