diff --git a/src/default.style b/src/default.style new file mode 100644 index 0000000..921404c --- /dev/null +++ b/src/default.style @@ -0,0 +1,232 @@ +# This is the default osm2pgsql .style file that comes with osm2pgsql. +# +# A .style file has 4 columns that define how OSM objects end up in tables in +# the database and what columns are created. It interacts with the command-line +# hstore options. +# +# Columns +# ======= +# +# OsmType: This is either "node", "way" or "node,way" and indicates if this tag +# applies to nodes, ways, or both. +# +# Tag: The tag +# +# DataType: The type of the column to be created. Normally "text" +# +# Flags: Flags that indicate what table the OSM object is moved into. +# +# There are 6 possible flags. These flags are used both to indicate if a column +# should be created, and if ways with the tag are assumed to be areas. The area +# assumptions can be overridden with an area=yes/no tag +# +# polygon - Create a column for this tag, and objects with the tag are areas +# +# linear - Create a column for this tag +# +# nocolumn - Override the above and don't create a column for the tag, but do +# include objects with this tag +# +# phstore - Same as polygon,nocolumn for backward compatibility +# +# delete - Drop this tag completely and don't create a column for it. This also +# prevents the tag from being added to hstore columns +# +# nocache - Deprecated and does nothing +# +# If an object has a tag that indicates it is an area or has area=yes/1, +# osm2pgsql will try to turn it into an area. If it succeeds, it places it in +# the polygon table. If it fails (e.g. not a closed way) it places it in the +# line table. +# +# Nodes are never placed into the polygon or line table and are always placed in +# the point table. +# +# Hstore +# ====== +# +# The options --hstore, --hstore-match-only, and --hstore-all interact with +# the .style file. +# +# With --hstore any tags without a column will be added to the hstore column. +# This will also cause all objects to be kept. +# +# With --hstore-match-only the behavior for tags is the same, but objects are +# only kept if they have a non-NULL value in one of the columns. +# +# With --hstore-all all tags are added to the hstore column unless they appear +# in the style file with a delete flag, causing duplication between the normal +# columns and the hstore column. +# +# Special database columns +# ======================== +# +# There are some special database columns that if present in the .style file +# will be populated by osm2pgsql. +# +# These are +# +# z_order - datatype int4 +# +# way_area - datatype real. The area of the way, in the units of the projection +# (e.g. square mercator meters). Only applies to areas +# +# osm_user - datatype text +# osm_uid - datatype integer +# osm_version - datatype integer +# osm_changeset - datatype integer +# osm_timestamp - datatype timestamptz(0). +# Used with the --extra-attributes option to include metadata in the database. +# If importing with both --hstore and --extra-attributes the meta-data will +# end up in the tags hstore column regardless of the style file. + +# OsmType Tag DataType Flags +node,way access text linear +node,way addr:housename text linear +node,way addr:housenumber text linear +node,way addr:interpolation text linear +node,way admin_level text linear +node,way aerialway text linear +node,way aeroway text polygon +node,way amenity text polygon +node,way area text polygon # hard coded support for area=1/yes => polygon is in osm2pgsql +node,way barrier text linear +node,way bicycle text linear +node,way brand text linear +node,way bridge text linear +node,way boundary text linear +node,way building text polygon +node capital text linear +node,way construction text linear +node,way covered text linear +node,way culvert text linear +node,way cutting text linear +node,way denomination text linear +node,way disused text linear +node ele text linear +node,way embankment text linear +node,way foot text linear +node,way generator:source text linear +node,way harbour text polygon +node,way highway text linear +node,way historic text polygon +node,way horse text linear +node,way intermittent text linear +node,way junction text linear +node,way landuse text polygon +node,way layer text linear +node,way leisure text polygon +node,way lock text linear +node,way man_made text polygon +node,way military text polygon +node,way motorcar text linear +node,way name text linear +node,way natural text polygon # natural=coastline tags are discarded by a hard coded rule in osm2pgsql +node,way office text polygon +node,way oneway text linear +node,way operator text linear +node,way place text polygon +node,way population text linear +node,way power text polygon +node,way power_source text linear +node,way public_transport text polygon +node,way railway text linear +node,way ref text linear +node,way religion text linear +node,way route text linear +node,way service text linear +node,way shop text polygon +node,way sport text polygon +node,way surface text linear +node,way toll text linear +node,way tourism text polygon +node,way tower:type text linear +way tracktype text linear +node,way tunnel text linear +node,way water text polygon +node,way waterway text polygon +node,way wetland text polygon +node,way width text linear +node,way wood text linear +node,way z_order int4 linear # This is calculated during import +way way_area real linear # This is calculated during import + +# Area tags +# We don't make columns for these tags, but objects with them are areas. +# Mainly for use with hstore +way abandoned:aeroway text polygon,nocolumn +way abandoned:amenity text polygon,nocolumn +way abandoned:building text polygon,nocolumn +way abandoned:landuse text polygon,nocolumn +way abandoned:power text polygon,nocolumn +way area:highway text polygon,nocolumn + +# Deleted tags +# These are tags that are generally regarded as useless for most rendering. +# Most of them are from imports or intended as internal information for mappers +# Some of them are automatically deleted by editors. +# If you want some of them, perhaps for a debugging layer, just delete the lines. + +# These tags are used by mappers to keep track of data. +# They aren't very useful for rendering. +node,way note text delete +node,way note:* text delete +node,way source text delete +node,way source_ref text delete +node,way source:* text delete +node,way attribution text delete +node,way comment text delete +node,way fixme text delete + +# Tags generally dropped by editors, not otherwise covered +node,way created_by text delete +node,way odbl text delete +node,way odbl:note text delete +node,way SK53_bulk:load text delete + +# Lots of import tags +# TIGER (US) +node,way tiger:* text delete + +# NHD (US) +# NHD has been converted every way imaginable +node,way NHD:* text delete +node,way nhd:* text delete + +# GNIS (US) +node,way gnis:* text delete + +# Geobase (CA) +node,way geobase:* text delete +# NHN (CA) +node,way accuracy:meters text delete +node,way sub_sea:type text delete +node,way waterway:type text delete + +# KSJ2 (JA) +# See also note:ja and source_ref above +node,way KSJ2:* text delete +# Yahoo/ALPS (JA) +node,way yh:* text delete + +# osak (DK) +node,way osak:* text delete + +# kms (DK) +node,way kms:* text delete + +# ngbe (ES) +# See also note:es and source:file above +node,way ngbe:* text delete + +# naptan (UK) +node,way naptan:* text delete + +# Corine (CLC) (Europe) +node,way CLC:* text delete + +# misc +node,way 3dshapes:ggmodelk text delete +node,way AND_nosr_r text delete +node,way import text delete +node,way it:fvg:* text delete diff --git a/src/osmCoverage.style b/src/osmCoverage.style new file mode 100644 index 0000000..2a99149 --- /dev/null +++ b/src/osmCoverage.style @@ -0,0 +1,240 @@ +# This is the default osm2pgsql .style file that comes with osm2pgsql. +# +# A .style file has 4 columns that define how OSM objects end up in tables in +# the database and what columns are created. It interacts with the command-line +# hstore options. +# +# Columns +# ======= +# +# OsmType: This is either "node", "way" or "node,way" and indicates if this tag +# applies to nodes, ways, or both. +# +# Tag: The tag +# +# DataType: The type of the column to be created. Normally "text" +# +# Flags: Flags that indicate what table the OSM object is moved into. +# +# There are 6 possible flags. These flags are used both to indicate if a column +# should be created, and if ways with the tag are assumed to be areas. The area +# assumptions can be overridden with an area=yes/no tag +# +# polygon - Create a column for this tag, and objects with the tag are areas +# +# linear - Create a column for this tag +# +# nocolumn - Override the above and don't create a column for the tag, but do +# include objects with this tag +# +# phstore - Same as polygon,nocolumn for backward compatibility +# +# delete - Drop this tag completely and don't create a column for it. This also +# prevents the tag from being added to hstore columns +# +# nocache - Deprecated and does nothing +# +# If an object has a tag that indicates it is an area or has area=yes/1, +# osm2pgsql will try to turn it into an area. If it succeeds, it places it in +# the polygon table. If it fails (e.g. not a closed way) it places it in the +# line table. +# +# Nodes are never placed into the polygon or line table and are always placed in +# the point table. +# +# Hstore +# ====== +# +# The options --hstore, --hstore-match-only, and --hstore-all interact with +# the .style file. +# +# With --hstore any tags without a column will be added to the hstore column. +# This will also cause all objects to be kept. +# +# With --hstore-match-only the behavior for tags is the same, but objects are +# only kept if they have a non-NULL value in one of the columns. +# +# With --hstore-all all tags are added to the hstore column unless they appear +# in the style file with a delete flag, causing duplication between the normal +# columns and the hstore column. +# +# Special database columns +# ======================== +# +# There are some special database columns that if present in the .style file +# will be populated by osm2pgsql. +# +# These are +# +# z_order - datatype int4 +# +# way_area - datatype real. The area of the way, in the units of the projection +# (e.g. square mercator meters). Only applies to areas +# +# osm_user - datatype text +# osm_uid - datatype integer +# osm_version - datatype integer +# osm_changeset - datatype integer +# osm_timestamp - datatype timestamptz(0). +# Used with the --extra-attributes option to include metadata in the database. +# If importing with both --hstore and --extra-attributes the meta-data will +# end up in the tags hstore column regardless of the style file. + +# OsmType Tag DataType Flags +node,way access text linear +node,way addr:housename text linear +node,way addr:housenumber text linear +node,way addr:interpolation text linear +node,way admin_level text linear +node,way aerialway text linear +node,way aeroway text polygon +node,way amenity text polygon +node,way abandoned:amenity text linear +node,way demolished:amenity text linear +node,way disused:amenity text linear +node,way removed:amenity text linear +node,way historic:amenity text linear +node,way no:amenity text linear +node,way was:amenity text linear +node,way area text polygon # hard coded support for area=1/yes => polygon is in osm2pgsql +node,way barrier text linear +node,way bicycle text linear +node,way brand text linear +node,way bridge text linear +node,way boundary text linear +node,way building text polygon +node,way bus text linear +node capital text linear +node,way construction text linear +node,way covered text linear +node,way culvert text linear +node,way cutting text linear +node,way denomination text linear +node,way disused text linear +node ele text linear +node,way embankment text linear +node,way fixme text linear +node,way foot text linear +node,way generator:source text linear +node,way harbour text polygon +node,way highway text linear +node,way historic text polygon +node,way horse text linear +node,way intermittent text linear +node,way junction text linear +node,way landuse text polygon +node,way layer text linear +node,way leisure text polygon +node,way lock text linear +node,way man_made text polygon +node,way military text polygon +node,way motorcar text linear +node,way name text linear +node,way natural text polygon # natural=coastline tags are discarded by a hard coded rule in osm2pgsql +node,way office text polygon +node,way oneway text linear +node,way operator text linear +node,way place text polygon +node,way population text linear +node,way power text polygon +node,way power_source text linear +node,way public_transport text polygon +node,way railway text linear +node,way ref text linear +node,way religion text linear +node,way route text linear +node,way service text linear +node,way shop text polygon +node,way sport text polygon +node,way surface text linear +node,way toll text linear +node,way tourism text polygon +node,way tower:type text linear +way tracktype text linear +node,way tunnel text linear +node,way water text polygon +node,way waterway text polygon +node,way wetland text polygon +node,way width text linear +node,way wood text linear +node,way z_order int4 linear # This is calculated during import +way way_area real linear # This is calculated during import + +# Area tags +# We don't make columns for these tags, but objects with them are areas. +# Mainly for use with hstore +way abandoned:aeroway text polygon,nocolumn +way abandoned:building text polygon,nocolumn +way abandoned:landuse text polygon,nocolumn +way abandoned:power text polygon,nocolumn +way area:highway text polygon,nocolumn + +# Deleted tags +# These are tags that are generally regarded as useless for most rendering. +# Most of them are from imports or intended as internal information for mappers +# Some of them are automatically deleted by editors. +# If you want some of them, perhaps for a debugging layer, just delete the lines. + +# These tags are used by mappers to keep track of data. +# They aren't very useful for rendering. +node,way note text delete +node,way note:* text delete +node,way source text delete +node,way source_ref text delete +node,way source:* text delete +node,way attribution text delete +node,way comment text delete +#node,way fixme text delete + +# Tags generally dropped by editors, not otherwise covered +node,way created_by text delete +node,way odbl text delete +node,way odbl:note text delete +node,way SK53_bulk:load text delete + +# Lots of import tags +# TIGER (US) +node,way tiger:* text delete + +# NHD (US) +# NHD has been converted every way imaginable +node,way NHD:* text delete +node,way nhd:* text delete + +# GNIS (US) +node,way gnis:* text delete + +# Geobase (CA) +node,way geobase:* text delete +# NHN (CA) +node,way accuracy:meters text delete +node,way sub_sea:type text delete +node,way waterway:type text delete + +# KSJ2 (JA) +# See also note:ja and source_ref above +node,way KSJ2:* text delete +# Yahoo/ALPS (JA) +node,way yh:* text delete + +# osak (DK) +node,way osak:* text delete + +# kms (DK) +node,way kms:* text delete + +# ngbe (ES) +# See also note:es and source:file above +node,way ngbe:* text delete + +# naptan (UK) +node,way naptan:* text delete + +# Corine (CLC) (Europe) +node,way CLC:* text delete + +# misc +node,way 3dshapes:ggmodelk text delete +node,way AND_nosr_r text delete +node,way import text delete +node,way it:fvg:* text delete diff --git a/src/osmCoverage_PoliceJson.sh b/src/osmCoverage_PoliceJson.sh index b9bd0dd..6e70cb0 100644 --- a/src/osmCoverage_PoliceJson.sh +++ b/src/osmCoverage_PoliceJson.sh @@ -8,6 +8,7 @@ curl --user yuu:yuu8844 -O http://localhost:8080/job/hayashiLib/lastSuccessfulBuild/artifact/dist/hayashi.jar curl --user yuu:yuu8844 -O http://localhost:8080/job/osmCoverage/lastSuccessfulBuild/artifact/osmCoverage.jar + ### export from PostGIS java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToGeoJSON diff --git a/test/osm/jp/coverage/fuel/AllTest.java b/test/osm/jp/coverage/fuel/AllTest.java new file mode 100644 index 0000000..4c759b0 --- /dev/null +++ b/test/osm/jp/coverage/fuel/AllTest.java @@ -0,0 +1,38 @@ +package osm.jp.coverage.fuel; + +import java.io.File; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + DbExistTest.class, + DbFuelTest.class, + FuelTest.class +}) +public class AllTest { + + @BeforeClass + public static void setUpClass() throws Exception { + File dir = new File("database"); + dir.deleteOnExit(); + dir.mkdir(); + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + +} diff --git a/test/osm/jp/coverage/fuel/DbExistTest.java b/test/osm/jp/coverage/fuel/DbExistTest.java index 4426746..849e49d 100644 --- a/test/osm/jp/coverage/fuel/DbExistTest.java +++ b/test/osm/jp/coverage/fuel/DbExistTest.java @@ -12,24 +12,17 @@ import static org.hamcrest.CoreMatchers.is; import org.junit.*; import static org.junit.Assert.*; +import org.junit.runners.MethodSorters; import static osm.jp.api.Osmdb.create; -/** - * - * @author yuu - */ +@FixMethodOrder (MethodSorters.NAME_ASCENDING) public class DbExistTest { + public void init() throws Exception { + } + + @Before public void setUp() throws Exception { - File dir = new File("database"); - if (dir.exists()) { - if (dir.isDirectory()) { - dir.deleteOnExit(); - } - else { - throw new Exception("'database' is not directory."); - } - } } @After @@ -41,14 +34,10 @@ Connection con = null; try { // DB.tableを作成 + init(); con = DatabaseTool.openDb("database"); create(con); - } - catch (ClassNotFoundException ex) { - fail(); - } catch (SQLException ex) { - fail(); - } catch (IOException ex) { + } catch (Exception ex) { fail(); } finally { if (con != null) { @@ -98,15 +87,19 @@ } @Test - public void test02_fuel() { + public void test020_fuel() { try { + init(); String[] args = new String[0]; DbExist.main(args); } catch (Exception ex) { fail(ex.toString()); } - + } + + @Test + public void test021_fuel() { File dir = new File("database"); assertTrue(dir.exists()); assertTrue(dir.isDirectory()); @@ -209,6 +202,19 @@ fail(); } } + + // node: "removed:amenity=fuel" (5338111023) https://www.openstreetmap.org/node/5338111023 + // ノード: removed (5338111023) 場所: 35.4305614, 139.3662339 + ps1 = hsqldb.prepareStatement("SELECT score,name,lat,lon FROM OSM_EXIST where idref='5338111023'"); + try (ResultSet rset1 = ps1.executeQuery()) { + if (rset1.next()) { + assertThat(rset1.getInt("score"), is(50)); + assertThat(checkRenge(rset1, "35.4305614", "139.3662339"), is(true)); + } + else { + fail(); + } + } } catch (ClassNotFoundException ex) { Logger.getLogger(DbExistTest.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { diff --git a/test/osm/jp/coverage/fuel/DbFuelTest.java b/test/osm/jp/coverage/fuel/DbFuelTest.java new file mode 100644 index 0000000..54cbef7 --- /dev/null +++ b/test/osm/jp/coverage/fuel/DbFuelTest.java @@ -0,0 +1,43 @@ +package osm.jp.coverage.fuel; + +import java.io.IOException; +import java.sql.SQLException; +import javax.xml.parsers.ParserConfigurationException; +import org.junit.After; +import org.junit.AfterClass; +import static org.junit.Assert.fail; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.xml.sax.SAXException; + +public class DbFuelTest { + + @BeforeClass + public static void setUpClass() throws Exception { + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void test00_main() throws Exception { + try { + String[] args = new String[0]; + DbFuel.main(args); + } + catch(IOException | ClassNotFoundException | SQLException | ParserConfigurationException | SAXException e) { + fail(e.toString()); + } + } + +} diff --git a/test/osm/jp/coverage/fuel/FuelTest.java b/test/osm/jp/coverage/fuel/FuelTest.java new file mode 100644 index 0000000..c2b05ad --- /dev/null +++ b/test/osm/jp/coverage/fuel/FuelTest.java @@ -0,0 +1,188 @@ +package osm.jp.coverage.fuel; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import jp.co.areaweb.tools.database.DatabaseTool; +import org.junit.*; +import static org.junit.Assert.*; +import org.junit.runners.MethodSorters; +import org.xml.sax.SAXException; +import osm.jp.api.HttpPOST; + +@FixMethodOrder (MethodSorters.NAME_ASCENDING) +public class FuelTest { + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void test00_Fuel_main() { + try { + String[] args = new String[0]; + Fuel.main(args); + } + catch (IOException | ClassNotFoundException | SQLException | ParserConfigurationException | TransformerException | SAXException ex) { + fail(ex.toString()); + } + } + + + + /** + * OSM: removed:amenity=fuel 35.4305614, 139.3662339 + * GML: 14, n00375 + */ + @Test + public void test01_dataread() { + Connection hsqldb = null; + try { + hsqldb = DatabaseTool.openDb("database"); + + double lat = 35.43035D; // 35.43035 35.4305614, 139.3662339 + double lon = 139.36622D; //139.36622 + String where = String.format("(lat > '%s') and (lat < '%s') and (lon > '%s') and (lon < '%s')", + String.valueOf(lat-0.001D), String.valueOf(lat+0.001D), + String.valueOf(lon-0.001D), String.valueOf(lon+0.001D)); + String sql = String.format("SELECT * FROM %s WHERE %s", DbFuel.TABLE_NAME, where); + PreparedStatement ps1 = hsqldb.prepareStatement(sql); + try (ResultSet rset1 = ps1.executeQuery()) { + while (rset1.next()) { + System.out.println(rset1.getString("idref")); + System.out.println(rset1.getString("gid")); + System.out.println(rset1.getInt("area")); + System.out.println(rset1.getInt("fixed")); + System.out.println(rset1.getInt("fixed1")); + System.out.println(rset1.getDouble("lat")); + System.out.println(rset1.getDouble("lon")); + } + } + + } catch (IOException | ClassNotFoundException | SQLException ex) { + Logger.getLogger(FuelTest.class.getName()).log(Level.SEVERE, null, ex); + fail(ex.toString()); + } finally { + DatabaseTool.closeDb(hsqldb); + } + } + + boolean checkRenge(ResultSet rset, String latStr, String lonStr) throws SQLException { + if (checkRenge(rset.getDouble("lat"), latStr)) { + if (checkRenge(rset.getDouble("lon"), lonStr)) { + return true; + } + } + return false; + } + + boolean checkRenge(double d1, String str) throws SQLException { + double base = Double.parseDouble(str); + double up = d1 + 0.00000009D; + double down = d1 - 0.00000009D; + boolean ret = true; + if (Double.compare(base, up) > 0) { + ret = false; + } + if (Double.compare(base, down) < 0) { + ret = false; + } + System.out.println("d1: "+ d1 +" : "+ str +" --> "+ (ret ? "IN" : "out")); + return ret; + } + + /** + * OSM: 5338111023 removed:amenity=fuel 35.4305614, 139.3662339 + * GML: 14, n00375 + */ + @Test + public void test91_removed() { + Connection hsqldb = null; + String sql1 = String.format("SELECT * FROM %s where idref='%s'", HttpPOST.TABLE_NAME, "5338111023"); + try { + hsqldb = DatabaseTool.openDb("database"); + try (PreparedStatement ps1 = hsqldb.prepareStatement(sql1)){ + try (ResultSet rset1 = ps1.executeQuery()) { + assertTrue(rset1.next()); + } + } + } + catch(Exception e){ + fail(e.toString()); + } finally { + DatabaseTool.closeDb(hsqldb); + } + + double lat = 35.43035D; // 35.43035 35.4305614, 139.3662339 + double lon = 139.36622D; //139.36622 + String idrefs = getRefid(lat, lon); + System.out.println(idrefs); + } + + /** + * OSM: ノード: 出光 (1600343871) 35.4214195, 139.3600994 + * GML: 14, n00375 + */ + @Test + public void test92_normal() { + double lat = 35.4214195D; + double lon = 139.3600994D; + String idrefs = getRefid(lat, lon); + System.out.println(idrefs); + } + + /** + * + * + * @param lat 35.43035D; // 35.43035 35.4305614, 139.3662339 + * @param lon 139.36622D + * @return + */ + public String getRefid(double lat, double lon) { + String ret = ""; + + Connection hsqldb = null; + try { + hsqldb = DatabaseTool.openDb("database"); + + String where = String.format("(lat > '%s') and (lat < '%s') and (lon > '%s') and (lon < '%s')", + String.valueOf(lat-0.001D), String.valueOf(lat+0.001D), + String.valueOf(lon-0.001D), String.valueOf(lon+0.001D)); + String sql = String.format("SELECT * FROM %s WHERE %s", DbFuel.TABLE_NAME, where); + System.out.println(sql); + PreparedStatement ps1 = hsqldb.prepareStatement(sql); + try (ResultSet rset1 = ps1.executeQuery()) { + while (rset1.next()) { + System.out.println("{"); + System.out.println("idref:" + rset1.getString("idref")); + System.out.println("gid:" + rset1.getString("gid")); + System.out.println("area:" + rset1.getInt("area")); + System.out.println("fixed:" + rset1.getInt("fixed")); + System.out.println("fixed1:" + rset1.getInt("fixed1")); + System.out.println("lat:" + rset1.getDouble("lat")); + System.out.println("lon:" + rset1.getDouble("lon")); + System.out.println("}"); + if (ret.length() > 0) { + ret += ","; + } + ret += rset1.getString("idref"); + } + } + } catch (IOException | ClassNotFoundException | SQLException ex) { + Logger.getLogger(FuelTest.class.getName()).log(Level.SEVERE, null, ex); + fail(ex.toString()); + } finally { + DatabaseTool.closeDb(hsqldb); + } + return ret; + } +}