@Test public void testDeferConsumerCreationToVendor() throws Exception { Assume.assumeTrue(JmsConfig.jmsTestsEnabled()); EmbeddedActiveMq activeMqBroker = new EmbeddedActiveMq(); when(mockVendor.createConsumer(any(), any(), any(JmsActorConfig.class))).thenReturn(mockMessageConsumer); when(mockVendor.getBrokerUrl()).thenReturn("vm: ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm: when(mockVendor.createConnectionFactory()).thenReturn(factory); when(mockVendor.createConnection(any(), any())).thenReturn(factory.createConnection()); try { activeMqBroker.start(); JmsConnection jmsConnection = activeMqBroker.getJmsConnection(); jmsConnection.setVendorImplementation(mockVendor); StandaloneConsumer standaloneConsumer = createStandaloneConsumer(jmsConnection, false, true); MockMessageListener jms = new MockMessageListener(); standaloneConsumer.registerAdaptrisMessageListener(jms); LifecycleHelper.initAndStart(standaloneConsumer); verify(mockVendor).createConsumer(any(), any(), any(JmsSyncConsumer.class)); LifecycleHelper.stopAndClose(standaloneConsumer); } finally { activeMqBroker.destroy(); } }
protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); }
JmsSyncConsumer extends BaseJmsPollingConsumerImpl { protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); } }
JmsSyncConsumer extends BaseJmsPollingConsumerImpl { protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); } JmsSyncConsumer(); }
JmsSyncConsumer extends BaseJmsPollingConsumerImpl { protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); } JmsSyncConsumer(); JmsSyncConsumer withEndpoint(String s); @Override Logger currentLogger(); @Override void init(); }
JmsSyncConsumer extends BaseJmsPollingConsumerImpl { protected Boolean deferConsumerCreationToVendor() { return BooleanUtils.toBooleanDefaultIfNull(getDeferConsumerCreationToVendor(), false); } JmsSyncConsumer(); JmsSyncConsumer withEndpoint(String s); @Override Logger currentLogger(); @Override void init();  }