2 import static org.junit.Assert.*;
7 import java.util.Properties;
11 static final String
url = PROPERTIES.getProperty(
"default_db_connection_url");
12 static final String
user = PROPERTIES.getProperty(
"default_super_user");
13 static final String
password = PROPERTIES.getProperty(
"default_user_password");
17 "create table jdbc_geom (m_point POINT, m_linestring LINESTRING, m_polygon POLYGON, m_multi_polygon MULTIPOLYGON)";
20 "insert into jdbc_geom values ('POINT(0 0)', 'LINESTRING(0 1, 2 2)',"
21 +
" 'POLYGON((0 0,4 0,4 4,0 0))',"
22 +
" 'MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0)))')";
32 assertNotEquals(null, conn);
33 Statement statement = conn.createStatement();
40 Object m_point = rs.getObject(
"m_point");
41 Object m_linestring = rs.getObject(
"m_linestring");
42 Object m_polygon = rs.getObject(
"m_polygon");
43 Object m_multi_polygon = rs.getString(
"m_multi_polygon");
44 assertEquals(
"POLYGON ((0 0,4 0,4 4,0 0))", m_polygon);
45 assertEquals(
"LINESTRING (0 1,2 2)", m_linestring);
46 assertEquals(
"POINT (0 0)", m_point);
47 assertEquals(
"MULTIPOLYGON (((0 0,4 0,4 4,0 4,0 0)))", m_multi_polygon);
57 assertNotEquals(null, conn);
58 Statement statement = conn.createStatement();
62 ps.setString(1,
"POINT(0 0)");
63 ps.setString(2,
"LINESTRING(0 1, 2 2)");
64 ps.setString(3,
"POLYGON((0 0,4 0,4 4,0 0))");
65 ps.setString(4,
"MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0)))");
72 Object m_point = rs.getObject(
"m_point");
73 Object m_linestring = rs.getString(
"m_linestring");
74 Object m_polygon = rs.getObject(
"m_polygon");
75 String m_multi_polygon = rs.getString(
"m_multi_polygon");
76 assertEquals(
"POLYGON ((0 0,4 0,4 4,0 0))", m_polygon);
77 assertEquals(
"LINESTRING (0 1,2 2)", m_linestring);
78 assertEquals(
"POINT (0 0)", m_point);
79 assertEquals(
"MULTIPOLYGON (((0 0,4 0,4 4,0 4,0 0)))", m_multi_polygon);
static String sql_create_tbl_geom
static String sql_insert_geom_batch
static String sql_insert_geom
static String sql_drop_tbl_geom
static final String password
static String sql_select_geom
static Properties PROPERTIES