use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class QueryDataDUnitTest method awaitMemberMXBeanProxy.
private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = service.getMemberMBeanName(member);
String alias = "awaiting MemberMXBean proxy for " + member;
await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class QueryDataDUnitTest method awaitDistributedRegionMXBean.
private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
return service.getDistributedRegionMXBean(name);
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class RegionManagementDUnitTest method createLocalRegion_tmp.
private void createLocalRegion_tmp(final VM vm, final String localRegionName) {
vm.invoke("Create Local region", () -> {
SystemManagementService service = getSystemManagementService_tmp();
RegionFactory regionFactory = getCache_tmp().createRegionFactory(RegionShortcut.LOCAL);
regionFactory.create(localRegionName);
});
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class RegionManagementDUnitTest method addMemberNotificationListener.
private void addMemberNotificationListener(final VM managerVM, final int expectedMembers) {
managerVM.invoke("addMemberNotificationListener", () -> {
Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
assertThat(otherMemberSet).hasSize(expectedMembers);
SystemManagementService service = getSystemManagementService_tmp();
List<Notification> notifications = new ArrayList<>();
MEMBER_NOTIFICATIONS_REF.set(notifications);
for (DistributedMember member : otherMemberSet) {
MemberNotificationListener listener = new MemberNotificationListener(notifications);
ObjectName objectName = service.getMemberMBeanName(member);
awaitMemberMXBeanProxy(objectName);
getPlatformMBeanServer().addNotificationListener(objectName, listener, null, null);
}
});
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class RegionManagementDUnitTest method createFixedPartitionRegion.
/**
* Invoked in member VMs
*/
private void createFixedPartitionRegion(final List<FixedPartitionAttributes> fixedPartitionAttributesList) {
SystemManagementService service = getSystemManagementService_tmp();
PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
partitionAttributesFactory.setRedundantCopies(2).setTotalNumBuckets(12);
for (FixedPartitionAttributes fixedPartitionAttributes : fixedPartitionAttributesList) {
partitionAttributesFactory.addFixedPartitionAttributes(fixedPartitionAttributes);
}
partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
AttributesFactory attributesFactory = new AttributesFactory();
attributesFactory.setPartitionAttributes(partitionAttributesFactory.create());
fixedPartitionedRegion = getCache_tmp().createRegion(FIXED_PR_NAME, attributesFactory.create());
assertThat(fixedPartitionedRegion).isNotNull();
RegionMXBean regionMXBean = service.getLocalRegionMBean(FIXED_PR_PATH);
RegionAttributes regionAttributes = fixedPartitionedRegion.getAttributes();
PartitionAttributesData partitionAttributesData = regionMXBean.listPartitionAttributes();
verifyPartitionData(regionAttributes, partitionAttributesData);
FixedPartitionAttributesData[] fixedPartitionAttributesData = regionMXBean.listFixedPartitionAttributes();
assertThat(fixedPartitionAttributesData).isNotNull();
assertThat(fixedPartitionAttributesData).hasSize(3);
for (int i = 0; i < fixedPartitionAttributesData.length; i++) {
// TODO: add real assertions
// LogWriterUtils.getLogWriter().info("<ExpectedString> Fixed PR Data is " +
// fixedPartitionAttributesData[i] + "</ExpectedString> ");
}
}
Aggregations