Newer
Older
osmCoverage / test / osm / jp / postgis / PostgresqlTest.java
@yuu yuu on 24 Dec 2018 1 KB function: UnMapped.
  1. package osm.jp.postgis;
  2.  
  3. import java.sql.Connection;
  4. import jp.co.areaweb.tools.database.DatabaseTool;
  5. import org.junit.After;
  6. import org.junit.AfterClass;
  7. import static org.junit.Assert.assertNotNull;
  8. import static org.junit.Assert.fail;
  9. import org.junit.Before;
  10. import org.junit.BeforeClass;
  11. import org.junit.Test;
  12.  
  13. /**
  14. * database connect test.
  15. * `database.properties` hsqldb
  16. */
  17. public class PostgresqlTest {
  18. @BeforeClass
  19. public static void setUpClass() {
  20. }
  21. @AfterClass
  22. public static void tearDownClass() {
  23. }
  24. @Before
  25. public void setUp() {
  26. }
  27. @After
  28. public void tearDown() {
  29. }
  30. /**
  31. * postgresql `gisdb.properties`
  32. * postgresql - PostGIS : gisdb
  33. */
  34. @Test
  35. public void connectTest_postgis() {
  36. connect("gisdb");
  37. }
  38. void connect(String dbname) {
  39. try (Connection postgresql = DatabaseTool.openDb(dbname)) {
  40. assertNotNull(postgresql);
  41. }
  42. catch (Exception ex) {
  43. fail(ex.toString());
  44. }
  45. }
  46. }