ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/38] incubator-ignite git commit: ignite-946: improving tests
Date Mon, 17 Aug 2015 06:36:21 GMT
ignite-946: improving tests


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

Branch: refs/heads/ignite-426
Commit: 4b9f4bad4191c357418996abc88748208461f18a
Parents: 325d06d
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jul 31 10:19:46 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Jul 31 15:49:11 2015 +0300

----------------------------------------------------------------------
 .../cache/query/GridCacheQueryManager.java      |  1 +
 .../CacheVersionedEntryAbstractTest.java        | 24 ++++++-----
 .../CacheVersionedEntryLocalAtomicSelfTest.java | 40 -----------------
 ...nedEntryLocalAtomicSwapDisabledSelfTest.java | 45 ++++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite4.java       |  2 +-
 5 files changed, 60 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b9f4bad/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 5d3f6a3..400d997 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -845,6 +845,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
                         try {
                             val = prj.localPeek(key, CachePeekModes.ONHEAP_ONLY, expiryPlc);
+
                         }
                         catch (IgniteCheckedException e) {
                             if (log.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b9f4bad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index 951d05a..4cfacb7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -55,23 +55,25 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
     public void testInvoke() throws Exception {
         Cache<Integer, String> cache = grid(0).cache(null);
 
-        final AtomicBoolean invoked = new AtomicBoolean(false);
+        final AtomicInteger invoked = new AtomicInteger();
 
-        cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
-            @Override public Object process(MutableEntry<Integer, String> entry, Object...
arguments)
-                throws EntryProcessorException {
+        for (int i = 0; i < ENTRIES_NUM; i++) {
+            cache.invoke(i, new EntryProcessor<Integer, String, Object>() {
+                @Override public Object process(MutableEntry<Integer, String> entry,
Object... arguments)
+                    throws EntryProcessorException {
 
-                invoked.set(true);
+                    invoked.incrementAndGet();
 
-                VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+                    VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
 
-                checkVersionedEntry(verEntry);
+                    checkVersionedEntry(verEntry);
 
-                return entry;
-            }
-        });
+                    return entry;
+                }
+            });
+        }
 
-        assertTrue(invoked.get());
+        assert invoked.get() > 0;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b9f4bad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
deleted file mode 100644
index a340413..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.version;
-
-import org.apache.ignite.cache.*;
-
-/**
- *
- */
-public class CacheVersionedEntryLocalAtomicSelfTest extends CacheVersionedEntryAbstractTest
{
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return CacheMode.LOCAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return CacheAtomicityMode.ATOMIC;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b9f4bad/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
new file mode 100644
index 0000000..b0035d1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryLocalAtomicSwapDisabledSelfTest extends CacheVersionedEntryAbstractTest
{
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean swapEnabled() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b9f4bad/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index dd9c799..3ac7879 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -155,7 +155,7 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(CacheReadThroughAtomicRestartSelfTest.class);
 
         // Versioned entry tests
-        suite.addTestSuite(CacheVersionedEntryLocalAtomicSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.class);
         suite.addTestSuite(CacheVersionedEntryLocalTransactionalSelfTest.class);
         suite.addTestSuite(CacheVersionedEntryPartitionedAtomicSelfTest.class);
         suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class);


Mime
View raw message