MessageBusManager extends StandardMBean implements MessageBusManagerMBean { @Reference(unbind = "-") protected void setMessageBus(MessageBus messageBus) { _messageBus = messageBus; } MessageBusManager(); @Override int getDestinationCount(); @Override int getMessageListenerCount(String destinationName);  }
@Test public void testRegisterMBean() throws Exception { MessageBusManager messageBusManager = new MessageBusManager(); messageBusManager.setMessageBus(_messageBus); ObjectName objectName = new ObjectName( "com.liferay.portal.messaging:classification=message_bus," + "name=MessageBusManager"); _mBeanServer.registerMBean(messageBusManager, objectName); Assert.assertTrue(_mBeanServer.isRegistered(objectName)); }