use of org.springframework.integration.jdbc.storedproc.PrimeMapper in project spring-integration by spring-projects.
the class StoredProcPollingChannelAdapterParserTests method testReturningResultSetRowMappersAreSet.
@SuppressWarnings("unchecked")
@Test
public void testReturningResultSetRowMappersAreSet() throws Exception {
setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(this.pollingAdapter);
Object source = accessor.getPropertyValue("source");
accessor = new DirectFieldAccessor(source);
source = accessor.getPropertyValue("executor");
accessor = new DirectFieldAccessor(source);
Object returningResultSetRowMappers = accessor.getPropertyValue("returningResultSetRowMappers");
assertNotNull(returningResultSetRowMappers);
assertTrue(returningResultSetRowMappers instanceof Map);
Map<String, RowMapper<?>> returningResultSetRowMappersAsMap = (Map<String, RowMapper<?>>) returningResultSetRowMappers;
assertTrue("The rowmapper was not set. Expected returningResultSetRowMappersAsMap.size() == 2", returningResultSetRowMappersAsMap.size() == 2);
Iterator<Entry<String, RowMapper<?>>> iterator = returningResultSetRowMappersAsMap.entrySet().iterator();
Entry<String, ?> mapEntry = iterator.next();
assertEquals("out", mapEntry.getKey());
assertTrue(mapEntry.getValue() instanceof PrimeMapper);
mapEntry = iterator.next();
assertEquals("out2", mapEntry.getKey());
assertTrue(mapEntry.getValue() instanceof SingleColumnRowMapper);
}
use of org.springframework.integration.jdbc.storedproc.PrimeMapper in project spring-integration by spring-projects.
the class StoredProcOutboundGatewayParserTests method testReturningResultSetRowMappersAreSet.
@SuppressWarnings("unchecked")
@Test
public void testReturningResultSetRowMappersAreSet() throws Exception {
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(this.outboundGateway);
Object source = accessor.getPropertyValue("handler");
accessor = new DirectFieldAccessor(source);
source = accessor.getPropertyValue("executor");
accessor = new DirectFieldAccessor(source);
Object returningResultSetRowMappers = accessor.getPropertyValue("returningResultSetRowMappers");
assertNotNull(returningResultSetRowMappers);
assertTrue(returningResultSetRowMappers instanceof Map);
Map<String, RowMapper<?>> returningResultSetRowMappersAsMap = (Map<String, RowMapper<?>>) returningResultSetRowMappers;
assertTrue("The rowmapper was not set. Expected returningResultSetRowMappersAsMap.size() == 1", returningResultSetRowMappersAsMap.size() == 1);
Entry<String, ?> mapEntry1 = returningResultSetRowMappersAsMap.entrySet().iterator().next();
assertEquals("out", mapEntry1.getKey());
assertTrue(mapEntry1.getValue() instanceof PrimeMapper);
}
Aggregations