Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-741 [created] e8107e917


# IGNITE-741 Added test for IgniteH2Indexing with Character type.


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

Branch: refs/heads/ignite-741
Commit: e8107e91793733ea8ee5a6d286cbb5e1836ea28d
Parents: 59b11b4
Author: AKuznetsov <akuznet...@gridgain.com>
Authored: Tue Apr 14 10:19:10 2015 +0700
Committer: AKuznetsov <akuznet...@gridgain.com>
Committed: Tue Apr 14 10:19:10 2015 +0700

----------------------------------------------------------------------
 .../cache/GridCachePutCharacterSelfTest.java    | 79 ++++++++++++++++++++
 .../IgniteCacheWithIndexingTestSuite.java       |  1 +
 2 files changed, 80 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8107e91/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutCharacterSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutCharacterSelfTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutCharacterSelfTest.java
new file mode 100644
index 0000000..69f12ed
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutCharacterSelfTest.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Test that entries are indexed on load/reload methods.
+ */
+public class GridCachePutCharacterSelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new 
TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    public GridCachePutCharacterSelfTest() {
+        super(true);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration cache = defaultCacheConfiguration();
+
+        cache.setCacheMode(CacheMode.PARTITIONED);
+        
cache.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
+        cache.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+        cache.setIndexedTypes(Character.class, Character.class);
+
+        cfg.setCacheConfiguration(cache);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(disco);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        jcache().removeAll();
+
+        assert jcache().size() == 0;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLoadFromArgs() throws Exception {
+        IgniteCache<Object, Object> cache = jcache();
+
+        cache.put('X', 'Y');
+
+        assert cache.size() == 1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8107e91/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
index a2ccc82..426cbd1 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
@@ -36,6 +36,7 @@ public class IgniteCacheWithIndexingTestSuite extends 
TestSuite {
         suite.addTestSuite(GridIndexingWithNoopSwapSelfTest.class);
         suite.addTestSuite(GridCacheSwapSelfTest.class);
         suite.addTestSuite(GridCacheOffHeapSelfTest.class);
+        suite.addTestSuite(GridCachePutCharacterSelfTest.class);
 
         suite.addTestSuite(CacheTtlOffheapAtomicLocalSelfTest.class);
         suite.addTestSuite(CacheTtlOffheapAtomicPartitionedSelfTest.class);

Reply via email to