Search in sources :

Example 36 with Event

use of org.talend.esb.sam.common.event.Event in project tesb-rt-se by Talend.

the class EventRepositoryImpl method readEvent.

/* (non-Javadoc)
     * @see org.talend.esb.sam.common.event.persistence.EventRepository#readEvent(long)
     */
@Override
public Event readEvent(long id) {
    RowMapper<Event> rowMapper = new EventRowMapper();
    Event event = getJdbcTemplate().queryForObject("select * from EVENTS where ID=" + id, rowMapper);
    event.getCustomInfo().clear();
    event.getCustomInfo().putAll(readCustomInfo(id));
    return event;
}
Also used : Event(org.talend.esb.sam.common.event.Event)

Example 37 with Event

use of org.talend.esb.sam.common.event.Event in project tesb-rt-se by Talend.

the class EventMapperTest method testEventMapper.

@Test
public void testEventMapper() throws IOException {
    Event event = new Event();
    event.setContent("testContent");
    EventType eventOut = EventMapper.map(event);
    DataHandler dh = eventOut.getContent();
    String outContent = getContent(dh);
    Assert.assertEquals(event.getContent(), outContent);
// TODO test the other properties
}
Also used : EventType(org.talend.esb.sam._2011._03.common.EventType) Event(org.talend.esb.sam.common.event.Event) DataHandler(javax.activation.DataHandler) Test(org.junit.Test)

Aggregations

Event (org.talend.esb.sam.common.event.Event)37 Test (org.junit.Test)16 MessageInfo (org.talend.esb.sam.common.event.MessageInfo)11 ArrayList (java.util.ArrayList)10 Originator (org.talend.esb.sam.common.event.Originator)9 Date (java.util.Date)6 EventType (org.talend.esb.sam._2011._03.common.EventType)4 Customer (com.example.customerservice.Customer)3 DataHandler (javax.activation.DataHandler)3 Message (org.apache.cxf.message.Message)3 MessageToEventMapper (org.talend.esb.sam.agent.eventproducer.MessageToEventMapper)3 InetAddress (java.net.InetAddress)2 UnknownHostException (java.net.UnknownHostException)2 HashMap (java.util.HashMap)2 SoapBinding (org.apache.cxf.binding.soap.SoapBinding)2 SoapBindingInfo (org.apache.cxf.binding.soap.model.SoapBindingInfo)2 AuthorizationPolicy (org.apache.cxf.configuration.security.AuthorizationPolicy)2 SecurityContext (org.apache.cxf.security.SecurityContext)2 CustomInfo (org.talend.esb.sam.agent.message.CustomInfo)2 EventTypeEnum (org.talend.esb.sam.common.event.EventTypeEnum)2