use of org.apache.geode.management.ManagementService in project geode by apache.
the class TestCQDUnitTest method getNumOfCQ.
public static long getNumOfCQ() {
final WaitCriterion waitCriteria = new WaitCriterion() {
@Override
public boolean done() {
final ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
if (bean != null) {
if (bean.getActiveCQCount() > 0) {
return true;
}
}
return false;
}
@Override
public String description() {
return "wait for getNumOfCQ to complete and get results";
}
};
Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
final DistributedSystemMXBean bean = getManagementService().getDistributedSystemMXBean();
assertNotNull(bean);
return bean.getActiveCQCount();
}
use of org.apache.geode.management.ManagementService in project geode by apache.
the class TestClientsDUnitTest method getNumOfClients.
public static Integer getNumOfClients() {
final WaitCriterion waitCriteria = new WaitCriterion() {
@Override
public boolean done() {
final ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
if (bean != null) {
if (bean.getNumClients() > 0) {
return true;
}
}
return false;
}
@Override
public String description() {
return "wait for getNumOfClients bean to complete and get results";
}
};
Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
final DistributedSystemMXBean bean = getManagementService().getDistributedSystemMXBean();
assertNotNull(bean);
return Integer.valueOf(bean.getNumClients());
}
use of org.apache.geode.management.ManagementService in project geode by apache.
the class TestServerDUnitTest method getNumOfServersFromMBean.
public static int getNumOfServersFromMBean() {
final WaitCriterion waitCriteria = new WaitCriterion() {
@Override
public boolean done() {
final ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
if (bean != null) {
if (bean.listCacheServers().length > 0) {
return true;
}
}
return false;
}
@Override
public String description() {
return "wait for getDistributedSystemMXBean to complete and get results";
}
};
Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
final DistributedSystemMXBean bean = getManagementService().getDistributedSystemMXBean();
assertNotNull(bean);
return bean.listCacheServers().length;
}
use of org.apache.geode.management.ManagementService in project geode by apache.
the class MBeanSecurityJUnitTest method testServerSideCalls.
@Test
@ConnectionConfiguration(user = "stranger", password = "1234567")
public void testServerSideCalls() {
// calls through ManagementService is not going through authorization checks
ManagementService service = ManagementService.getManagementService(server.getCache());
MemberMXBean bean = service.getMemberMXBean();
bean.compactAllDiskStores();
}
use of org.apache.geode.management.ManagementService in project geode by apache.
the class TestLocatorsDUnitTest method getNumOfLocatorFromMBean.
public static int getNumOfLocatorFromMBean() {
final WaitCriterion waitCriteria = new WaitCriterion() {
@Override
public boolean done() {
final ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
if (bean != null) {
if (bean.getLocatorCount() > 0) {
return true;
}
}
return false;
}
@Override
public String description() {
return "wait for getNumOfLocatorFromMBean to complete and get results";
}
};
Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 2000, true);
final DistributedSystemMXBean bean = getManagementService().getDistributedSystemMXBean();
assertNotNull(bean);
return bean.getLocatorCount();
}
Aggregations