ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [10/16] ignite git commit: Fixed a single query test.
Date Mon, 21 Dec 2015 03:29:04 GMT
Fixed a single query test.


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

Branch: refs/heads/ignite-843-rc2
Commit: 10bb798d11fe806657412b5f1ae8a917d13f6ee8
Parents: d391daa
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Dec 18 15:54:29 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Dec 18 15:54:29 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheAbstractFieldsQuerySelfTest.java | 54 ++++++++++++++++----
 1 file changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/10bb798d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index 07e44da..4c952fc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -41,6 +41,7 @@ import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
 import org.apache.ignite.internal.processors.datastructures.GridCacheAtomicLongValue;
@@ -84,6 +85,9 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
     /** Flag indicating if starting node should have cache. */
     protected boolean hasCache;
 
+    /** Whether BinaryMarshaller is set. */
+    protected boolean binaryMarshaller;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -206,6 +210,11 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends
GridCommonA
     }
 
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        binaryMarshaller = grid(0).configuration().getMarshaller() instanceof BinaryMarshaller;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         stopAllGrids();
     }
@@ -249,31 +258,56 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends
GridCommonA
                     assert types.contains("String");
                     assert types.contains("Integer");
 
-                    assert AffinityKey.class.getName().equals(meta.keyClass("Person"));
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(meta.keyClass("Person"));
+                        assert Object.class.getName().equals(meta.valueClass("Person"));
+                        assert Object.class.getName().equals(meta.valueClass("Organization"));
+                    }
+                    else {
+                        assert AffinityKey.class.getName().equals(meta.keyClass("Person"));
+                        assert Person.class.getName().equals(meta.valueClass("Person"));
+                        assert Organization.class.getName().equals(meta.valueClass("Organization"));
+                    }
+
                     assert String.class.getName().equals(meta.keyClass("Organization"));
                     assert String.class.getName().equals(meta.keyClass("String"));
-
-                    assert Person.class.getName().equals(meta.valueClass("Person"));
-                    assert Organization.class.getName().equals(meta.valueClass("Organization"));
                     assert String.class.getName().equals(meta.valueClass("String"));
 
                     Map<String, String> fields = meta.fields("Person");
 
                     assert fields != null;
                     assert fields.size() == 5;
-                    assert AffinityKey.class.getName().equals(fields.get("_KEY"));
-                    assert Person.class.getName().equals(fields.get("_VAL"));
+
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(fields.get("_KEY"));
+                        assert Object.class.getName().equals(fields.get("_VAL"));
+                        assert Integer.class.getName().equals(fields.get("AGE"));
+                        assert Integer.class.getName().equals(fields.get("ORGID"));
+                    }
+                    else {
+                        assert AffinityKey.class.getName().equals(fields.get("_KEY"));
+                        assert Person.class.getName().equals(fields.get("_VAL"));
+                        assert int.class.getName().equals(fields.get("AGE"));
+                        assert int.class.getName().equals(fields.get("ORGID"));
+                    }
+
                     assert String.class.getName().equals(fields.get("NAME"));
-                    assert int.class.getName().equals(fields.get("AGE"));
-                    assert int.class.getName().equals(fields.get("ORGID"));
 
                     fields = meta.fields("Organization");
 
                     assert fields != null;
                     assertEquals("Fields: " + fields, 5, fields.size());
+
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(fields.get("_VAL"));
+                        assert Integer.class.getName().equals(fields.get("ID"));
+                    }
+                    else {
+                        assert Organization.class.getName().equals(fields.get("_VAL"));
+                        assert int.class.getName().equals(fields.get("ID"));
+                    }
+
                     assert String.class.getName().equals(fields.get("_KEY"));
-                    assert Organization.class.getName().equals(fields.get("_VAL"));
-                    assert int.class.getName().equals(fields.get("ID"));
                     assert String.class.getName().equals(fields.get("NAME"));
 
                     fields = meta.fields("String");


Mime
View raw message