Skip to content

Commit

Permalink
Increase code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
SPalominos committed Nov 27, 2019
1 parent d510df3 commit 15785e4
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,25 @@ public void testSqlBuilding() {
assertEquals("SELECT * FROM ORBISGIS LIMIT 0", getTable().limit(0).toString().trim());
}

/**
* Test the {@link JdbcTable#columns(String...)} and {@link JdbcTable#columns(List)} methods.
*/
@Test
public void testColumns() {
JdbcTable table = getTable();
JdbcSpatialTable spatialTable = (JdbcSpatialTable)dataSource.getSpatialTable(TABLE_NAME);

List<String> columns = new ArrayList<>();
columns.add("TOTO");
columns.add("tata");
columns.add("TIti");

assertEquals("SELECT TOTO, tata, TIti FROM ORBISGIS WHERE toto", ((JdbcTable)table.columns("TOTO", "tata", "TIti")).where("toto").toString().trim());
assertEquals("SELECT TOTO, tata, TIti FROM ORBISGIS WHERE toto", ((JdbcTable)table.columns(columns)).where("toto").toString().trim());
assertEquals("SELECT TOTO, tata, TIti FROM ORBISGIS WHERE toto", ((JdbcTable)spatialTable.columns("TOTO", "tata", "TIti")).where("toto").toString().trim());
assertEquals("SELECT TOTO, tata, TIti FROM ORBISGIS WHERE toto",((JdbcTable) spatialTable.columns(columns)).where("toto").toString().trim());
}

/**
* Test the {@link JdbcTable#getTable()} and {@link JdbcTable#getSpatialTable()} methods.
*/
Expand Down

0 comments on commit 15785e4

Please sign in to comment.