JmsSpringComponent jms = new JmsSpringComponent(); ((JmsLifeCycle) jms.getLifeCycle()).getConfiguration().setConnectionFactory(connectionFactory);
JmsComponent jms = new JmsComponent(); jms.getConfiguration().setConnectionFactory(connectionFactory);
    public void testResolveEndpoint() throws Exception {        JmsSpringComponent jms = new JmsSpringComponent();        ((JmsLifeCycle) jms.getLifeCycle()).getConfiguration().setConnectionFactory(connectionFactory);        JmsEndpoint ep = new JmsEndpoint();        ep.setRole(MessageExchange.Role.CONSUMER);        ep.setService(ReceiverComponent.SERVICE);        ep.setEndpoint(ReceiverComponent.ENDPOINT);        ep.setDefaultMep(MessageExchangeSupport.IN_ONLY);        ep.setJmsProviderDestinationName("foo.bar.myqueue");        ep.setDestinationStyle(AbstractJmsProcessor.STYLE_QUEUE);        jms.setEndpoints(new JmsEndpoint[] { ep });        container.activateComponent(jms, "servicemix-jms");        ReceiverComponent receiver = new ReceiverComponent();        container.activateComponent(receiver, "receiver");        DefaultServiceMixClient client = new DefaultServiceMixClient(container);        DocumentFragment epr = URIResolver.createWSAEPR("jms://queue/foo.bar.myqueue?jms.soap=true");        ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);        assertNotNull(se);        InOnly inonly = client.createInOnlyExchange();        inonly.setEndpoint(se);        inonly.getInMessage().setContent(new StringSource("<hello>world</hello>"));        client.sendSync(inonly);        assertEquals(ExchangeStatus.DONE, inonly.getStatus());        receiver.getMessageList().assertMessagesReceived(1);        List msgs = receiver.getMessageList().flushMessages();        NormalizedMessage msg = (NormalizedMessage) msgs.get(0);        Element elem = new SourceTransformer().toDOMElement(msg);        assertEquals("http://www.w3.org/2003/05/soap-envelope", elem.getNamespaceURI());        assertEquals("env:Envelope", elem.getNodeName());        System.out.println(new SourceTransformer().contentToString(msg));        // Wait for DONE status        Thread.sleep(50);    }