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());
}
Aggregations