You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/06/10 06:20:46 UTC
[15/19] ignite git commit: ignite-5155
ignite-5155
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e28efb1c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e28efb1c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e28efb1c
Branch: refs/heads/ignite-5155
Commit: e28efb1c646dca7782ff65b12214e8d53101d089
Parents: acf211c
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 9 17:34:57 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 9 17:34:57 2017 +0300
----------------------------------------------------------------------
...agnosticMessagesMultipleConnectionsTest.java | 35 ---------------
.../managers/IgniteDiagnosticMessagesTest.java | 47 ++++++++++++++------
.../ignite/testsuites/IgniteBasicTestSuite.java | 2 -
3 files changed, 33 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e28efb1c/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesMultipleConnectionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesMultipleConnectionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesMultipleConnectionsTest.java
deleted file mode 100644
index 6b77704..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesMultipleConnectionsTest.java
+++ /dev/null
@@ -1,35 +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.managers;
-
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
-
-/**
- *
- */
-public class IgniteDiagnosticMessagesMultipleConnectionsTest extends IgniteDiagnosticMessagesTest {
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setConnectionsPerNode(5);
-
- return cfg;
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e28efb1c/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
index d308fcc..011fdc9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -47,12 +48,18 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
/** */
private boolean client;
+ /** */
+ private Integer connectionsPerNode;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+ if (connectionsPerNode != null)
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setConnectionsPerNode(connectionsPerNode);
+
cfg.setClientMode(client);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
@@ -67,36 +74,48 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- super.beforeTestsStarted();
-
- startGrids(3);
-
- client = true;
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
- startGrid(3);
+ super.afterTestsStopped();
+ }
- startGrid(4);
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDiagnosticMessages1() throws Exception {
+ checkBasicDiagnosticInfo();
}
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDiagnosticMessages2() throws Exception {
+ connectionsPerNode = 5;
- super.afterTestsStopped();
+ checkBasicDiagnosticInfo();
}
/**
* @throws Exception If failed.
*/
- public void testDiagnosticMessages() throws Exception {
+ private void checkBasicDiagnosticInfo() throws Exception {
+ startGrids(3);
+
+ client = true;
+
+ startGrid(3);
+
+ startGrid(4);
+
awaitPartitionMapExchange();
sendDiagnostic();
for (int i = 0; i < 5; i++) {
- final IgniteCache cache = ignite(i).cache(DEFAULT_CACHE_NAME);
+ final IgniteCache<Object, Object> cache = ignite(i).cache(DEFAULT_CACHE_NAME);
+ // Put from multiple threads to create multiple connections.
GridTestUtils.runMultiThreaded(new Runnable() {
@Override public void run() {
for (int j = 0; j < 10; j++)
http://git-wip-us.apache.org/repos/asf/ignite/blob/e28efb1c/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index cc25aca..140b1a5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -35,7 +35,6 @@ import org.apache.ignite.internal.GridStopWithCancelSelfTest;
import org.apache.ignite.internal.IgniteLocalNodeMapBeforeStartTest;
import org.apache.ignite.internal.IgniteSlowClientDetectionSelfTest;
import org.apache.ignite.internal.MarshallerContextLockingSelfTest;
-import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesMultipleConnectionsTest;
import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesTest;
import org.apache.ignite.internal.processors.affinity.GridAffinityProcessorRendezvousSelfTest;
import org.apache.ignite.internal.processors.cache.GridLocalIgniteSerializationTest;
@@ -177,7 +176,6 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTestSuite(IgniteMarshallerCacheClientRequestsMappingOnMissTest.class);
suite.addTestSuite(IgniteDiagnosticMessagesTest.class);
- suite.addTestSuite(IgniteDiagnosticMessagesMultipleConnectionsTest.class);
return suite;
}