package osm.jp.postgis; import java.sql.Connection; import jp.co.areaweb.tools.database.DatabaseTool; import org.junit.After; import org.junit.AfterClass; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * database connect test. * `database.properties` hsqldb */ public class PostgresqlTest { @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * postgresql `gisdb.properties` * postgresql - PostGIS : gisdb */ @Test public void connectTest_postgis() { connect("gisdb"); } void connect(String dbname) { try (Connection postgresql = DatabaseTool.openDb(dbname)) { assertNotNull(postgresql); } catch (Exception ex) { fail(ex.toString()); } } }