Skip to content

Commit

Permalink
new method in the abstract writer test
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Feb 17, 2012
1 parent 67d3f9d commit a5b2d8d
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -64,9 +64,13 @@ protected Table buildSourceTable(String tableName, String[] keyNames, String[] c
protected void writeData(CsvData data, String[] expectedValues) {
writeData(data, expectedValues, TEST_COLUMNS);
}

protected String getTestTable() {
return TEST_TABLE;
}

protected void writeData(CsvData data, String[] expectedValues, String[] columnNames) {
writeData(data, expectedValues, TEST_TABLE, TEST_KEYS, columnNames);
writeData(data, expectedValues, getTestTable(), TEST_KEYS, columnNames);
}

protected void writeData(CsvData data, String[] expectedValues, String tableName,
Expand Down Expand Up @@ -125,7 +129,7 @@ protected long writeData(IDataWriter writer, TableCsvData... datas) {
}

protected void assertTestTableEquals(String testTableId, String[] expectedValues) {
String sql = "select " + getSelect(TEST_COLUMNS) + " from " + TEST_TABLE + " where "
String sql = "select " + getSelect(TEST_COLUMNS) + " from " + getTestTable() + " where "
+ getWhere(TEST_KEYS);
Map<String, Object> results = platform.getSqlTemplate().queryForMap(sql,
new Object[] { new Long(testTableId) });
Expand Down Expand Up @@ -245,5 +249,9 @@ public TableCsvData(Table table, List<CsvData> data) {
}

}

protected long countRows(String tableName) {
return platform.getSqlTemplate().queryForInt(String.format("select count(*) from %s", tableName));
}

}

0 comments on commit a5b2d8d

Please sign in to comment.