< prev index next >
application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/subscription/AttributeSubscriptionTest.java
Print this page
*** 58,68 ****
@Test
public void testSubscribeToCPULoad() throws Exception {
IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test");
ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class);
try {
! MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad"); //$NON-NLS-1$ //$NON-NLS-2$
subscriptionService.addMRIValueListener(attributeDescriptor, this);
synchronized (this) {
for (int i = 0; i < 4; i++) {
this.wait(TEST_TIMEOUT_TIME);
}
--- 58,68 ----
@Test
public void testSubscribeToCPULoad() throws Exception {
IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test");
ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class);
try {
! MRI attributeDescriptor = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "SystemCpuLoad");
subscriptionService.addMRIValueListener(attributeDescriptor, this);
synchronized (this) {
for (int i = 0; i < 4; i++) {
this.wait(TEST_TIMEOUT_TIME);
}
*** 79,90 ****
public void testGetAttributeSubscriptionOneShot() throws Exception {
// Starting up a subscription on a one shot attribute.
IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test");
ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class);
try {
! MRI availableProcessorsAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$
! "AvailableProcessors"); //$NON-NLS-1$
subscriptionService.addMRIValueListener(availableProcessorsAttribute, this);
// Since it's a one shot and pretty fast, it may already have been retrieved...
if (subscriptionService.getLastMRIValueEvent(availableProcessorsAttribute) == null) {
--- 79,90 ----
public void testGetAttributeSubscriptionOneShot() throws Exception {
// Starting up a subscription on a one shot attribute.
IConnectionHandle handle = IServerHandle.create(LocalRJMXTestToolkit.createDefaultDescriptor()).connect("Test");
ISubscriptionService subscriptionService = handle.getServiceOrThrow(ISubscriptionService.class);
try {
! MRI availableProcessorsAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem",
! "AvailableProcessors");
subscriptionService.addMRIValueListener(availableProcessorsAttribute, this);
// Since it's a one shot and pretty fast, it may already have been retrieved...
if (subscriptionService.getLastMRIValueEvent(availableProcessorsAttribute) == null) {
*** 107,118 ****
@Test
public void testGetAttributeSubscriptionOne() {
try {
// Starting up a subscription on a one shot attribute.
! MRI physicalMemoryUsedAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", //$NON-NLS-1$
! "UsedPhysicalMemorySize"); //$NON-NLS-1$
getAttributeSubscriptionService().addMRIValueListener(physicalMemoryUsedAttribute, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
--- 107,118 ----
@Test
public void testGetAttributeSubscriptionOne() {
try {
// Starting up a subscription on a one shot attribute.
! MRI physicalMemoryUsedAttribute = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem",
! "UsedPhysicalMemorySize");
getAttributeSubscriptionService().addMRIValueListener(physicalMemoryUsedAttribute, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
*** 126,138 ****
@Test
public void testGetAttributeSubscriptionTwo() {
try {
// Starting up a subscription on a one shot attribute.
! MRI tcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize"); //$NON-NLS-1$ //$NON-NLS-2$
getAttributeSubscriptionService().addMRIValueListener(tcad, this);
! MRI tstcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "FreePhysicalMemorySize"); //$NON-NLS-1$ //$NON-NLS-2$
getAttributeSubscriptionService().addMRIValueListener(tstcad, this);
for (int i = 0; i < 7; i++) {
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
--- 126,138 ----
@Test
public void testGetAttributeSubscriptionTwo() {
try {
// Starting up a subscription on a one shot attribute.
! MRI tcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "UsedPhysicalMemorySize");
getAttributeSubscriptionService().addMRIValueListener(tcad, this);
! MRI tstcad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "FreePhysicalMemorySize");
getAttributeSubscriptionService().addMRIValueListener(tstcad, this);
for (int i = 0; i < 7; i++) {
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
*** 154,164 ****
@Test
public void testGetSyntheticSubscription() {
try {
// Starting up a subscription on a one shot attribute.
! MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsagePercent"); //$NON-NLS-1$ //$NON-NLS-2$
getAttributeSubscriptionService().addMRIValueListener(synthad, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
--- 154,164 ----
@Test
public void testGetSyntheticSubscription() {
try {
// Starting up a subscription on a one shot attribute.
! MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=Memory", "HeapMemoryUsagePercent");
getAttributeSubscriptionService().addMRIValueListener(synthad, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
*** 173,183 ****
@Test
public void testGetSyntheticPhysicalMemSubscription() {
try {
// Starting up a subscription on a one shot attribute.
! MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "PhysicalMemoryUsagePercent"); //$NON-NLS-1$ //$NON-NLS-2$
getAttributeSubscriptionService().addMRIValueListener(synthad, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
--- 173,183 ----
@Test
public void testGetSyntheticPhysicalMemSubscription() {
try {
// Starting up a subscription on a one shot attribute.
! MRI synthad = new MRI(Type.ATTRIBUTE, "java.lang:type=OperatingSystem", "PhysicalMemoryUsagePercent");
getAttributeSubscriptionService().addMRIValueListener(synthad, this);
synchronized (this) {
wait(TEST_TIMEOUT_TIME);
}
< prev index next >