Search in sources :

Example 1 with IgniteClusterMXBean

use of org.apache.ignite.mxbean.IgniteClusterMXBean in project gridgain by gridgain.

the class IgniteClusterIdTagTest method testChangeClusterTagWithJMX.

/**
 * Verifies that Cluster ID and tag are available through JMX interface both for read and write.
 *
 * @throws Exception If failed.
 */
@Test
public void testChangeClusterTagWithJMX() throws Exception {
    String srvName = "srv0";
    String newTag = "newTag0";
    IgniteEx srv0 = startGrid(srvName);
    IgniteClusterMXBean clustMxBean = getMxBean(srvName, "IgniteCluster", IgniteClusterMXBean.class, IgniteClusterMXBeanImpl.class);
    assertNotNull(clustMxBean.getId());
    assertNotNull(clustMxBean.getTag());
    assertEquals(srv0.cluster().id(), clustMxBean.getId());
    assertEquals(srv0.cluster().tag(), clustMxBean.getTag());
    clustMxBean.tag(newTag);
    assertEquals(newTag, srv0.cluster().tag());
    clustMxBean.id(CUSTOM_ID_0);
    assertEquals(CUSTOM_ID_0, srv0.cluster().id());
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteClusterMXBean(org.apache.ignite.mxbean.IgniteClusterMXBean) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)1 IgniteClusterMXBean (org.apache.ignite.mxbean.IgniteClusterMXBean)1 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)1 Test (org.junit.Test)1