ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [41/50] [abbrv] incubator-ignite git commit: ignite-705: clear h2 objects after test and simple refactoring
Date Thu, 09 Apr 2015 16:23:12 GMT
ignite-705: clear h2 objects after test and simple refactoring


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

Branch: refs/heads/gg-10046
Commit: 59d937422562182da712baf85e2788f21ae923ee
Parents: 5fcb072
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Thu Apr 9 13:54:12 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Thu Apr 9 13:54:12 2015 +0300

----------------------------------------------------------------------
 .../h2/sql/AbstractH2CompareQueryTest.java      | 13 ++++++-
 .../query/h2/sql/BaseH2CompareQueryTest.java    | 25 +++++++++----
 .../query/h2/sql/H2CompareBigQueryTest.java     | 38 +++-----------------
 3 files changed, 34 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/59d93742/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/AbstractH2CompareQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/AbstractH2CompareQueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/AbstractH2CompareQueryTest.java
index c74493f..2caeab8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/AbstractH2CompareQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/AbstractH2CompareQueryTest.java
@@ -119,7 +119,11 @@ public abstract class AbstractH2CompareQueryTest extends GridCommonAbstractTest
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         super.afterTestsStopped();
+
+        Statement st = conn.createStatement();
         
+        st.execute("DROP ALL OBJECTS");
+
         conn.close();
         
         stopAllGrids();
@@ -140,7 +144,14 @@ public abstract class AbstractH2CompareQueryTest extends GridCommonAbstractTest
      *
      * @throws SQLException If exception.
      */
-    protected abstract void initializeH2Schema() throws SQLException;
+    protected Statement initializeH2Schema() throws SQLException {
+        Statement st = conn.createStatement();
+
+        st.execute("CREATE SCHEMA \"part\"");
+        st.execute("CREATE SCHEMA \"repl\"");
+
+        return st;
+    }
 
     /**
      * Gets connection from a pool.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/59d93742/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
index eea834d..3cafab2 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
@@ -160,9 +160,9 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest
{
     }
 
     /**
-     * *
      * @throws Exception
      */
+    // TODO: IGNITE-705
     public void testAllExamples() throws Exception {
 //        compareQueryRes0("select ? limit ? offset ?");
 
@@ -280,6 +280,18 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest
{
 
         compareQueryRes0("select 'foo' as bar union select 'foo' as bar");
         compareQueryRes0("select 'foo' as bar union all select 'foo' as bar");
+
+//        compareQueryRes0("select count(*) as a from Person union select count(*) as a from
Address");
+//        compareQueryRes0("select old, count(*) as a from Person group by old union select
1, count(*) as a from Address");
+//        compareQueryRes0("select name from Person MINUS select street from Address");
+//        compareQueryRes0("select name from Person EXCEPT select street from Address");
+//        compareQueryRes0("select name from Person INTERSECT select street from Address");
+//        compareQueryRes0("select name from Person UNION select street from Address limit
5");
+//        compareQueryRes0("select name from Person UNION select street from Address limit
?");
+//        compareQueryRes0("select name from Person UNION select street from Address limit
? offset ?");
+//        compareQueryRes0("(select name from Person limit 4) UNION (select street from Address
limit 1) limit ? offset ?");
+//        compareQueryRes0("(select 2 a) union all (select 1) order by 1");
+//        compareQueryRes0("(select 2 a) union all (select 1) order by a desc nulls first
limit ? offset ?");
     }
 
     /**
@@ -407,12 +419,9 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest
{
     }
 
     /** {@inheritDoc} */
-    @Override protected void initializeH2Schema() throws SQLException {
-        Statement st = conn.createStatement();
-
-        st.execute("CREATE SCHEMA \"part\"");
-        st.execute("CREATE SCHEMA \"repl\"");
-
+    @Override protected Statement initializeH2Schema() throws SQLException {
+        Statement st = super.initializeH2Schema();
+        
         st.execute("create table \"part\".ORGANIZATION" +
             "  (_key int not null," +
             "  _val other not null," +
@@ -453,6 +462,8 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest
{
             "  street varchar(255))");
 
         conn.commit();
+        
+        return st;
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/59d93742/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/H2CompareBigQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/H2CompareBigQueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/H2CompareBigQueryTest.java
index c5a2cad..9cff4b5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/H2CompareBigQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/H2CompareBigQueryTest.java
@@ -225,35 +225,6 @@ public class H2CompareBigQueryTest extends AbstractH2CompareQueryTest
{
     /**
      * @throws Exception If failed.
      */
-    public void testUnionAllOrders() throws Exception {
-        compareQueryRes0(
-            "   select  date, orderId, rootOrderId " +
-                "   from \"part\".CustOrder where alias='CUSTOM'");
-                
-        compareQueryRes0(
-                "   select  date, orderId, rootOrderId " +
-                "   from \"part\".ReplaceOrder where alias='CUSTOM'");
-        
-        compareQueryRes0(
-            "   select 10" +
-
-                "   union all" +
-
-                "   select  20");
-        
-        compareQueryRes0(
-            "   select  date, orderId, rootOrderId " +
-                "   from \"part\".CustOrder where alias='CUSTOM'" +
-
-                "   union all" +
-
-                "   select  date, orderId, rootOrderId " +
-                "   from \"part\".ReplaceOrder where alias='CUSTOM'");
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testBigQuery() throws Exception {
         List<List<?>> res = compareQueryRes0(bigQry);
         
@@ -261,11 +232,8 @@ public class H2CompareBigQueryTest extends AbstractH2CompareQueryTest
{
     }
     
     /** {@inheritDoc} */
-    @Override protected void initializeH2Schema() throws SQLException {
-        Statement st = conn.createStatement();
-
-        st.execute("CREATE SCHEMA \"part\"");
-        st.execute("CREATE SCHEMA \"repl\"");
+    @Override protected Statement initializeH2Schema() throws SQLException {
+        Statement st = super.initializeH2Schema();
 
         st.execute("create table \"part\".CustOrder" +
             "  (" +
@@ -323,6 +291,8 @@ public class H2CompareBigQueryTest extends AbstractH2CompareQueryTest
{
             "  )");
         
         conn.commit();
+        
+        return st;
     }
 
     /**


Mime
View raw message