Search in sources :

Example 56 with DistributedMember

use of org.apache.geode.distributed.DistributedMember in project geode by apache.

the class CacheManagementDUnitTest method testGemFireConfigData.

@Test
public void testGemFireConfigData() throws Exception {
    this.managementTestRule.createMembers();
    this.managementTestRule.createManagers();
    Map<DistributedMember, DistributionConfig> configMap = new HashMap<>();
    for (VM memberVM : this.memberVMs) {
        Map<DistributedMember, DistributionConfig> configMapMember = memberVM.invoke(() -> verifyConfigData());
        configMap.putAll(configMapMember);
    }
    this.managerVM.invoke(() -> verifyConfigDataRemote(configMap));
}
Also used : DistributionConfig(org.apache.geode.distributed.internal.DistributionConfig) HashMap(java.util.HashMap) VM(org.apache.geode.test.dunit.VM) DistributedMember(org.apache.geode.distributed.DistributedMember) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 57 with DistributedMember

use of org.apache.geode.distributed.DistributedMember in project geode by apache.

the class ClientHealthStatsDUnitTest method testClientHealthStats_SubscriptionEnabled.

@Test
public void testClientHealthStats_SubscriptionEnabled() throws Exception {
    this.managementTestRule.createManager(this.managerVM, false);
    this.managementTestRule.startManager(this.managerVM);
    int port = this.serverVM.invoke(() -> createServerCache());
    this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true));
    this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, true));
    DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
    this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 2));
    this.managementTestRule.stopManager(this.managerVM);
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 58 with DistributedMember

use of org.apache.geode.distributed.DistributedMember in project geode by apache.

the class ClientHealthStatsDUnitTest method testClientHealthStats_DurableClient.

@Test
public void testClientHealthStats_DurableClient() throws Exception {
    this.managementTestRule.createManager(this.managerVM, false);
    this.managementTestRule.startManager(this.managerVM);
    int port = this.serverVM.invoke(() -> createServerCache());
    this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, true));
    this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, true));
    this.client1VM.invoke(() -> clientCache.close(true));
    this.client2VM.invoke(() -> clientCache.close(true));
    DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
    this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 2));
    this.managementTestRule.stopManager(this.managerVM);
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 59 with DistributedMember

use of org.apache.geode.distributed.DistributedMember in project geode by apache.

the class ClientHealthStatsDUnitTest method testClientHealthStats_SubscriptionDisabled.

@Test
public void testClientHealthStats_SubscriptionDisabled() throws Exception {
    this.managementTestRule.createManager(this.managerVM, false);
    this.managementTestRule.startManager(this.managerVM);
    int port = this.serverVM.invoke(() -> createServerCache());
    this.client1VM.invoke(() -> createClientCache(this.hostName, port, 1, false));
    this.client2VM.invoke(() -> createClientCache(this.hostName, port, 2, false));
    DistributedMember serverMember = this.managementTestRule.getDistributedMember(this.serverVM);
    this.managerVM.invoke(() -> verifyClientStats(serverMember, port, 0));
    this.managementTestRule.stopManager(this.managerVM);
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 60 with DistributedMember

use of org.apache.geode.distributed.DistributedMember 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)

Aggregations

DistributedMember (org.apache.geode.distributed.DistributedMember)360 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)120 Test (org.junit.Test)109 HashSet (java.util.HashSet)83 InternalCache (org.apache.geode.internal.cache.InternalCache)83 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)82 ArrayList (java.util.ArrayList)64 VM (org.apache.geode.test.dunit.VM)60 CliCommand (org.springframework.shell.core.annotation.CliCommand)59 CliMetaData (org.apache.geode.management.cli.CliMetaData)57 Result (org.apache.geode.management.cli.Result)56 Set (java.util.Set)49 ResourceOperation (org.apache.geode.management.internal.security.ResourceOperation)49 List (java.util.List)48 Cache (org.apache.geode.cache.Cache)47 Region (org.apache.geode.cache.Region)42 HashMap (java.util.HashMap)39 CliFunctionResult (org.apache.geode.management.internal.cli.functions.CliFunctionResult)39 TabularResultData (org.apache.geode.management.internal.cli.result.TabularResultData)39 FunctionException (org.apache.geode.cache.execute.FunctionException)37