Skip to content

Commit

Permalink
check for empty list if transaction ID is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Sep 9, 2008
1 parent e13dbf7 commit 4b4e873
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -149,6 +149,7 @@ public void testInitialLoadSql() throws Exception {

@Test
@ParameterExcluder("postgres")
@SuppressWarnings("unchecked")
public void validateTransactionFunctionailty() throws Exception {
final JdbcTemplate jdbcTemplate = getJdbcTemplate(getSymmetricEngine());
TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(
Expand All @@ -162,11 +163,12 @@ public Object doInTransaction(TransactionStatus status) {
});
String sql = "select transaction_id from " + TestConstants.TEST_PREFIX
+ "data_event where transaction_id is not null group by transaction_id having count(*)>1";
String batchId = (String) jdbcTemplate.queryForObject(sql, String.class);
List<String> batchIdList = (List<String>) jdbcTemplate.queryForList(sql, String.class);

IDbDialect dbDialect = getDbDialect();
if (dbDialect.supportsTransactionId()) {
assertNotNull(batchId);
assertTrue(batchIdList != null && batchIdList.size() == 1);
assertNotNull(batchIdList.get(0));
}
}

Expand Down

0 comments on commit 4b4e873

Please sign in to comment.