ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [12/50] [abbrv] ignite git commit: Fixed AtomicSequence test
Date Wed, 26 Apr 2017 13:25:23 GMT
Fixed AtomicSequence test


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

Branch: refs/heads/master
Commit: 26c222bd46e5fc725c2ad20815078792298d7869
Parents: b41ecd1
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Mon Apr 24 20:20:41 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Mon Apr 24 20:20:41 2017 +0300

----------------------------------------------------------------------
 .../datastructures/GridCacheAtomicReferenceImpl.java |  2 ++
 .../internal/IgniteClientReconnectAtomicsTest.java   | 15 +++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/26c222bd/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
index 0b0c202..d6fa2ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
@@ -166,6 +166,8 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
 
     /** {@inheritDoc} */
     @Override public boolean compareAndSet(final T expVal, final T newVal) {
+        checkRemoved();
+
         try {
             if (ctx.dataStructures().knownType(expVal) && ctx.dataStructures().knownType(newVal))
{
                 EntryProcessorResult<Boolean> res =

http://git-wip-us.apache.org/repos/asf/ignite/blob/26c222bd/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
index 4622fff..00daf5f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.IgniteCountDownLatch;
 import org.apache.ignite.IgniteLock;
 import org.apache.ignite.IgniteSemaphore;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
 import org.apache.ignite.testframework.GridTestUtils;
 
 /**
@@ -363,7 +364,7 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
 
         BlockTcpCommunicationSpi servCommSpi = commSpi(srv);
 
-        servCommSpi.blockMessage(GridNearLockResponse.class);
+        servCommSpi.blockMessage(GridNearTxPrepareResponse.class);
 
         final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>()
{
             @Override public Object call() throws Exception {
@@ -396,8 +397,6 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
         assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
 
         // Check that after reconnect working.
-        assertEquals("3st value", clientAtomicRef.get());
-        assertTrue(clientAtomicRef.compareAndSet("3st value", "4st value"));
         assertEquals("4st value", clientAtomicRef.get());
 
         assertEquals("4st value", srvAtomicRef.get());
@@ -523,7 +522,7 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
 
         BlockTcpCommunicationSpi servCommSpi = commSpi(srv);
 
-        servCommSpi.blockMessage(GridNearLockResponse.class);
+        servCommSpi.blockMessage(GridNearTxPrepareResponse.class);
 
         final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>()
{
             @Override public Object call() throws Exception {
@@ -556,7 +555,7 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
         assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
 
         // Check that after reconnect working.
-        assertEquals(true, clientAtomicStamped.compareAndSet(2, 3, 2, 3));
+        assertEquals(false, clientAtomicStamped.compareAndSet(2, 3, 2, 3));
         assertEquals(3, clientAtomicStamped.value());
         assertEquals(3, clientAtomicStamped.stamp());
 
@@ -655,7 +654,7 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
 
         final IgniteAtomicLong srvAtomicLong = srv.atomicLong("atomicLongInProggress", 0,
false);
 
-        commSpi.blockMessage(GridNearLockResponse.class);
+        commSpi.blockMessage(GridNearTxPrepareResponse.class);
 
         final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>()
{
             @Override public Object call() throws Exception {
@@ -688,8 +687,8 @@ public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstr
         assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
 
         // Check that after reconnect working.
-        assertEquals(1, clientAtomicLong.addAndGet(1));
-        assertEquals(2, srvAtomicLong.addAndGet(1));
+        assertEquals(2, clientAtomicLong.addAndGet(1));
+        assertEquals(3, srvAtomicLong.addAndGet(1));
 
         clientAtomicLong.close();
     }


Mime
View raw message