use of com.adaptris.core.services.jdbc.FirstRowMetadataTranslator in project interlok by adaptris.
the class StoredProcedureProducerTest method testOneResultSetFirstRowMetadataTranslator.
@Test
public void testOneResultSetFirstRowMetadataTranslator() throws Exception {
if (areTestsEnabled()) {
JdbcStoredProcedureProducer spp = new JdbcStoredProcedureProducer();
spp.setProcedureName(("one_resultset"));
spp.setResultSetTranslator(new FirstRowMetadataTranslator());
AdaptrisMessage message = createMessage();
assertEquals(0, message.getMetadata().size());
StandaloneProducer producer = configureForTests(spp, true);
try {
start(producer);
producer.doService(message);
assertEquals(3, message.getMetadata().size());
} finally {
stop(producer);
}
}
}
use of com.adaptris.core.services.jdbc.FirstRowMetadataTranslator in project interlok by adaptris.
the class StoredProcedureProducerTest method testMultipleResultSetsFirstRowMetadataTranslator.
@Test
public void testMultipleResultSetsFirstRowMetadataTranslator() throws Exception {
if (areTestsEnabled()) {
JdbcStoredProcedureProducer spp = new JdbcStoredProcedureProducer();
spp.setProcedureName(("many_resultsets"));
spp.setResultSetTranslator(new FirstRowMetadataTranslator());
AdaptrisMessage message = createMessage();
assertEquals(0, message.getMetadata().size());
StandaloneProducer producer = configureForTests(spp, true);
try {
start(producer);
producer.doService(message);
assertEquals(6, message.getMetadata().size());
} finally {
stop(producer);
}
}
}
use of com.adaptris.core.services.jdbc.FirstRowMetadataTranslator in project interlok by adaptris.
the class StoredProcedureProducerTest method testOneMetadataParamOutAndOneResultSet.
@Test
public void testOneMetadataParamOutAndOneResultSet() throws Exception {
if (areTestsEnabled()) {
JdbcStoredProcedureProducer spp = new JdbcStoredProcedureProducer();
spp.setProcedureName(("one_resultset_one_out"));
spp.setResultSetTranslator(new FirstRowMetadataTranslator());
JdbcMetadataParameter outParameter = new JdbcMetadataParameter();
outParameter.setMetadataKey("completed");
outParameter.setName("completed");
outParameter.setType(ParameterValueType.INTEGER);
OutParameters outParameters = new OutParameters();
outParameters.add(outParameter);
spp.setOutParameters(outParameters);
AdaptrisMessage message = createMessage();
assertEquals(0, message.getMetadata().size());
StandaloneProducer producer = configureForTests(spp, true);
try {
start(producer);
producer.doService(message);
assertEquals(4, message.getMetadata().size());
assertEquals("1", message.getMetadataValue("completed"));
} finally {
stop(producer);
}
}
}
Aggregations