Search in sources :

Example 1 with EventRowMapper

use of org.talend.esb.sam.server.persistence.EventRowMapper in project tesb-rt-se by Talend.

the class MonitoringServiceImplTest method testWritingSeveralEvents.

// @Before
// public void setUp() throws Exception {
// executeSqlScript("create.sql", true);
// }
@Test
public void testWritingSeveralEvents() {
    List<Event> events = new ArrayList<Event>();
    events.add(generateEvent());
    events.add(generateEvent());
    events.add(generateEvent());
    monitoringSerivce.putEvents(events);
    for (Event event : events) {
        EventRowMapper rowMapper = new EventRowMapper();
        Event loaded = jdbcTemplate.queryForObject("select * from EVENTS where ID=?", rowMapper, event.getPersistedId());
        Assert.assertNotNull(loaded);
        Assert.assertEquals(event.getPersistedId(), loaded.getPersistedId());
    }
}
Also used : EventRowMapper(org.talend.esb.sam.server.persistence.EventRowMapper) ArrayList(java.util.ArrayList) Event(org.talend.esb.sam.common.event.Event) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 Event (org.talend.esb.sam.common.event.Event)1 EventRowMapper (org.talend.esb.sam.server.persistence.EventRowMapper)1