Java Code Examples for javax.management.modelmbean.ModelMBeanInfo#getNotifications()

The following examples show how to use javax.management.modelmbean.ModelMBeanInfo#getNotifications() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractJmxAssemblerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testNotificationMetadata() throws Exception {
	ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
	MBeanNotificationInfo[] notifications = info.getNotifications();
	assertEquals("Incorrect number of notifications", 1, notifications.length);
	assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

	String[] notifTypes = notifications[0].getNotifTypes();

	assertEquals("Incorrect number of notification types", 2, notifTypes.length);
	assertEquals("Notification type.foo not found", "type.foo", notifTypes[0]);
	assertEquals("Notification type.bar not found", "type.bar", notifTypes[1]);
}
 
Example 2
Source File: AbstractJmxAssemblerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testNotificationMetadata() throws Exception {
	ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
	MBeanNotificationInfo[] notifications = info.getNotifications();
	assertEquals("Incorrect number of notifications", 1, notifications.length);
	assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

	String[] notifTypes = notifications[0].getNotifTypes();

	assertEquals("Incorrect number of notification types", 2, notifTypes.length);
	assertEquals("Notification type.foo not found", "type.foo", notifTypes[0]);
	assertEquals("Notification type.bar not found", "type.bar", notifTypes[1]);
}
 
Example 3
Source File: AbstractJmxAssemblerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testNotificationMetadata() throws Exception {
	ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
	MBeanNotificationInfo[] notifications = info.getNotifications();
	assertEquals("Incorrect number of notifications", 1, notifications.length);
	assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

	String[] notifTypes = notifications[0].getNotifTypes();

	assertEquals("Incorrect number of notification types", 2, notifTypes.length);
	assertEquals("Notification type.foo not found", "type.foo", notifTypes[0]);
	assertEquals("Notification type.bar not found", "type.bar", notifTypes[1]);
}
 
Example 4
Source File: ModelMBeanAssemblerTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testNotificationMetadata() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    MBeanNotificationInfo[] notifications = info.getNotifications();
    assertEquals("Incorrect number of notifications", 1, notifications.length);
    assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

    String[] notifTypes = notifications[0].getNotifTypes();

    assertEquals("Incorrect number of notification types", 2, notifTypes.length);
    assertEquals("Notification type.foo not found", "type.foo", notifTypes[0]);
    assertEquals("Notification type.bar not found", "type.bar", notifTypes[1]);
}