use of org.apache.geode.distributed.DistributedMember in project geode by apache.
the class CacheManagementDUnitTest method verifyConfigData.
private Map<DistributedMember, DistributionConfig> verifyConfigData() {
ManagementService service = this.managementTestRule.getManagementService();
InternalDistributedSystem ids = (InternalDistributedSystem) this.managementTestRule.getCache().getDistributedSystem();
DistributionConfig config = ids.getConfig();
MemberMXBean bean = service.getMemberMXBean();
GemFireProperties data = bean.listGemFireProperties();
verifyGemFirePropertiesData(config, data);
Map<DistributedMember, DistributionConfig> configMap = new HashMap<>();
configMap.put(ids.getDistributedMember(), config);
return configMap;
}
use of org.apache.geode.distributed.DistributedMember in project geode by apache.
the class CacheManagementDUnitTest method verifyQueryMBeans.
private void verifyQueryMBeans(final VM managerVM) {
managerVM.invoke("validateQueryMBeans", () -> {
ManagementService service = this.managementTestRule.getManagementService();
Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
Set<ObjectName> superSet = new HashSet<>();
for (DistributedMember member : otherMembers) {
ObjectName memberMBeanName = service.getMemberMBeanName(member);
awaitMemberMXBeanProxy(member);
Set<ObjectName> objectNames = service.queryMBeanNames(member);
superSet.addAll(objectNames);
assertThat(objectNames.contains(memberMBeanName)).isTrue();
}
Set<ObjectName> names = service.queryMBeanNames(this.managementTestRule.getDistributedMember());
ObjectName[] arrayOfNames = names.toArray(new ObjectName[names.size()]);
// TODO: what value does this assertion
assertThat(superSet).doesNotContain(arrayOfNames);
// have?
});
}
use of org.apache.geode.distributed.DistributedMember in project geode by apache.
the class CacheManagementDUnitTest method testManager.
/**
* Creates and starts a managerVM. Multiple Managers
*/
@Test
public void testManager() throws Exception {
this.managementTestRule.createMember(this.memberVMs[0]);
this.managementTestRule.createMember(this.memberVMs[1]);
this.managementTestRule.createManager(this.memberVMs[2], false);
this.managementTestRule.createManager(this.managerVM, false);
this.memberVMs[2].invoke(() -> startManager());
// Now start Managing node managerVM. System will have two Managers now which
// should be OK
DistributedMember member = this.managementTestRule.getDistributedMember(this.memberVMs[2]);
this.managementTestRule.startManager(this.managerVM);
verifyManagerStarted(this.managerVM, member);
this.managementTestRule.stopManager(this.managerVM);
}
use of org.apache.geode.distributed.DistributedMember in project geode by apache.
the class CacheManagementDUnitTest method verifyConfigDataRemote.
/**
* This is to check whether the config data has been propagated to the Managing node properly or
* not.
*/
private void verifyConfigDataRemote(final Map<DistributedMember, DistributionConfig> configMap) {
Set<DistributedMember> otherMembers = this.managementTestRule.getOtherNormalMembers();
for (DistributedMember member : otherMembers) {
MemberMXBean memberMXBean = awaitMemberMXBeanProxy(member);
GemFireProperties data = memberMXBean.listGemFireProperties();
DistributionConfig config = configMap.get(member);
verifyGemFirePropertiesData(config, data);
}
}
use of org.apache.geode.distributed.DistributedMember in project geode by apache.
the class CacheManagementDUnitTest method verifyNotificationsAndRegionSize.
private void verifyNotificationsAndRegionSize(final VM memberVM1, final VM memberVM2, final VM memberVM3, final VM managerVM) {
DistributedMember member1 = this.managementTestRule.getDistributedMember(memberVM1);
DistributedMember member2 = this.managementTestRule.getDistributedMember(memberVM2);
DistributedMember member3 = this.managementTestRule.getDistributedMember(memberVM3);
String memberId1 = MBeanJMXAdapter.getUniqueIDForMember(member1);
String memberId2 = MBeanJMXAdapter.getUniqueIDForMember(member2);
String memberId3 = MBeanJMXAdapter.getUniqueIDForMember(member3);
memberVM1.invoke("createNotificationRegion", () -> createNotificationRegion(memberId1));
memberVM2.invoke("createNotificationRegion", () -> createNotificationRegion(memberId2));
memberVM3.invoke("createNotificationRegion", () -> createNotificationRegion(memberId3));
managerVM.invoke("verify notifications size", () -> {
await().until(() -> assertThat(notifications.size()).isEqualTo(45));
Cache cache = this.managementTestRule.getCache();
Region region1 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId1);
Region region2 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId2);
Region region3 = cache.getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId3);
// Even though we got 15 notification only 10 should be there due to
// eviction attributes set in notification region
await().until(() -> assertThat(region1).hasSize(10));
await().until(() -> assertThat(region2).hasSize(10));
await().until(() -> assertThat(region3).hasSize(10));
});
}
Aggregations