3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotEquals;
9 import java.util.Properties;
13 static final String
url = PROPERTIES.getProperty(
"default_db_connection_url");
14 static final String
user = PROPERTIES.getProperty(
"default_super_user");
15 static final String
password = PROPERTIES.getProperty(
"default_user_password");
25 new Answer(java.sql.Types.FLOAT,
"FLOAT"),
26 new Answer(java.sql.Types.OTHER,
"POINT"),
27 new Answer(java.sql.Types.OTHER,
"LINESTRING"),
28 new Answer(java.sql.Types.OTHER,
"POLYGON"),
29 new Answer(java.sql.Types.OTHER,
"MULTIPOLYGON")};
34 assertNotEquals(null, conn);
35 Statement statement = conn.createStatement();
37 statement.executeUpdate(PROPERTIES.getProperty(
"drop_base_db"));
38 }
catch (SQLException sQ) {
41 statement.executeUpdate(PROPERTIES.getProperty(
"create_base_db"));
44 conn = DriverManager.getConnection(
45 PROPERTIES.getProperty(
"base_db_connection_url"), user,
password);
46 statement = conn.createStatement();
47 statement.executeUpdate(PROPERTIES.getProperty(
"drop_base_table1"));
48 statement.executeUpdate(PROPERTIES.getProperty(
"create_base_table1"));
50 ResultSet rs = statement.executeQuery(PROPERTIES.getProperty(
"select_base_table1"));
51 ResultSetMetaData rs_md = rs.getMetaData();
52 int col_cnt = rs_md.getColumnCount();
54 int type = rs_md.getColumnType(col_cnt);
55 String
name = rs_md.getColumnTypeName(col_cnt--);
56 assertEquals(type,
answers[col_cnt].type);
57 assertEquals(name,
answers[col_cnt].name);
59 statement.executeUpdate(PROPERTIES.getProperty(
"drop_base_table1"));
60 statement.executeUpdate(PROPERTIES.getProperty(
"drop_base_db"));
static Properties PROPERTIES
static final String password