You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2022/05/30 15:43:14 UTC

[ignite-3] branch ignite-14972 updated: Add ClientSqlTest

This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-14972
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-14972 by this push:
     new 7466021cb Add ClientSqlTest
7466021cb is described below

commit 7466021cbcd3f6ae052cc0e88e62fecb935c4c30
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Mon May 30 18:43:08 2022 +0300

    Add ClientSqlTest
---
 .../org/apache/ignite/client/ClientSqlTest.java    | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java b/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java
new file mode 100644
index 000000000..dae086c40
--- /dev/null
+++ b/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.ignite.sql.Session;
+import org.apache.ignite.sql.SqlRow;
+import org.apache.ignite.sql.async.AsyncResultSet;
+import org.junit.jupiter.api.Test;
+
+/**
+ * SQL tests.
+ */
+public class ClientSqlTest extends AbstractClientTableTest {
+    @Test
+    public void testExecute() {
+        Session session = client.sql().createSession();
+        AsyncResultSet resultSet = session.executeAsync(null, "SELECT 1").join();
+
+        assertTrue(resultSet.hasRowSet());
+        assertFalse(resultSet.wasApplied());
+        assertEquals(1, resultSet.currentPageSize());
+
+        SqlRow row = resultSet.currentPage().iterator().next();
+        assertEquals(1, row.intValue(0));
+    }
+}