javax.management.modelmbean.ModelMBeanInfo#getNotifications ( )源码实例Demo

下面列出了javax.management.modelmbean.ModelMBeanInfo#getNotifications ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@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]);
}
 
@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]);
}
 
@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]);
}
 
源代码4 项目: cxf   文件: ModelMBeanAssemblerTest.java
@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]);
}