forked from apache/ignite
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GG-25038 Extend test coverage [GG-25026] Jconsole does not show metri…
…cs implemented in GG-21273
- Loading branch information
vmalin
committed
Nov 25, 2019
1 parent
3dd983f
commit 94347f6
Showing
8 changed files
with
329 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
modules/core/src/test/java/org/apache/ignite/internal/GridMbeansMiscTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* | ||
* Copyright 2019 GridGain Systems, Inc. and Contributors. | ||
* | ||
* Licensed under the GridGain Community Edition License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license | ||
* | ||
* 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; | ||
|
||
import org.apache.ignite.Ignite; | ||
import org.apache.ignite.configuration.IgniteConfiguration; | ||
import org.apache.ignite.spi.checkpoint.CheckpointSpi; | ||
import org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi; | ||
import org.apache.ignite.spi.collision.CollisionSpi; | ||
import org.apache.ignite.spi.collision.fifoqueue.FifoQueueCollisionSpi; | ||
import org.apache.ignite.spi.collision.priorityqueue.PriorityQueueCollisionSpi; | ||
import org.apache.ignite.spi.deployment.DeploymentSpi; | ||
import org.apache.ignite.spi.deployment.local.LocalDeploymentSpi; | ||
import org.apache.ignite.spi.loadbalancing.LoadBalancingSpi; | ||
import org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveLoadBalancingSpi; | ||
import org.apache.ignite.spi.loadbalancing.weightedrandom.WeightedRandomLoadBalancingSpi; | ||
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Checks mbeans validity for miscelenious spis. | ||
*/ | ||
public class GridMbeansMiscTest extends GridCommonAbstractTest { | ||
/** */ | ||
private CollisionSpi collisionSpi; | ||
|
||
/** */ | ||
private LoadBalancingSpi loadBalancingSpi; | ||
|
||
/** */ | ||
private DeploymentSpi deploymentSpi; | ||
|
||
/** */ | ||
private CheckpointSpi checkpointSpi; | ||
|
||
/** {@inheritDoc} */ | ||
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { | ||
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); | ||
|
||
if (collisionSpi != null) | ||
cfg.setCollisionSpi(collisionSpi); | ||
|
||
if (loadBalancingSpi != null) | ||
cfg.setLoadBalancingSpi(loadBalancingSpi); | ||
|
||
if (deploymentSpi != null) | ||
cfg.setDeploymentSpi(deploymentSpi); | ||
|
||
if (checkpointSpi != null) | ||
cfg.setCheckpointSpi(checkpointSpi); | ||
|
||
return cfg; | ||
} | ||
|
||
/** | ||
* @throws Exception If failed. | ||
*/ | ||
@Test | ||
public void testMbeansSet1() throws Exception { | ||
collisionSpi = new FifoQueueCollisionSpi(); | ||
loadBalancingSpi = new WeightedRandomLoadBalancingSpi(); | ||
deploymentSpi = new LocalDeploymentSpi(); | ||
checkpointSpi = new SharedFsCheckpointSpi(); | ||
|
||
String[] beansToValidate = new String[] { | ||
"org.apache.ignite.spi.collision.fifoqueue.FifoQueueCollisionSpi$FifoQueueCollisionSpiMBeanImpl", | ||
"org.apache.ignite.spi.loadbalancing.weightedrandom.WeightedRandomLoadBalancingSpi$WeightedRandomLoadBalancingSpiMBeanImpl", | ||
"org.apache.ignite.spi.deployment.local.LocalDeploymentSpi$LocalDeploymentSpiMBeanImpl", | ||
"org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi$SharedFsCheckpointSpiMBeanImpl" | ||
}; | ||
|
||
doTest(beansToValidate); | ||
} | ||
|
||
/** | ||
* @throws Exception If failed. | ||
*/ | ||
@Test | ||
public void testMbeansSet2() throws Exception { | ||
collisionSpi = new PriorityQueueCollisionSpi(); | ||
loadBalancingSpi = new AdaptiveLoadBalancingSpi(); | ||
|
||
String[] beansToValidate = new String[] { | ||
"org.apache.ignite.spi.collision.priorityqueue.PriorityQueueCollisionSpi$PriorityQueueCollisionSpiMBeanImpl", | ||
"org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveLoadBalancingSpi$AdaptiveLoadBalancingSpiMBeanImpl" | ||
}; | ||
|
||
doTest(beansToValidate); | ||
} | ||
|
||
/** */ | ||
private void doTest(String[] beansToValidate) throws Exception { | ||
try { | ||
Ignite ignite = startGrid(); | ||
|
||
validateMbeans(ignite, beansToValidate); | ||
} | ||
finally { | ||
stopAllGrids(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.