You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/11/28 10:28:20 UTC
ignite git commit: IGNITE-4319:
IgniteCacheAbstractSqlDmlQuerySelfTest fix. This closes #1291.
Repository: ignite
Updated Branches:
refs/heads/ignite-1.8 b0127d3c5 -> 99eb4e0c8
IGNITE-4319: IgniteCacheAbstractSqlDmlQuerySelfTest fix. This closes #1291.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99eb4e0c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99eb4e0c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99eb4e0c
Branch: refs/heads/ignite-1.8
Commit: 99eb4e0c802a5c967a4b4feda5e7de252912b962
Parents: b0127d3
Author: Alexander Paschenko <al...@gmail.com>
Authored: Mon Nov 28 13:28:16 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Nov 28 13:28:16 2016 +0300
----------------------------------------------------------------------
.../IgniteCacheAbstractSqlDmlQuerySelfTest.java | 44 ++++++++++++++++----
1 file changed, 37 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/99eb4e0c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
index 123c32a..1424163 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
@@ -89,25 +89,53 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
startGridsMultiThreaded(3, true);
ignite(0).createCache(cacheConfig("S2P", true, false).setIndexedTypes(String.class, Person.class));
- ignite(0).createCache(createBinCacheConfig());
+
+ if (isBinaryMarshaller())
+ ignite(0).createCache(createBinCacheConfig());
}
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
+
+ // Put to S2P only non binary Persons
ignite(0).cache("S2P").put("FirstKey", new Person(1, "John", "White"));
ignite(0).cache("S2P").put("SecondKey", new Person(2, "Joe", "Black"));
ignite(0).cache("S2P").put("k3", new Person(3, "Sylvia", "Green"));
ignite(0).cache("S2P").put("f0u4thk3y", new Person(4, "Jane", "Silver"));
- ignite(0).cache("S2P-bin").put("FirstKey", createPerson(1, "John", "White"));
- ignite(0).cache("S2P-bin").put("SecondKey", createPerson(2, "Joe", "Black"));
- ignite(0).cache("S2P-bin").put("k3", createPerson(3, "Sylvia", "Green"));
- ignite(0).cache("S2P-bin").put("f0u4thk3y", createPerson(4, "Jane", "Silver"));
+ if (isBinaryMarshaller()) {
+ ignite(0).cache("S2P-bin").put("FirstKey", createBinPerson(1, "John", "White"));
+ ignite(0).cache("S2P-bin").put("SecondKey", createBinPerson(2, "Joe", "Black"));
+ ignite(0).cache("S2P-bin").put("k3", createBinPerson(3, "Sylvia", "Green"));
+ ignite(0).cache("S2P-bin").put("f0u4thk3y", createBinPerson(4, "Jane", "Silver"));
+ }
}
- /** */
+ /**
+ * Create person.
+ *
+ * @param id ID.
+ * @param name Name.
+ * @param secondName Second name.
+ * @return Person.
+ */
Object createPerson(int id, String name, String secondName) {
+ if (!isBinaryMarshaller())
+ return new Person(id, name, secondName);
+ else
+ return createBinPerson(id, name, secondName);
+ }
+
+ /**
+ * Create binary person.
+ *
+ * @param id ID.
+ * @param name Name.
+ * @param secondName Second name.
+ * @return Person.
+ */
+ private Object createBinPerson(int id, String name, String secondName) {
BinaryObjectBuilder bldr = ignite(0).binary().builder("Person");
bldr.setField("id", id);
@@ -117,7 +145,9 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
return bldr.build();
}
- /** */
+ /**
+ * @return Cache.
+ */
protected IgniteCache cache() {
if (!isBinaryMarshaller())
return ignite(0).cache("S2P");