Package org.talend.esb.sam.agent.eventproducer

Examples of org.talend.esb.sam.agent.eventproducer.MessageToEventMapper


     *
     * @param queue the new queue
     */
    public void setQueue(Queue<Event> queue) {
        if (epi == null) {
            MessageToEventMapper mapper = new MessageToEventMapper();
            mapper.setMaxContentLength(maxContentLength);
           
            epi = new EventProducerInterceptor(mapper, queue);
        }
    }
View Full Code Here


    private static final String Address = "http://localhost:8080/test";
   
    @Test
    public void testMapEvent() throws IOException, EndpointException {
        Message message = getTestMessage();
        Event event = new MessageToEventMapper().mapToEvent(message);
        Assert.assertEquals(EventTypeEnum.REQ_IN, event.getEventType());
        Assert.assertEquals("{interfaceNs}interfaceName", event.getMessageInfo().getPortType());
        Assert.assertEquals("{namespace}opName", event.getMessageInfo().getOperationName());
        Assert.assertEquals(TransportType, event.getMessageInfo().getTransportType());
        Assert.assertEquals(FlowID, event.getMessageInfo().getFlowId());
View Full Code Here

    }
   
    @Test
    public void testMaxContentLength() throws IOException, EndpointException {
        Message message = getTestMessage();
        MessageToEventMapper mapper = new MessageToEventMapper();
        mapper.setMaxContentLength(MAXCONTENTLENGTH);
        Event event = mapper.mapToEvent(message);
        //System.out.println(event.getContent());
        Assert.assertEquals(MAXCONTENTLENGTH, event.getContent().length());
        Assert.assertEquals("<cut><![CDATA[" + TESTCONTENT.substring(0, MAXCONTENTLENGTH - 23) + "]]></cut>", event.getContent());
        Assert.assertTrue(event.isContentCut());
    }
View Full Code Here

TOP

Related Classes of org.talend.esb.sam.agent.eventproducer.MessageToEventMapper

Copyright © 2018 www.massapicom. 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.