Package org.apache.servicemix.client

Examples of org.apache.servicemix.client.DefaultServiceMixClient.done()


            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
        }
        log.info(transformer.toString(me.getOutMessage().getContent()));
        Element el = transformer.toDOMElement(me.getOutMessage());
        assertEquals("2005", textValueOfXPath(el, "/transformed/bookstore/book[1]/year"));
        client.done(me);
    }

    public void testXsltWithElement() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
View Full Code Here


            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
        }
        log.info(transformer.toString(me.getOutMessage().getContent()));
        Element el = transformer.toDOMElement(me.getOutMessage());
        assertEquals("2005", textValueOfXPath(el, "/transformed/book/year"));
        client.done(me);
    }

    public void testXsltDynamic() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
View Full Code Here

            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
        }
        log.info(transformer.toString(me.getOutMessage().getContent()));
        Element el = transformer.toDOMElement(me.getOutMessage());
        assertEquals("2005", textValueOfXPath(el, "/transformed/book/year"));
        client.done(me);
    }

    public void testXsltWithParam() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
View Full Code Here

            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
        }
        log.info(transformer.toString(me.getOutMessage().getContent()));
        Element el = transformer.toDOMElement(me.getOutMessage());
        assertEquals("XQuery Kick Start", textValueOfXPath(el, "/titles/title[1]"));
        client.done(me);
    }

    public void testXQueryInline() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
View Full Code Here

        el = DOMUtil.getFirstChildElement(el);
        assertEquals(new QName("http://saxon.sf.net/xquery-results", "element"), DOMUtil.getQName(el));
        el = DOMUtil.getFirstChildElement(el);
        assertEquals(new QName("title"), DOMUtil.getQName(el));
        assertEquals("XQuery Kick Start", DOMUtil.getElementText(el));
        client.done(me);
    }

    public void testXQueryDynamic() throws Exception {
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        InOut me = client.createInOutExchange();
View Full Code Here

            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
        }
        log.info(transformer.toString(me.getOutMessage().getContent()));
        Element el = transformer.toDOMElement(me.getOutMessage());
        assertEquals("XQuery Kick Start", textValueOfXPath(el, "/titles/title[1]"));
        client.done(me);
    }

    protected AbstractXmlApplicationContext createBeanFactory() {
        return new ClassPathXmlApplicationContext("spring.xml");
    }
View Full Code Here

        me.setOperation(new QName("receive"));
        NormalizedMessage nm = me.getInMessage();
        nm.setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        assertExchangeWorked(me);
        client.done(me);
    }

    protected void assertExchangeWorked(MessageExchange me) throws Exception {
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

        me.setOperation(new QName("receive"));
        NormalizedMessage nm = me.getInMessage();
        nm.setContent(new StringSource("<hello>world</hello>"));
        client.sendSync(me);
        assertExchangeWorked(me);
        client.done(me);
    }
   
    protected void assertExchangeWorked(MessageExchange me) throws Exception {
        if (me.getStatus() == ExchangeStatus.ERROR) {
            if (me.getError() != null) {
View Full Code Here

        me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
        me.getInMessage().setContent(new StringSource(
                "<twoWay xmlns='http://jsr181.servicemix.apache.org'><in0>world �</in0></twoWay>"));
        client.sendSync(me);
        log.info(new SourceTransformer().contentToString(me.getOutMessage()));
        client.done(me);
       
        // Wait all acks being processed
        Thread.sleep(100);
    }
   
View Full Code Here

        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        Node n = transformer.toDOMNode(me.getFault());
        log.info(transformer.toString(n));
        assertNotNull(textValueOfXPath(n, "/stack"));
        client.done(me);
       
        // Wait all acks being processed
        Thread.sleep(100);
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.