cmoutes / soi-toolkit

Automatically exported from code.google.com/p/soi-toolkit
0 stars 0 forks source link

Use jdbc-temaple instead of jdbc-inbound endpoint in integration tests to insert testdata into export tables #320

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Today integration tests use jdbc-inbound endpoints to insert testdata into 
export tables like:

        String inboundEndpoint = "jdbc://INSERT INTO FROM_JEEVES_EXPORT_TB(ID, VALUE) VALUES ('" + inId + "', '" + inValue + "')?connector=soitoolkit-jdbc-connector";
        MuleMessage reply = dispatchAndWaitForServiceComponent(inboundEndpoint, input, props, receivingService, timeout);

This however only works for very simple testdata, eg not for xml. 

A very simple improvement would be to replace it with a jdbc-template solution 
for example:

        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.update("INSERT INTO FROM_JEEVES_EXPORT_TB(ID, VALUE) VALUES(?, ?)", new Object [] {inId, inValue});
        MuleMessage reply = waitForServiceComponent(receivingService, timeout);

Original issue reported on code.google.com by magnus.l...@gmail.com on 17 Dec 2012 at 7:22

GoogleCodeExporter commented 8 years ago

Original comment by hakan.d...@gmail.com on 23 Feb 2014 at 3:25