master - tests for SQL schema
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c68c146d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c68c146d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c68c146d Branch: refs/heads/ignite-5075-pds Commit: c68c146d1671a26efd38335f7902965d0534c0b6 Parents: 52e14ac Author: Sergi Vladykin <sergi.vlady...@gmail.com> Authored: Mon May 29 09:41:56 2017 +0300 Committer: Sergi Vladykin <sergi.vlady...@gmail.com> Committed: Mon May 29 09:41:56 2017 +0300 ---------------------------------------------------------------------- .../query/IgniteSqlSplitterSelfTest.java | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/c68c146d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java index 4bb6a3a..6b984bf 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java @@ -1123,6 +1123,57 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest { } /** + */ + public void testSchemaQuoted() { + assert false; // TODO test hangs + doTestSchemaName("\"ppAf\""); + } + + /** + */ + public void testSchemaQuotedUpper() { + assert false; // TODO test hangs + doTestSchemaName("\"PPAF\""); + } + + /** + */ + public void testSchemaUnquoted() { + doTestSchemaName("ppAf"); + } + + /** + */ + public void testSchemaUnquotedUpper() { + doTestSchemaName("PPAF"); + } + + /** + * @param schema Schema name. + */ + public void doTestSchemaName(String schema) { + CacheConfiguration ccfg = cacheConfig("persPartAff", true, Integer.class, Person2.class); + + ccfg.setSqlSchema(schema); + + IgniteCache<Integer, Person2> ppAf = ignite(0).createCache(ccfg); + + try { + ppAf.put(1, new Person2(10, "Petya")); + ppAf.put(2, new Person2(10, "Kolya")); + + List<List<?>> res = ppAf.query(new SqlFieldsQuery("select name from " + + schema + ".Person2 order by _key")).getAll(); + + assertEquals("Petya", res.get(0).get(0)); + assertEquals("Kolya", res.get(1).get(0)); + } + finally { + ppAf.destroy(); + } + } + + /** * @throws Exception If failed. */ public void testIndexSegmentation() throws Exception {