Search in sources :

Example 16 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class DLockManagementDUnitTest method awaitLockServiceMXBeanIsNull.

/**
   * Await destruction of local LockServiceMXBean for specified lockServiceName.
   */
private void awaitLockServiceMXBeanIsNull(final String lockServiceName) {
    SystemManagementService service = this.managementTestRule.getSystemManagementService();
    await().until(() -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNull());
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Example 17 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class DLockManagementDUnitTest method awaitLockServiceMXBean.

/**
   * Await creation of local LockServiceMXBean for specified lockServiceName.
   */
private LockServiceMXBean awaitLockServiceMXBean(final String lockServiceName) {
    SystemManagementService service = this.managementTestRule.getSystemManagementService();
    await().until(() -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNotNull());
    return service.getLocalLockServiceMBean(lockServiceName);
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Example 18 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class DiskManagementDUnitTest method compactDiskStoresRemote.

/**
   * Compact a disk store from managerVM VM
   */
private void compactDiskStoresRemote(final VM managerVM, final int memberCount) {
    managerVM.invoke("compactDiskStoresRemote", () -> {
        Set<DistributedMember> otherMemberSet = this.managementTestRule.getOtherNormalMembers();
        assertThat(otherMemberSet.size()).isEqualTo(memberCount);
        SystemManagementService service = this.managementTestRule.getSystemManagementService();
        for (DistributedMember member : otherMemberSet) {
            MemberMXBean memberMXBean = awaitMemberMXBeanProxy(member);
            String[] allDisks = memberMXBean.listDiskStores(true);
            assertThat(allDisks).isNotNull().hasSize(1);
            String[] compactedDiskStores = memberMXBean.compactAllDiskStores();
            assertThat(compactedDiskStores).hasSize(1);
        }
    });
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Example 19 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class DiskManagementDUnitTest method awaitMemberMXBeanProxy.

private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
    SystemManagementService service = this.managementTestRule.getSystemManagementService();
    ObjectName objectName = service.getMemberMBeanName(member);
    await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
    return service.getMBeanProxy(objectName, MemberMXBean.class);
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 20 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method createSubRegion_tmp.

private void createSubRegion_tmp(final VM vm, final String parentRegionPath, final String subregionName) {
    vm.invoke("Create Sub region", () -> {
        SystemManagementService service = getSystemManagementService_tmp();
        Region region = getCache_tmp().getRegion(parentRegionPath);
        region.createSubregion(subregionName, region.getAttributes());
    });
}
Also used : AbstractRegion(org.apache.geode.internal.cache.AbstractRegion) Region(org.apache.geode.cache.Region) SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Aggregations

SystemManagementService (org.apache.geode.management.internal.SystemManagementService)83 ObjectName (javax.management.ObjectName)56 DistributedMember (org.apache.geode.distributed.DistributedMember)31 CacheServerMXBean (org.apache.geode.management.CacheServerMXBean)15 InternalCache (org.apache.geode.internal.cache.InternalCache)14 VM (org.apache.geode.test.dunit.VM)14 TabularResultData (org.apache.geode.management.internal.cli.result.TabularResultData)13 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)12 ExecutionException (java.util.concurrent.ExecutionException)11 CliMetaData (org.apache.geode.management.cli.CliMetaData)11 Result (org.apache.geode.management.cli.Result)11 CommandResultException (org.apache.geode.management.internal.cli.result.CommandResultException)11 ResourceOperation (org.apache.geode.management.internal.security.ResourceOperation)11 CliCommand (org.springframework.shell.core.annotation.CliCommand)11 CliFunctionResult (org.apache.geode.management.internal.cli.functions.CliFunctionResult)10 WaitCriterion (org.apache.geode.test.dunit.WaitCriterion)8 Test (org.junit.Test)8 GatewaySenderMXBean (org.apache.geode.management.GatewaySenderMXBean)7 CompositeResultData (org.apache.geode.management.internal.cli.result.CompositeResultData)7 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)7