Search in sources :

Example 1 with AllRowsMetadataTranslator

use of com.adaptris.core.services.jdbc.AllRowsMetadataTranslator in project interlok by adaptris.

the class StoredProcedureProducerTest method testMultipleResultSetsMetadataTranslator.

@Test
public void testMultipleResultSetsMetadataTranslator() throws Exception {
    if (areTestsEnabled()) {
        JdbcStoredProcedureProducer spp = new JdbcStoredProcedureProducer();
        spp.setProcedureName(("many_resultsets"));
        spp.setResultSetTranslator(new AllRowsMetadataTranslator());
        AdaptrisMessage message = createMessage();
        assertEquals(0, message.getMetadata().size());
        StandaloneProducer producer = configureForTests(spp, true);
        try {
            start(producer);
            producer.doService(message);
            assertEquals(30, message.getMetadata().size());
        } finally {
            stop(producer);
        }
    }
}
Also used : AdaptrisMessage(com.adaptris.core.AdaptrisMessage) AllRowsMetadataTranslator(com.adaptris.core.services.jdbc.AllRowsMetadataTranslator) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Example 2 with AllRowsMetadataTranslator

use of com.adaptris.core.services.jdbc.AllRowsMetadataTranslator in project interlok by adaptris.

the class StoredProcedureProducerTest method testOneResultSetMetadataTranslator.

@Test
public void testOneResultSetMetadataTranslator() throws Exception {
    if (areTestsEnabled()) {
        JdbcStoredProcedureProducer spp = new JdbcStoredProcedureProducer();
        spp.setProcedureName(("one_resultset"));
        spp.setResultSetTranslator(new AllRowsMetadataTranslator());
        AdaptrisMessage message = createMessage();
        assertEquals(0, message.getMetadata().size());
        StandaloneProducer producer = configureForTests(spp, true);
        try {
            start(producer);
            producer.doService(message);
            assertEquals(15, message.getMetadata().size());
        } finally {
            stop(producer);
        }
    }
}
Also used : AdaptrisMessage(com.adaptris.core.AdaptrisMessage) AllRowsMetadataTranslator(com.adaptris.core.services.jdbc.AllRowsMetadataTranslator) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Aggregations

AdaptrisMessage (com.adaptris.core.AdaptrisMessage)2 StandaloneProducer (com.adaptris.core.StandaloneProducer)2 AllRowsMetadataTranslator (com.adaptris.core.services.jdbc.AllRowsMetadataTranslator)2 Test (org.junit.Test)2