Skip to content

Commit

Permalink
Fixed unit test so it works around an hsqldb bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Mar 16, 2010
1 parent f1df8b0 commit 3d6120c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -570,13 +570,14 @@ public void testSuspendIgnorePullRemoteLocalComboBatches() throws ParseException
@Test(timeout = 120000)
public void testUpdateDataWithNoChangesSyncToClient() throws Exception {
int clientIncomingBatchCount = clientJdbcTemplate.queryForInt("select count(*) from sym_incoming_batch");
int rowsUpdated = rootJdbcTemplate.update("update test_customer set address=address");
logger.info("Updated " + rowsUpdated + " customer rows");
int rowsUpdated = rootJdbcTemplate.update("update test_sync_column_level set string_value=string_value");
logger.info("Updated " + rowsUpdated + " test_sync_column_level rows");
getClientEngine().pull();
Assert.assertTrue(rowsUpdated > 0);
Assert.assertTrue(clientIncomingBatchCount <= clientJdbcTemplate.queryForInt("select count(*) from sym_incoming_batch"));
Assert.assertEquals(0, clientJdbcTemplate.queryForInt("select count(*) from sym_incoming_batch where status != 'OK'"));
Assert.assertEquals(0, rootJdbcTemplate.queryForInt("select count(*) from sym_outgoing_batch where status not in ('OK','IG','SK')"));
Assert.assertEquals(rootJdbcTemplate.queryForInt("select count(*) from test_customer"), clientJdbcTemplate.queryForInt("select count(*) from test_customer"));
Assert.assertEquals(rootJdbcTemplate.queryForInt("select count(*) from test_sync_column_level"), clientJdbcTemplate.queryForInt("select count(*) from test_sync_column_level"));
}

@Test(timeout = 120000)
Expand Down
Expand Up @@ -179,7 +179,7 @@ public static void removeEmbededdedDatabases() {
}
}
File sqlitedb = new File("target/sqlite");
if (sqlitedb.exists()) {
if (sqlitedb.exists() && FileUtils.listFiles(sqlitedb, null, true).size() > 0) {
try {
logger.info("Removing sqlite database files");
FileUtils.deleteDirectory(sqlitedb);
Expand Down

0 comments on commit 3d6120c

Please sign in to comment.