MessageReceiverImpl extends MessageBaseFacility implements MessageReceiver { @Activate public void activate(BundleContext bc) throws Exception { super.activate(bc); }  @Activate void activate(BundleContext bc); @Deactivate void deactivate(); @Override FutureTask<Serializable> receiveSerializable(final String destinationId, final DestinationType type);  }
@Test public void testActivate() throws Exception { BundleContext bctx = EasyMock.createMock(BundleContext.class); EasyMock.expect(bctx.getProperty(MessageBaseFacility.ACTIVEMQ_BROKER_URL_KEY)) .andReturn("failover: EasyMock.expect(bctx.getProperty(MessageBaseFacility.ACTIVEMQ_BROKER_USERNAME_KEY)).andReturn(null); EasyMock.expect(bctx.getProperty(MessageBaseFacility.ACTIVEMQ_BROKER_PASSWORD_KEY)).andReturn(null); EasyMock.replay(bctx); MessageReceiverImpl messageReceiverImpl = new MessageReceiverImpl(); messageReceiverImpl.activate(bctx); assertFalse(messageReceiverImpl.reconnect()); messageReceiverImpl.deactivate(); assertFalse(messageReceiverImpl.isConnected()); }