ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/11] ignite git commit: IGNITE-7001: SQL: now DDL tests mostly use public API. This closes #3096.
Date Tue, 05 Dec 2017 07:31:18 GMT
IGNITE-7001: SQL: now DDL tests mostly use public API. This closes #3096.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8292335e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8292335e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8292335e

Branch: refs/heads/ignite-zk
Commit: 8292335e419a19a90a0bfcd302a937cbf7440f21
Parents: 1f43375
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Mon Dec 4 15:14:12 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Dec 4 15:14:12 2017 +0300

----------------------------------------------------------------------
 .../cache/index/AbstractSchemaSelfTest.java     | 248 ++++++-------------
 ...ynamicColumnsAbstractConcurrentSelfTest.java |  40 +--
 .../cache/index/DynamicColumnsAbstractTest.java |  24 +-
 .../DynamicIndexAbstractBasicSelfTest.java      |  58 ++---
 .../DynamicIndexAbstractConcurrentSelfTest.java |   5 +-
 .../H2DynamicColumnsAbstractBasicSelfTest.java  |  15 +-
 .../cache/index/H2DynamicTableSelfTest.java     |  57 +++--
 7 files changed, 188 insertions(+), 259 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/AbstractSchemaSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/AbstractSchemaSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/AbstractSchemaSelfTest.java
index 01d1f36..5310f46 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/AbstractSchemaSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/AbstractSchemaSelfTest.java
@@ -17,21 +17,28 @@
 
 package org.apache.ignite.internal.processors.cache.index;
 
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.Ignition;
-import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.QueryIndex;
 import org.apache.ignite.cache.QueryIndexType;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
-import org.apache.ignite.internal.processors.query.GridQueryIndexDescriptor;
+import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
+import org.apache.ignite.internal.processors.port.GridPortRecord;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
 import org.apache.ignite.internal.processors.query.QueryIndexDescriptorImpl;
@@ -39,25 +46,17 @@ import org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl;
 import org.apache.ignite.internal.processors.query.QueryUtils;
 import org.apache.ignite.internal.util.GridStringBuilder;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.SB;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.jetbrains.annotations.Nullable;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Tests for dynamic schema changes.
  */
 @SuppressWarnings("unchecked")
-public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
+public abstract class AbstractSchemaSelfTest extends GridCommonAbstractTest {
     /** Cache. */
     protected static final String CACHE_NAME = "cache";
 
@@ -105,7 +104,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param tblName Table name.
      * @return Type.
      */
-    protected static QueryTypeDescriptorImpl typeExisting(IgniteEx node, String cacheName,
String tblName) {
+    static QueryTypeDescriptorImpl typeExisting(IgniteEx node, String cacheName, String tblName)
{
         QueryTypeDescriptorImpl res = type(node, cacheName, tblName);
 
         assertNotNull(res);
@@ -155,107 +154,61 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest
{
      * @param inlineSize Inline size.
      * @param fields Fields.
      */
-    protected static void assertIndex(String cacheName, String tblName, String idxName,
-        int inlineSize, IgniteBiTuple<String, Boolean>... fields) {
-        assertIndex(cacheName, false, tblName, idxName, inlineSize, fields);
-    }
-
-    /**
-     * Assert index state on all nodes.
-     *
-     * @param cacheName Cache name.
-     * @param checkNonAffinityNodes Whether existence of {@link GridQueryIndexDescriptor}
must be checked on non
-     *     affinity nodes as well.
-     * @param tblName Table name.
-     * @param idxName Index name.
-     * @param inlineSize Inline size.
-     * @param fields Fields.
-     */
-    protected static void assertIndex(String cacheName, boolean checkNonAffinityNodes, String
tblName, String idxName,
+    static void assertIndex(String cacheName, String tblName, String idxName,
         int inlineSize, IgniteBiTuple<String, Boolean>... fields) {
         for (Ignite node : Ignition.allGrids())
-            assertIndex(node, checkNonAffinityNodes, cacheName, tblName, idxName, inlineSize,
fields);
+            assertIndex(node, cacheName, tblName, idxName, inlineSize, fields);
     }
 
     /**
      * Assert index state on particular node.
      *
      * @param node Node.
-     * @param checkNonAffinityNode Whether existence of {@link GridQueryIndexDescriptor}
must be checked regardless of
-     * whether this node is affinity node or not.
      * @param cacheName Cache name.
      * @param tblName Table name.
      * @param idxName Index name.
      * @param inlineSize Inline size.
      * @param fields Fields.
      */
-    protected static void assertIndex(Ignite node, boolean checkNonAffinityNode, String cacheName,
String tblName,
+    static void assertIndex(Ignite node, String cacheName, String tblName,
         String idxName, int inlineSize, IgniteBiTuple<String, Boolean>... fields) {
-        IgniteEx node0 = (IgniteEx)node;
-
-        assertIndexDescriptor(node0, cacheName, tblName, idxName, fields);
-
-        if (checkNonAffinityNode || affinityNode(node0, cacheName)) {
-            QueryTypeDescriptorImpl typeDesc = typeExisting(node0, cacheName, tblName);
+        node.cache(cacheName);
 
-            assertIndex(typeDesc, idxName, inlineSize, fields);
-        }
-    }
-
-    /**
-     * Make sure index exists in cache descriptor.
-     *
-     * @param node Node.
-     * @param cacheName Cache name.
-     * @param tblName Table name.
-     * @param idxName Index name.
-     * @param fields Fields.
-     */
-    protected static void assertIndexDescriptor(IgniteEx node, String cacheName, String tblName,
String idxName,
-        IgniteBiTuple<String, Boolean>... fields) {
-        awaitCompletion();
-
-        DynamicCacheDescriptor desc = node.context().cache().cacheDescriptor(cacheName);
-
-        assert desc != null;
-
-        for (QueryEntity entity : desc.schema().entities()) {
-            if (F.eq(tblName, entity.getTableName())) {
-                for (QueryIndex idx : entity.getIndexes()) {
-                    if (F.eq(QueryUtils.indexName(entity, idx), idxName)) {
-                        LinkedHashMap<String, Boolean> idxFields = idx.getFields();
-
-                        assertEquals(idxFields.size(), fields.length);
-
-                        int i = 0;
-
-                        for (String idxField : idxFields.keySet()) {
-                            assertEquals(idxField.toLowerCase(), fields[i].get1().toLowerCase());
-                            assertEquals(idxFields.get(idxField), fields[i].get2());
+        IgniteEx node0 = (IgniteEx)node;
 
-                            i++;
-                        }
+        ArrayList<IgniteBiTuple<String, Boolean>> res = new ArrayList<>();
 
-                        return;
+        try {
+            try (Connection c = connect(node0)) {
+                try (ResultSet rs = c.getMetaData().getIndexInfo(null, cacheName, tblName,
false, false)) {
+                    while (rs.next()) {
+                        if (F.eq(idxName, rs.getString("INDEX_NAME")))
+                            res.add(new T2<>(rs.getString("COLUMN_NAME"), F.eq("A",
rs.getString("ASC_OR_DESC"))));
                     }
                 }
             }
+
+            assertTrue("Index not found: " + idxName, res.size() > 0);
+
+            assertEquals(Arrays.asList(fields), res);
         }
+        catch (SQLException e) {
+            throw new AssertionError(e);
+        }
+
+        // Also, let's check internal stuff not visible via JDBC - like inline size.
+        QueryTypeDescriptorImpl typeDesc = typeExisting(node0, cacheName, tblName);
 
-        fail("Index not found [node=" + node.name() + ", cacheName=" + cacheName + ", tlbName="
+ tblName +
-            ", idxName=" + idxName + ']');
+        assertInternalIndexParams(typeDesc, idxName, inlineSize);
     }
 
     /**
-     * Assert index state.
-     *
+     * Assert index details not available via JDBC.
      * @param typeDesc Type descriptor.
      * @param idxName Index name.
      * @param inlineSize Inline size.
-     * @param fields Fields (order is important).
      */
-    protected static void assertIndex(QueryTypeDescriptorImpl typeDesc, String idxName,
-        int inlineSize, IgniteBiTuple<String, Boolean>... fields) {
+    private static void assertInternalIndexParams(QueryTypeDescriptorImpl typeDesc, String
idxName, int inlineSize) {
         QueryIndexDescriptorImpl idxDesc = typeDesc.index(idxName);
 
         assertNotNull(idxDesc);
@@ -264,22 +217,32 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
         assertEquals(typeDesc, idxDesc.typeDescriptor());
         assertEquals(QueryIndexType.SORTED, idxDesc.type());
         assertEquals(inlineSize, idxDesc.inlineSize());
+    }
 
-        List<String> fieldNames = new ArrayList<>(idxDesc.fields());
+    /**
+     * @param node Node to connect to.
+     * @return Thin JDBC connection to specified node.
+     */
+    static Connection connect(IgniteEx node) {
+        Collection<GridPortRecord> recs = node.context().ports().records();
 
-        assertEquals(fields.length, fieldNames.size());
+        GridPortRecord cliLsnrRec = null;
 
-        for (int i = 0; i < fields.length; i++) {
-            String expFieldName = fields[i].get1();
-            boolean expFieldAsc = fields[i].get2();
+        for (GridPortRecord rec : recs) {
+            if (rec.clazz() == ClientListenerProcessor.class) {
+                cliLsnrRec = rec;
 
-            assertEquals("Index field mismatch [pos=" + i + ", expField=" + expFieldName
+ ", actualField=" +
-                fieldNames.get(i) + ']', expFieldName.toLowerCase(), fieldNames.get(i).toLowerCase());
+                break;
+            }
+        }
 
-            boolean fieldAsc = !idxDesc.descending(expFieldName);
+        assertNotNull(cliLsnrRec);
 
-            assertEquals("Index field sort mismatch [pos=" + i + ", field=" + expFieldName
+
-                ", expAsc=" + expFieldAsc + ", actualAsc=" + fieldAsc + ']', expFieldAsc,
fieldAsc);
+        try {
+            return DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:" + cliLsnrRec.port());
+        }
+        catch (SQLException e) {
+            throw new AssertionError(e);
         }
     }
 
@@ -290,7 +253,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param tblName Table name.
      * @param idxName Index name.
      */
-    protected static void assertNoIndex(String cacheName, String tblName, String idxName)
{
+    static void assertNoIndex(String cacheName, String tblName, String idxName) {
         for (Ignite node : Ignition.allGrids())
             assertNoIndex(node, cacheName, tblName, idxName);
     }
@@ -303,82 +266,25 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param tblName Table name.
      * @param idxName Index name.
      */
-    protected static void assertNoIndex(Ignite node, String cacheName, String tblName, String
idxName) {
-        IgniteEx node0 = (IgniteEx)node;
-
-        assertNoIndexDescriptor(node0, cacheName, idxName);
+    static void assertNoIndex(Ignite node, String cacheName, String tblName, String idxName)
{
+        node.cache(cacheName);
 
-        if (affinityNode(node0, cacheName)) {
-            QueryTypeDescriptorImpl typeDesc = typeExisting(node0, cacheName, tblName);
-
-            assertNoIndex(typeDesc, idxName);
-        }
-    }
-
-    /**
-     * Assert index doesn't exist in particular node's cache descriptor.
-     *
-     * @param node Node.
-     * @param cacheName Cache name.
-     * @param idxName Index name.
-     */
-    protected static void assertNoIndexDescriptor(IgniteEx node, String cacheName, String
idxName) {
-        awaitCompletion();
-
-        DynamicCacheDescriptor desc = node.context().cache().cacheDescriptor(cacheName);
-
-        if (desc == null)
-            return;
-
-        for (QueryEntity entity : desc.schema().entities()) {
-            for (QueryIndex idx : entity.getIndexes()) {
-                if (F.eq(idxName, QueryUtils.indexName(entity, idx)))
-                    fail("Index exists: " + idxName);
-            }
-        }
-    }
-
-    /**
-     * Await completion (hopefully) of pending operations.
-     */
-    private static void awaitCompletion() {
         try {
-            U.sleep(100);
+            try (Connection c = connect((IgniteEx)node)) {
+                try (ResultSet rs = c.getMetaData().getIndexInfo(null, cacheName, tblName,
false, false)) {
+                    while (rs.next()) {
+                        assertFalse("Index exists, although shouldn't: " + tblName + '.'
+ idxName,
+                            F.eq(idxName, rs.getString("INDEX_NAME")));
+                    }
+                }
+            }
         }
-        catch (IgniteInterruptedCheckedException e) {
-            fail();
+        catch (SQLException e) {
+            throw new AssertionError(e);
         }
     }
 
     /**
-     * Assert index doesn't exist.
-     *
-     * @param typeDesc Type descriptor.
-     * @param idxName Index name.
-     */
-    protected static void assertNoIndex(QueryTypeDescriptorImpl typeDesc, String idxName)
{
-        assertNull(typeDesc.index(idxName));
-    }
-
-    /**
-     * Check whether this is affinity node for cache.
-     *
-     * @param node Node.
-     * @param cacheName Cache name.
-     * @return {@code True} if affinity node.
-     */
-    private static boolean affinityNode(IgniteEx node, String cacheName) {
-        if (node.configuration().isClientMode())
-            return false;
-
-        DynamicCacheDescriptor cacheDesc = node.context().cache().cacheDescriptor(cacheName);
-
-        IgnitePredicate<ClusterNode> filter = cacheDesc.cacheConfiguration().getNodeFilter();
-
-        return filter == null || filter.apply(node.localNode());
-    }
-
-    /**
      * Get table name for class.
      *
      * @param cls Class.
@@ -394,7 +300,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param cls Class.
      * @return Table name.
      */
-    protected static String tableName(Class cls) {
+    static String tableName(Class cls) {
         return QueryUtils.normalizeObjectName(typeName(cls), true);
     }
 
@@ -426,7 +332,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param node Node.
      * @return Query processor.
      */
-    protected static GridQueryProcessor queryProcessor(Ignite node) {
+    static GridQueryProcessor queryProcessor(Ignite node) {
         return ((IgniteEx)node).context().query();
     }
 
@@ -448,7 +354,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @return Field.
      */
     protected static IgniteBiTuple<String, Boolean> field(String name, boolean asc)
{
-        return F.t(name, asc);
+        return F.t(name.toUpperCase(), asc);
     }
 
     /**
@@ -470,7 +376,7 @@ public class AbstractSchemaSelfTest extends GridCommonAbstractTest {
      * @param parallel Parallelism level.
      * @throws Exception If failed.
      */
-    protected void dynamicIndexCreate(Ignite node, String cacheName, String tblName, QueryIndex
idx,
+    void dynamicIndexCreate(Ignite node, String cacheName, String tblName, QueryIndex idx,
         boolean ifNotExists, int parallel)
         throws Exception {
         GridStringBuilder sql = new SB("CREATE INDEX ")

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java
index 0263f5c..145947a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java
@@ -147,15 +147,15 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         CountDownLatch finishLatch = new CountDownLatch(2);
 
         // Start servers.
-        Ignite srv1 = ignitionStart(serverConfiguration(1), null);
-        Ignite srv2 = ignitionStart(serverConfiguration(2), null);
-        Ignite srv3 = ignitionStart(serverConfiguration(3, true), finishLatch);
+        IgniteEx srv1 = ignitionStart(serverConfiguration(1), null);
+        IgniteEx srv2 = ignitionStart(serverConfiguration(2), null);
+        IgniteEx srv3 = ignitionStart(serverConfiguration(3, true), finishLatch);
 
         UUID srv1Id = srv1.cluster().localNode().id();
         UUID srv2Id = srv2.cluster().localNode().id();
 
         // Start client which will execute operations.
-        IgniteEx cli = (IgniteEx)ignitionStart(clientConfiguration(4), finishLatch);
+        IgniteEx cli = ignitionStart(clientConfiguration(4), finishLatch);
 
         createSqlCache(cli);
 
@@ -176,7 +176,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         colFut1.get();
 
         // Port number is for srv2.
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, 10801, c("age", Integer.class.getName()));
+        checkTableState(srv2, QueryUtils.DFLT_SCHEMA, TBL_NAME, c("age", Integer.class.getName()));
 
         // Test migration from normal server to non-affinity server.
         idxLatch = blockIndexing(srv2Id);
@@ -196,7 +196,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         srv3.cache(QueryUtils.createTableCacheName(QueryUtils.DFLT_SCHEMA, "PERSON"));
 
         // Port number is for srv3.
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, 10802, c("city", String.class.getName()));
+        checkTableState(srv3, QueryUtils.DFLT_SCHEMA, TBL_NAME, c("city", String.class.getName()));
     }
 
     /**
@@ -208,7 +208,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         // 7 nodes * 2 columns = 14 latch countdowns.
         CountDownLatch finishLatch = new CountDownLatch(14);
 
-        Ignite srv1 = ignitionStart(serverConfiguration(1), finishLatch);
+        IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
 
         ignitionStart(serverConfiguration(2), finishLatch);
         ignitionStart(serverConfiguration(3, true), finishLatch);
@@ -244,7 +244,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
 
         U.await(finishLatch);
 
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, c1, c2);
+        checkTableState(srv1, QueryUtils.DFLT_SCHEMA, TBL_NAME, c1, c2);
     }
 
     /**
@@ -255,7 +255,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
     public void testNodeJoinOnPendingOperation() throws Exception {
         CountDownLatch finishLatch = new CountDownLatch(4);
 
-        Ignite srv1 = ignitionStart(serverConfiguration(1), finishLatch);
+        IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
 
         createSqlCache(srv1);
 
@@ -281,7 +281,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
 
         U.await(finishLatch);
 
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, c);
+        checkTableState(srv1, QueryUtils.DFLT_SCHEMA, TBL_NAME, c);
     }
 
     /**
@@ -293,7 +293,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         CountDownLatch finishLatch = new CountDownLatch(4);
 
         // Start several nodes.
-        Ignite srv1 = ignitionStart(serverConfiguration(1), finishLatch);
+        IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
         ignitionStart(serverConfiguration(2), finishLatch);
         ignitionStart(serverConfiguration(3), finishLatch);
         ignitionStart(serverConfiguration(4), finishLatch);
@@ -340,7 +340,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         finishLatch.await();
 
         // Make sure new column is there.
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, c("v", Integer.class.getName()));
+        checkTableState(srv1, QueryUtils.DFLT_SCHEMA, TBL_NAME, c("v", Integer.class.getName()));
 
         run(srv1, "update person set \"v\" = case when mod(id, 2) <> 0 then substring(name,
7, length(name) - 6) " +
             "else null end");
@@ -419,7 +419,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
      */
     public void testConcurrentRebalance() throws Exception {
         // Start cache and populate it with data.
-        Ignite srv1 = ignitionStart(serverConfiguration(1));
+        IgniteEx srv1 = ignitionStart(serverConfiguration(1));
         Ignite srv2 = ignitionStart(serverConfiguration(2));
 
         createSqlCache(srv1);
@@ -454,7 +454,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         // Validate index state.
         idxFut.get();
 
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, c);
+        checkTableState(srv1, QueryUtils.DFLT_SCHEMA, TBL_NAME, c);
     }
 
     /**
@@ -636,7 +636,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
      */
     private void checkClientReconnect(final boolean restartCache, boolean dynamicCache) throws
Exception {
         // Start complex topology.
-        final Ignite srv = ignitionStart(serverConfiguration(1));
+        final IgniteEx srv = ignitionStart(serverConfiguration(1));
         ignitionStart(serverConfiguration(2));
         ignitionStart(serverConfiguration(3, true));
 
@@ -660,7 +660,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
             }
         });
 
-        checkTableState(schemaName, TBL_NAME, cols);
+        checkTableState(srv, schemaName, TBL_NAME, cols);
     }
 
     /**
@@ -724,7 +724,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
         ignitionStart(serverConfiguration(2));
         ignitionStart(serverConfiguration(3, true));
 
-        final Ignite cli = ignitionStart(clientConfiguration(4));
+        final IgniteEx cli = ignitionStart(clientConfiguration(4));
 
         createSqlCache(cli);
 
@@ -849,7 +849,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
 
         idxQry += ')';
 
-        checkTableState(QueryUtils.DFLT_SCHEMA, TBL_NAME, expCols);
+        checkTableState(cli, QueryUtils.DFLT_SCHEMA, TBL_NAME, expCols);
 
         put(cli, 0, 500);
 
@@ -987,7 +987,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
      * @param cfg Node configuration.
      * @return New node.
      */
-    private static Ignite ignitionStart(IgniteConfiguration cfg) {
+    private static IgniteEx ignitionStart(IgniteConfiguration cfg) {
         return ignitionStart(cfg, null);
     }
 
@@ -997,7 +997,7 @@ public abstract class DynamicColumnsAbstractConcurrentSelfTest extends
DynamicCo
      * @param latch Latch to await for ultimate completion of DDL operations.
      * @return New node.
      */
-    private static Ignite ignitionStart(IgniteConfiguration cfg, final CountDownLatch latch)
{
+    private static IgniteEx ignitionStart(IgniteConfiguration cfg, final CountDownLatch latch)
{
         // Have to do this for each starting node - see GridQueryProcessor ctor, it nulls
         // idxCls static field on each call.
         GridQueryProcessor.idxCls = BlockingIndexing.class;

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractTest.java
index 34be76e..611f857 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache.index;
 
 import java.sql.Connection;
-import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -32,7 +31,6 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.ClientConnectorConfiguration;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
@@ -47,6 +45,8 @@ import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.h2.value.DataType;
 
+import static org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.connect;
+
 /**
  * Common stuff for dynamic columns tests.
  */
@@ -62,25 +62,16 @@ public abstract class DynamicColumnsAbstractTest extends GridCommonAbstractTest
 
     /**
      * Check that given columns are seen by client.
+     * @param node Node to check.
      * @param schemaName Schema name to look for the table in.
      * @param tblName Table name to check.
      * @param cols Columns whose presence must be checked.
      */
-    static void checkTableState(String schemaName, String tblName, QueryField... cols) throws
SQLException {
-        checkTableState(schemaName, tblName, ClientConnectorConfiguration.DFLT_PORT, cols);
-    }
-
-    /**
-     * Check that given columns are seen by client.
-     * @param schemaName Schema name to look for the table in.
-     * @param tblName Table name to check.
-     * @param port Port number.
-     * @param cols Columns whose presence must be checked.
-     */
-    static void checkTableState(String schemaName, String tblName, int port, QueryField...
cols) throws SQLException {
+    static void checkTableState(IgniteEx node, String schemaName, String tblName, QueryField...
cols)
+        throws SQLException {
         List<QueryField> flds = new ArrayList<>();
 
-        try (Connection c = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:" +
port)) {
+        try (Connection c = connect(node)) {
             try (ResultSet rs = c.getMetaData().getColumns(null, schemaName, tblName, "%"))
{
                 while (rs.next()) {
                     String name = rs.getString("COLUMN_NAME");
@@ -110,8 +101,7 @@ public abstract class DynamicColumnsAbstractTest extends GridCommonAbstractTest
 
             assertEquals(exp.typeName(), act.typeName());
 
-            // TODO uncomment after IGNITE-6529 is implemented.
-            //assertEquals(exp.isNullable(), act.isNullable());
+            assertEquals(exp.isNullable(), act.isNullable());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
index bf469f1..db874c2 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
@@ -295,7 +295,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCachePartitionedAtomic() throws Exception {
+    public void testCreateIndexNoCachePartitionedAtomic() throws Exception {
         checkCreateNotCache(PARTITIONED, ATOMIC, false);
     }
 
@@ -304,7 +304,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCachePartitionedAtomicNear() throws Exception {
+    public void testCreateIndexNoCachePartitionedAtomicNear() throws Exception {
         checkCreateNotCache(PARTITIONED, ATOMIC, true);
     }
 
@@ -313,7 +313,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCachePartitionedTransactional() throws Exception {
+    public void testCreateIndexNoCachePartitionedTransactional() throws Exception {
         checkCreateNotCache(PARTITIONED, TRANSACTIONAL, false);
     }
 
@@ -322,7 +322,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCachePartitionedTransactionalNear() throws Exception {
+    public void testCreateIndexNoCachePartitionedTransactionalNear() throws Exception {
         checkCreateNotCache(PARTITIONED, TRANSACTIONAL, true);
     }
 
@@ -331,7 +331,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCacheReplicatedAtomic() throws Exception {
+    public void testCreateIndexNoCacheReplicatedAtomic() throws Exception {
         checkCreateNotCache(REPLICATED, ATOMIC, false);
     }
 
@@ -340,7 +340,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoCacheReplicatedTransactional() throws Exception {
+    public void testCreateIndexNoCacheReplicatedTransactional() throws Exception {
         checkCreateNotCache(REPLICATED, TRANSACTIONAL, false);
     }
 
@@ -457,8 +457,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnPartitionedAtomic() throws Exception {
-        checkCreateNoColumn(PARTITIONED, ATOMIC, false);
+    public void testCreateIndexNoColumnPartitionedAtomic() throws Exception {
+        checkCreateIndexNoColumn(PARTITIONED, ATOMIC, false);
     }
 
     /**
@@ -466,8 +466,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnPartitionedAtomicNear() throws Exception {
-        checkCreateNoColumn(PARTITIONED, ATOMIC, true);
+    public void testCreateIndexNoColumnPartitionedAtomicNear() throws Exception {
+        checkCreateIndexNoColumn(PARTITIONED, ATOMIC, true);
     }
 
     /**
@@ -475,8 +475,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnPartitionedTransactional() throws Exception {
-        checkCreateNoColumn(PARTITIONED, TRANSACTIONAL, false);
+    public void testCreateIndexNoColumnPartitionedTransactional() throws Exception {
+        checkCreateIndexNoColumn(PARTITIONED, TRANSACTIONAL, false);
     }
 
     /**
@@ -484,8 +484,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnPartitionedTransactionalNear() throws Exception {
-        checkCreateNoColumn(PARTITIONED, TRANSACTIONAL, true);
+    public void testCreateIndexNoColumnPartitionedTransactionalNear() throws Exception {
+        checkCreateIndexNoColumn(PARTITIONED, TRANSACTIONAL, true);
     }
 
     /**
@@ -493,8 +493,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnReplicatedAtomic() throws Exception {
-        checkCreateNoColumn(REPLICATED, ATOMIC, false);
+    public void testCreateIndexNoColumnReplicatedAtomic() throws Exception {
+        checkCreateIndexNoColumn(REPLICATED, ATOMIC, false);
     }
 
     /**
@@ -502,8 +502,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateNoColumnReplicatedTransactional() throws Exception {
-        checkCreateNoColumn(REPLICATED, TRANSACTIONAL, false);
+    public void testCreateIndexNoColumnReplicatedTransactional() throws Exception {
+        checkCreateIndexNoColumn(REPLICATED, TRANSACTIONAL, false);
     }
 
     /**
@@ -514,7 +514,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      * @param near Near flag.
      * @throws Exception If failed.
      */
-    private void checkCreateNoColumn(CacheMode mode, CacheAtomicityMode atomicityMode, boolean
near) throws Exception {
+    private void checkCreateIndexNoColumn(CacheMode mode, CacheAtomicityMode atomicityMode,
boolean near) throws Exception {
         initialize(mode, atomicityMode, near);
 
         final QueryIndex idx = index(IDX_NAME_1, field(randomString()));
@@ -533,8 +533,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateColumnWithAliasPartitionedAtomic() throws Exception {
-        checkCreateColumnWithAlias(PARTITIONED, ATOMIC, false);
+    public void testCreateIndexOnColumnWithAliasPartitionedAtomic() throws Exception {
+        checkCreateIndexOnColumnWithAlias(PARTITIONED, ATOMIC, false);
     }
 
     /**
@@ -542,8 +542,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateColumnWithAliasPartitionedAtomicNear() throws Exception {
-        checkCreateColumnWithAlias(PARTITIONED, ATOMIC, true);
+    public void testCreateIndexOnColumnWithAliasPartitionedAtomicNear() throws Exception
{
+        checkCreateIndexOnColumnWithAlias(PARTITIONED, ATOMIC, true);
     }
 
     /**
@@ -551,8 +551,8 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      *
      * @throws Exception If failed.
      */
-    public void testCreateColumnWithAliasPartitionedTransactional() throws Exception {
-        checkCreateColumnWithAlias(PARTITIONED, TRANSACTIONAL, false);
+    public void testCreateIndexOnColumnWithAliasPartitionedTransactional() throws Exception
{
+        checkCreateIndexOnColumnWithAlias(PARTITIONED, TRANSACTIONAL, false);
     }
 
     /**
@@ -561,7 +561,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      * @throws Exception If failed.
      */
     public void testCreateColumnWithAliasPartitionedTransactionalNear() throws Exception
{
-        checkCreateColumnWithAlias(PARTITIONED, TRANSACTIONAL, true);
+        checkCreateIndexOnColumnWithAlias(PARTITIONED, TRANSACTIONAL, true);
     }
 
     /**
@@ -570,7 +570,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      * @throws Exception If failed.
      */
     public void testCreateColumnWithAliasReplicatedAtomic() throws Exception {
-        checkCreateColumnWithAlias(REPLICATED, ATOMIC, false);
+        checkCreateIndexOnColumnWithAlias(REPLICATED, ATOMIC, false);
     }
 
     /**
@@ -579,7 +579,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      * @throws Exception If failed.
      */
     public void testCreateColumnWithAliasReplicatedTransactional() throws Exception {
-        checkCreateColumnWithAlias(REPLICATED, TRANSACTIONAL, false);
+        checkCreateIndexOnColumnWithAlias(REPLICATED, TRANSACTIONAL, false);
     }
 
     /**
@@ -590,7 +590,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
      * @param near Near flag.
      * @throws Exception If failed.
      */
-    private void checkCreateColumnWithAlias(CacheMode mode, CacheAtomicityMode atomicityMode,
boolean near)
+    private void checkCreateIndexOnColumnWithAlias(CacheMode mode, CacheAtomicityMode atomicityMode,
boolean near)
         throws Exception {
         initialize(mode, atomicityMode, near);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java
index 65ceb24..f8bb0cf 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java
@@ -670,7 +670,7 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde
             }
         });
 
-        assertIndex(cli, true, CACHE_NAME, TBL_NAME, IDX_NAME_1,
+        assertIndex(cli, CACHE_NAME, TBL_NAME, IDX_NAME_1,
             QueryIndex.DFLT_INLINE_SIZE, field(FIELD_NAME_1));
         assertIndexUsed(IDX_NAME_1, SQL_SIMPLE_FIELD_1, SQL_ARG_1);
 
@@ -690,8 +690,9 @@ public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicInde
 
         queryProcessor(srv).dynamicIndexCreate(CACHE_NAME, CACHE_NAME, TBL_NAME, idx, false,
0).get();
 
-        assertIndex(cli, true, CACHE_NAME, TBL_NAME, IDX_NAME_2, QueryIndex.DFLT_INLINE_SIZE,
+        assertIndex(cli, CACHE_NAME, TBL_NAME, IDX_NAME_2, QueryIndex.DFLT_INLINE_SIZE,
             field(aliasUnescaped(FIELD_NAME_2)));
+
         assertIndexUsed(IDX_NAME_2, SQL_SIMPLE_FIELD_2, SQL_ARG_2);
 
         reconnectClientNode(srv, cli, restartCache, new RunnableX() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java
index e4681ae..eb6d7e6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicColumnsAbstractBasicSelfTest.java
@@ -94,6 +94,18 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum
     }
 
     /**
+     * Check table state on default node.
+     *
+     * @param schemaName Schema name.
+     * @param tblName Table name.
+     * @param cols Columns to look for.
+     * @throws SQLException if failed.
+     */
+    private void checkTableState(String schemaName, String tblName, QueryField... cols) throws
SQLException {
+        checkTableState(grid(nodeIndex()), schemaName, tblName, cols);
+    }
+
+    /**
      * Test column addition to the end of the columns list.
      */
     public void testAddColumnSimple() throws SQLException {
@@ -114,7 +126,8 @@ public abstract class H2DynamicColumnsAbstractBasicSelfTest extends DynamicColum
 
         doSleep(500);
 
-        checkTableState(QueryUtils.DFLT_SCHEMA, "PERSON", c("AGE", Integer.class.getName()),
c("city", String.class.getName()));
+        checkTableState(QueryUtils.DFLT_SCHEMA, "PERSON", c("AGE", Integer.class.getName()),
+            c("city", String.class.getName()));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8292335e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
index 71b0b5f..f3deec9 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
@@ -491,7 +491,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
      * @param additionalParams Supplemental parameters to append to {@code CREATE TABLE}
SQL.
      */
     private void doTestCreateTable(String tplCacheName, String cacheGrp, CacheMode cacheMode,
-        CacheWriteSynchronizationMode writeSyncMode, String... additionalParams) {
+        CacheWriteSynchronizationMode writeSyncMode, String... additionalParams) throws SQLException
{
         doTestCreateTable(tplCacheName, cacheGrp, cacheMode, writeSyncMode, false, additionalParams);
     }
 
@@ -506,7 +506,8 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
      * @param additionalParams Supplemental parameters to append to {@code CREATE TABLE}
SQL.
      */
     private void doTestCreateTable(String tplCacheName, String cacheGrp, CacheMode cacheMode,
-        CacheWriteSynchronizationMode writeSyncMode, boolean useLegacyCacheGrpParamName,
String... additionalParams) {
+        CacheWriteSynchronizationMode writeSyncMode, boolean useLegacyCacheGrpParamName,
String... additionalParams)
+        throws SQLException {
         String cacheGrpParamName = useLegacyCacheGrpParamName ? "cacheGroup" : "cache_group";
 
         String sql = "CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
@@ -547,30 +548,48 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
             if (writeSyncMode != null)
                 assertEquals(writeSyncMode, cacheDesc.cacheConfiguration().getWriteSynchronizationMode());
 
-            QueryTypeDescriptorImpl desc = typeExisting(node, cacheName, "Person");
+            List<String> colNames = new ArrayList<>(5);
 
-            assertEquals(Object.class, desc.keyClass());
-            assertEquals(Object.class, desc.valueClass());
+            List<Class<?>> colTypes = new ArrayList<>(5);
 
-            assertTrue(desc.valueTypeName(), desc.valueTypeName().contains("Person"));
+            List<String> pkColNames = new ArrayList<>(2);
 
-            assertTrue(desc.keyTypeName(), desc.keyTypeName().startsWith(desc.valueTypeName()));
-            assertTrue(desc.keyTypeName(), desc.keyTypeName().endsWith("KEY"));
+            try (Connection c = connect(node)) {
+                try (ResultSet rs = c.getMetaData().getColumns(null, QueryUtils.DFLT_SCHEMA,
"Person", null)) {
+                    for (int j = 0; j < 5; j++) {
+                        assertTrue(rs.next());
 
-            assertEquals(
-                F.asList("id", "city", "name", "surname", "age"),
-                new ArrayList<>(desc.fields().keySet())
-            );
+                        colNames.add(rs.getString("COLUMN_NAME"));
 
-            assertProperty(desc, "id", Integer.class, true);
-            assertProperty(desc, "city", String.class, true);
-            assertProperty(desc, "name", String.class, false);
-            assertProperty(desc, "surname", String.class, false);
-            assertProperty(desc, "age", Integer.class, false);
+                        try {
+                            colTypes.add(Class.forName(DataType.getTypeClassName(DataType
+                                .convertSQLTypeToValueType(rs.getInt("DATA_TYPE")))));
+                        }
+                        catch (ClassNotFoundException e) {
+                            throw new AssertionError(e);
+                        }
+                    }
+
+                    assertFalse(rs.next());
+                }
+
+                try (ResultSet rs = c.getMetaData().getPrimaryKeys(null, QueryUtils.DFLT_SCHEMA,
"Person")) {
+                    for (int j = 0; j < 2; j++) {
+                        assertTrue(rs.next());
+
+                        pkColNames.add(rs.getString("COLUMN_NAME"));
+                    }
+
+                    assertFalse(rs.next());
+                }
+            }
+
+            assertEqualsCollections(F.asList("id", "city", "name", "surname", "age"), colNames);
 
-            GridH2Table tbl = ((IgniteH2Indexing)node.context().query().getIndexing()).dataTable("PUBLIC",
"Person");
+            assertEqualsCollections(F.<Class<?>>asList(Integer.class, String.class,
String.class, String.class,
+                Integer.class), colTypes);
 
-            assertNotNull(tbl);
+            assertEqualsCollections(F.asList("id", "city"), pkColNames);
         }
     }
 


Mime
View raw message