You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2016/01/27 21:36:44 UTC

ignite git commit: 2224-3

Repository: ignite
Updated Branches:
  refs/heads/ignite-2224-3 fdabdbf96 -> 4f97b2f17


2224-3


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

Branch: refs/heads/ignite-2224-3
Commit: 4f97b2f1783921b6eafd6c6d0446fc16d8e30bb5
Parents: fdabdbf
Author: Anton Vinogradov <av...@apache.org>
Authored: Wed Jan 27 23:36:44 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Wed Jan 27 23:36:44 2016 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java | 59 +++++++++++---------
 1 file changed, 33 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4f97b2f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 3f4f06c..4d8c8e5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -757,47 +757,54 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         // Now do the same checks but within transaction.
         if (txShouldBeUsed()) {
             try (Transaction tx0 = transactions().txStart()) {
-                assert cache.getEntries(Collections.<String>emptySet()).isEmpty();
+                try {
+                    assert cache.getEntries(Collections.<String>emptySet()).isEmpty();
 
-                c1 = cache.getEntries(ImmutableSet.of("key1", "key2", "key9999"));
+                    c1 = cache.getEntries(ImmutableSet.of("key1", "key2", "key9999"));
 
-                info("Retrieved c1: " + c1);
+                    info("Retrieved c1: " + c1);
 
-                assert 2 == c1.size() : "Invalid collection: " + c1;
+                    assert 2 == c1.size() : "Invalid collection: " + c1;
 
-                b1 = false;
-                b2 = false;
+                    b1 = false;
+                    b2 = false;
 
-                for (CacheEntry<String, Integer> e: c1){
-                    if (e.getKey().equals("key1") && e.getValue().equals(1))
-                        b1 = true;
+                    for (CacheEntry<String, Integer> e : c1) {
+                        if (e.getKey().equals("key1") && e.getValue().equals(1))
+                            b1 = true;
 
-                    if (e.getKey().equals("key2") && e.getValue().equals(2))
-                        b2 = true;
-                }
+                        if (e.getKey().equals("key2") && e.getValue().equals(2))
+                            b2 = true;
+                    }
 
-                assertTrue(b1 && b2);
+                    assertTrue(b1 && b2);
 
-                c2 = cache.getEntries(ImmutableSet.of("key1", "key2", "key9999"));
+                    c2 = cache.getEntries(ImmutableSet.of("key1", "key2", "key9999"));
 
-                info("Retrieved c2: " + c2);
+                    info("Retrieved c2: " + c2);
 
-                assert 2 == c2.size() : "Invalid collection: " + c2;
+                    assert 2 == c2.size() : "Invalid collection: " + c2;
 
-                b1 = false;
-                b2 = false;
+                    b1 = false;
+                    b2 = false;
 
-                for (CacheEntry<String, Integer> e: c2){
-                    if (e.getKey().equals("key1") && e.getValue().equals(1))
-                        b1 = true;
+                    for (CacheEntry<String, Integer> e : c2) {
+                        if (e.getKey().equals("key1") && e.getValue().equals(1))
+                            b1 = true;
 
-                    if (e.getKey().equals("key2") && e.getValue().equals(2))
-                        b2 = true;
-                }
+                        if (e.getKey().equals("key2") && e.getValue().equals(2))
+                            b2 = true;
+                    }
 
-                assertTrue(b1 && b2);
+                    assertTrue(b1 && b2);
 
-                tx0.commit();
+                    tx0.commit();
+                }
+                catch (Exception e) {
+                    assert tx0.isolation() == TransactionIsolation.REPEATABLE_READ ||
+                        (tx0.isolation() == TransactionIsolation.SERIALIZABLE &&
+                            tx0.concurrency() == TransactionConcurrency.PESSIMISTIC);
+                }
             }
         }
     }