You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2018/03/01 14:57:07 UTC
ignite git commit: IGNITE-7789 Fixed
IgniteClientReconnectApiExceptionTest - Fixes #3588.
Repository: ignite
Updated Branches:
refs/heads/master 623d3b6fa -> dbcf2244d
IGNITE-7789 Fixed IgniteClientReconnectApiExceptionTest - Fixes #3588.
Signed-off-by: Alexey Goncharuk <al...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dbcf2244
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dbcf2244
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dbcf2244
Branch: refs/heads/master
Commit: dbcf2244dd77e097eb5746120791ce94a5aec5c9
Parents: 623d3b6
Author: Maxim Muzafarov <ma...@gmail.com>
Authored: Thu Mar 1 17:55:34 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Mar 1 17:55:34 2018 +0300
----------------------------------------------------------------------
.../IgniteClientReconnectApiExceptionTest.java | 26 ++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/dbcf2244/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
index 07b655d..06bde99 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
@@ -39,6 +39,7 @@ import org.apache.ignite.IgniteQueue;
import org.apache.ignite.IgniteSet;
import org.apache.ignite.IgniteTransactions;
import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.configuration.AtomicConfiguration;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.CollectionConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
@@ -60,6 +61,10 @@ import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED;
*
*/
public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnectAbstractTest {
+
+ /** Cache key for test put and invoke operation after reconnect */
+ private final static int CACHE_PUT_INVOKE_KEY = 10010;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -139,7 +144,7 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
boolean failed = false;
try {
- client.set("testSet", new CollectionConfiguration());
+ client.set("testSet", getCollectionConfiguration());
}
catch (IgniteClientDisconnectedException e) {
failed = true;
@@ -149,7 +154,7 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
assertTrue(failed);
- return client.set("testSet", new CollectionConfiguration());
+ return client.set("testSet", getCollectionConfiguration());
}
},
new C1<Object, Boolean>() {
@@ -176,7 +181,7 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
boolean failed = false;
try {
- client.queue("TestQueue", 10, new CollectionConfiguration());
+ client.queue("TestQueue", 10, getCollectionConfiguration());
}
catch (IgniteClientDisconnectedException e) {
failed = true;
@@ -186,7 +191,7 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
assertTrue(failed);
- return client.queue("TestQueue", 10, new CollectionConfiguration());
+ return client.queue("TestQueue", 10, getCollectionConfiguration());
}
},
new C1<Object, Boolean>() {
@@ -314,14 +319,15 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
}
}
),
- // Check invoke operation.
+ // Check put and invoke operation.
new T2<Callable, C1<Object, Boolean>>(
new Callable() {
@Override public Object call() throws Exception {
boolean failed = false;
try {
- dfltCache.invoke(10000, new CacheEntryProcessor<Object, Object, Object>() {
+ dfltCache.put(CACHE_PUT_INVOKE_KEY, 10000);
+ dfltCache.invoke(CACHE_PUT_INVOKE_KEY, new CacheEntryProcessor<Object, Object, Object>() {
@Override public Object process(MutableEntry<Object, Object> entry,
Object... arguments) throws EntryProcessorException {
assertTrue(entry.exists());
@@ -338,7 +344,8 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
assertTrue(failed);
- return dfltCache.invoke(10000, new CacheEntryProcessor<Object, Object, Object>() {
+ dfltCache.put(CACHE_PUT_INVOKE_KEY, 10000);
+ return dfltCache.invoke(CACHE_PUT_INVOKE_KEY, new CacheEntryProcessor<Object, Object, Object>() {
@Override public Object process(MutableEntry<Object, Object> entry,
Object... arguments) throws EntryProcessorException {
assertTrue(entry.exists());
@@ -858,4 +865,9 @@ public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnect
stopAllGrids();
}
}
+
+ /** Get {@link CollectionConfiguration} with number of backups equal to {@link AtomicConfiguration} default */
+ private CollectionConfiguration getCollectionConfiguration() {
+ return new CollectionConfiguration().setBackups(AtomicConfiguration.DFLT_BACKUPS);
+ }
}