public void testNotificationEmitterRemoveTripletFailsOnBroadcaster()
throws Exception
{
MBeanServer server = MBeanServerFactory.newMBeanServer();
BroadcasterInvocationHandlerTest test = new BroadcasterInvocationHandlerTest();
server.registerMBean(test, invocationHandlerTestName);
NotificationEmitter proxy = (NotificationEmitter) MBeanServerInvocationHandler.newProxyInstance(
server, invocationHandlerTestName, InvocationHandlerTestMBean.class, true);
NotificationFilterSupport filter = new NotificationFilterSupport();
filter.enableType("test");
Object handback = new Object();
proxy.addNotificationListener(this, filter, handback);
messages.clear();
test.sendNotification();
assertTrue(messages.size() == 1);
try
{
proxy.removeNotificationListener(this, filter, handback);