Strabon
changeset 756:cdccd4393346
added Strabon.isLocked() method for checking whether the database is locked and in such a case not creating a Strabon instance
line diff
1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Thu Nov 29 14:38:04 2012 +0200 1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Thu Nov 29 20:13:48 2012 +0200 1.3 @@ -76,15 +76,19 @@ 1.4 private SailRepository repo1; 1.5 private SailRepositoryConnection con1 = null; 1.6 1.7 - public Strabon(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable) throws SQLException, ClassNotFoundException { 1.8 + public Strabon(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable) throws Exception { 1.9 this.databaseName = databaseName; 1.10 this.user = user; 1.11 this.password = password; 1.12 this.port = port; 1.13 this.serverName = serverName; 1.14 1.15 - if (checkForLockTable == true) { 1.16 + if (checkForLockTable == true) { // force check of locked table and delete if exists 1.17 checkAndDeleteLock(databaseName, user, password, port, serverName); 1.18 + 1.19 + } else if (isLocked()) { // check for lock and exit if exists 1.20 + throw new Exception("Cannot connect to database. Database is already locked by another process."); 1.21 + 1.22 } 1.23 1.24 initiate(databaseName, user, password, port, serverName); 1.25 @@ -143,6 +147,12 @@ 1.26 } 1.27 } 1.28 1.29 + /** 1.30 + * Check whether the database is locked by another instance of Strabon or Endpoint. 1.31 + * 1.32 + * @return 1.33 + */ 1.34 + protected abstract boolean isLocked() throws SQLException, ClassNotFoundException; 1.35 1.36 protected abstract void checkAndDeleteLock(String databaseName, String user, String password, int port, String serverName) 1.37 throws SQLException, ClassNotFoundException;
2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/Strabon.java Thu Nov 29 14:38:04 2012 +0200 2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/Strabon.java Thu Nov 29 20:13:48 2012 +0200 2.3 @@ -13,17 +13,23 @@ 2.4 import java.sql.DriverManager; 2.5 import java.sql.ResultSet; 2.6 import java.sql.SQLException; 2.7 +import java.sql.Statement; 2.8 2.9 import org.openrdf.sail.monetdb.MonetDBSqlStore; 2.10 import org.slf4j.Logger; 2.11 import org.slf4j.LoggerFactory; 2.12 2.13 +/** 2.14 + * 2.15 + * @author Charalampos Nikolaou <charnik@di.uoa.gr> 2.16 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 2.17 + */ 2.18 public class Strabon extends eu.earthobservatory.runtime.generaldb.Strabon { 2.19 2.20 private static Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.monetdb.Strabon.class); 2.21 2.22 public Strabon(String databaseName, String user, String password, int port, 2.23 - String serverName, boolean checkForLockTable) throws SQLException, ClassNotFoundException { 2.24 + String serverName, boolean checkForLockTable) throws Exception { 2.25 super(databaseName, user, password, port, serverName, checkForLockTable); 2.26 } 2.27 2.28 @@ -59,8 +65,9 @@ 2.29 java.sql.Statement st = conn.createStatement(); 2.30 // change 2.31 ResultSet resultSet = st.executeQuery("SELECT true FROM sys._tables WHERE name='locked' AND system=false"); 2.32 - if ( resultSet.next() ) 2.33 + if (resultSet.next()) { 2.34 st.execute("DROP TABLE \"locked\""); 2.35 + } 2.36 st.close(); 2.37 conn.close(); 2.38 } catch (SQLException e) { 2.39 @@ -84,4 +91,42 @@ 2.40 logger.warn("[Strabon.deregisterDriver] Could not deregister JDBC driver: {}", e.getMessage()); 2.41 } 2.42 } 2.43 + 2.44 + @Override 2.45 + protected boolean isLocked() throws SQLException, ClassNotFoundException { 2.46 + Connection conn = null; 2.47 + Statement st = null; 2.48 + String url = ""; 2.49 + 2.50 + try { 2.51 + logger.info("[Strabon] Checking for locks..."); 2.52 + Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); 2.53 + url = "jdbc:monetdb://" + serverName + ":" + port + "/" + databaseName + "?user=" + user + "&password=" + password; 2.54 + 2.55 + conn = DriverManager.getConnection(url); 2.56 + st = conn.createStatement(); 2.57 + 2.58 + ResultSet resultSet = st.executeQuery("SELECT true FROM sys._tables WHERE name='locked' AND system=false"); 2.59 + return resultSet.next() ? true:false; 2.60 + 2.61 + } catch (SQLException e) { 2.62 + logger.error("[Strabon.isLocked] SQL Exception occured. Connection URL is <{}>: {}", url, e.getMessage()); 2.63 + throw e; 2.64 + 2.65 + } catch (ClassNotFoundException e) { 2.66 + logger.error("[Strabon.isLocked] Could not load postgres jdbc driver: {}", e.getMessage()); 2.67 + throw e; 2.68 + 2.69 + } finally { 2.70 + // close statement and connection 2.71 + if (st != null) { 2.72 + st.close(); 2.73 + } 2.74 + 2.75 + if (conn != null) { 2.76 + conn.close(); 2.77 + } 2.78 + } 2.79 + 2.80 + } 2.81 }
3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/postgis/Strabon.java Thu Nov 29 14:38:04 2012 +0200 3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/postgis/Strabon.java Thu Nov 29 20:13:48 2012 +0200 3.3 @@ -11,22 +11,28 @@ 3.4 3.5 import java.sql.Connection; 3.6 import java.sql.DriverManager; 3.7 +import java.sql.ResultSet; 3.8 import java.sql.SQLException; 3.9 +import java.sql.Statement; 3.10 3.11 import org.openrdf.sail.postgis.PostGISSqlStore; 3.12 import org.slf4j.Logger; 3.13 import org.slf4j.LoggerFactory; 3.14 3.15 +/** 3.16 + * 3.17 + * @author Charalampos Nikolaou <charnik@di.uoa.gr> 3.18 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 3.19 + */ 3.20 public class Strabon extends eu.earthobservatory.runtime.generaldb.Strabon { 3.21 3.22 private static Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.postgis.Strabon.class); 3.23 3.24 public Strabon(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable) 3.25 - throws SQLException, ClassNotFoundException { 3.26 + throws Exception { 3.27 super(databaseName, user, password, port, serverName, checkForLockTable); 3.28 } 3.29 3.30 - 3.31 protected void initiate(String databaseName, String user, String password, int port, String serverName) { 3.32 db_store = new PostGISSqlStore(); 3.33 3.34 @@ -76,4 +82,41 @@ 3.35 logger.warn("[Strabon.deregisterDriver] Could not deregister JDBC driver: {}", e.getMessage()); 3.36 } 3.37 } 3.38 + 3.39 + @Override 3.40 + protected boolean isLocked() throws SQLException, ClassNotFoundException{ 3.41 + Connection conn = null; 3.42 + Statement st = null; 3.43 + String url = ""; 3.44 + 3.45 + try { 3.46 + logger.info("[Strabon] Checking for locks..."); 3.47 + Class.forName("org.postgresql.Driver"); 3.48 + url = "jdbc:postgresql://" + serverName + ":" + port + "/" + databaseName + "?user=" + user + "&password=" + password; 3.49 + 3.50 + conn = DriverManager.getConnection(url); 3.51 + st = conn.createStatement(); 3.52 + ResultSet rs = st.executeQuery("SELECT tablename FROM pg_tables WHERE schemaname='public' AND tablename='locked';"); 3.53 + 3.54 + return rs.next() ? true:false; 3.55 + 3.56 + } catch (SQLException e) { 3.57 + logger.error("[Strabon.isLocked] SQL Exception occured. Connection URL is <{}>: {}", url, e.getMessage()); 3.58 + throw e; 3.59 + 3.60 + } catch (ClassNotFoundException e) { 3.61 + logger.error("[Strabon.isLocked] Could not load postgres jdbc driver: {}", e.getMessage()); 3.62 + throw e; 3.63 + 3.64 + } finally { 3.65 + // close statement and connection 3.66 + if (st != null) { 3.67 + st.close(); 3.68 + } 3.69 + 3.70 + if (conn != null) { 3.71 + conn.close(); 3.72 + } 3.73 + } 3.74 + } 3.75 }
4.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/postgis/testCRS.java Thu Nov 29 14:38:04 2012 +0200 4.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/postgis/testCRS.java Thu Nov 29 20:13:48 2012 +0200 4.3 @@ -33,6 +33,8 @@ 4.4 } catch (ClassNotFoundException e) { 4.5 // TODO Auto-generated catch block 4.6 e.printStackTrace(); 4.7 + } catch (Exception e) { 4.8 + e.printStackTrace(); 4.9 } 4.10 4.11 String text =
5.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Thu Nov 29 14:38:04 2012 +0200 5.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Thu Nov 29 20:13:48 2012 +0200 5.3 @@ -9,16 +9,10 @@ 5.4 */ 5.5 package eu.earthobservatory.runtime.monetdb; 5.6 5.7 -import java.io.IOException; 5.8 import java.sql.SQLException; 5.9 5.10 import org.junit.AfterClass; 5.11 import org.junit.BeforeClass; 5.12 -import org.openrdf.repository.RepositoryException; 5.13 -import org.openrdf.rio.RDFHandlerException; 5.14 -import org.openrdf.rio.RDFParseException; 5.15 - 5.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 5.17 5.18 /** 5.19 * A set of simple tests on SPARQL query functionality 5.20 @@ -28,7 +22,7 @@ 5.21 public class AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 5.22 5.23 @BeforeClass 5.24 - public static void beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 5.25 + public static void beforeClass(String inputfile) throws Exception 5.26 { 5.27 strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 5.28
6.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Thu Nov 29 14:38:04 2012 +0200 6.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Thu Nov 29 20:13:48 2012 +0200 6.3 @@ -18,11 +18,6 @@ 6.4 import org.openrdf.query.MalformedQueryException; 6.5 import org.openrdf.query.QueryEvaluationException; 6.6 import org.openrdf.query.TupleQueryResultHandlerException; 6.7 -import org.openrdf.repository.RepositoryException; 6.8 -import org.openrdf.rio.RDFHandlerException; 6.9 -import org.openrdf.rio.RDFParseException; 6.10 - 6.11 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 6.12 6.13 /** 6.14 * A set of simple tests on SPARQL query functionality 6.15 @@ -32,7 +27,7 @@ 6.16 public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 6.17 6.18 @BeforeClass 6.19 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 6.20 + public static void beforeClass() throws Exception 6.21 { 6.22 strabon = TemplateTests.beforeClass("/more-tests.nt"); 6.23 }
7.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Thu Nov 29 14:38:04 2012 +0200 7.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Thu Nov 29 20:13:48 2012 +0200 7.3 @@ -9,16 +9,10 @@ 7.4 */ 7.5 package eu.earthobservatory.runtime.monetdb; 7.6 7.7 -import java.io.IOException; 7.8 import java.sql.SQLException; 7.9 7.10 import org.junit.AfterClass; 7.11 import org.junit.BeforeClass; 7.12 -import org.openrdf.repository.RepositoryException; 7.13 -import org.openrdf.rio.RDFHandlerException; 7.14 -import org.openrdf.rio.RDFParseException; 7.15 - 7.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 7.17 7.18 /** 7.19 * 7.20 @@ -28,7 +22,7 @@ 7.21 public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 7.22 7.23 @BeforeClass 7.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 7.25 + public static void beforeClass() throws Exception 7.26 { 7.27 strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 7.28 }
8.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java Thu Nov 29 14:38:04 2012 +0200 8.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java Thu Nov 29 20:13:48 2012 +0200 8.3 @@ -9,16 +9,10 @@ 8.4 */ 8.5 package eu.earthobservatory.runtime.monetdb; 8.6 8.7 -import java.io.IOException; 8.8 import java.sql.SQLException; 8.9 8.10 import org.junit.AfterClass; 8.11 import org.junit.BeforeClass; 8.12 -import org.openrdf.repository.RepositoryException; 8.13 -import org.openrdf.rio.RDFHandlerException; 8.14 -import org.openrdf.rio.RDFParseException; 8.15 - 8.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 8.17 8.18 /** 8.19 * 8.20 @@ -28,7 +22,7 @@ 8.21 public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 8.22 8.23 @BeforeClass 8.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 8.25 + public static void beforeClass() throws Exception 8.26 { 8.27 strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 8.28 }
9.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Thu Nov 29 14:38:04 2012 +0200 9.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Thu Nov 29 20:13:48 2012 +0200 9.3 @@ -9,21 +9,15 @@ 9.4 */ 9.5 package eu.earthobservatory.runtime.monetdb; 9.6 9.7 -import java.io.IOException; 9.8 import java.sql.SQLException; 9.9 9.10 import org.junit.AfterClass; 9.11 import org.junit.BeforeClass; 9.12 -import org.openrdf.repository.RepositoryException; 9.13 -import org.openrdf.rio.RDFHandlerException; 9.14 -import org.openrdf.rio.RDFParseException; 9.15 - 9.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 9.17 9.18 public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 9.19 9.20 @BeforeClass 9.21 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 9.22 + public static void beforeClass() throws Exception 9.23 { 9.24 strabon = TemplateTests.beforeClass("/more-tests.nt"); 9.25 }
10.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Thu Nov 29 14:38:04 2012 +0200 10.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Thu Nov 29 20:13:48 2012 +0200 10.3 @@ -9,16 +9,10 @@ 10.4 */ 10.5 package eu.earthobservatory.runtime.monetdb; 10.6 10.7 -import java.io.IOException; 10.8 import java.sql.SQLException; 10.9 10.10 import org.junit.AfterClass; 10.11 import org.junit.BeforeClass; 10.12 -import org.openrdf.repository.RepositoryException; 10.13 -import org.openrdf.rio.RDFHandlerException; 10.14 -import org.openrdf.rio.RDFParseException; 10.15 - 10.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 10.17 10.18 /** 10.19 * A set of simple tests on SPARQL query functionality 10.20 @@ -28,7 +22,7 @@ 10.21 public class SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 10.22 10.23 @BeforeClass 10.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 10.25 + public static void beforeClass() throws Exception 10.26 { 10.27 strabon = TemplateTests.beforeClass("/simple-tests.nt"); 10.28 }
11.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Thu Nov 29 14:38:04 2012 +0200 11.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Thu Nov 29 20:13:48 2012 +0200 11.3 @@ -9,16 +9,10 @@ 11.4 */ 11.5 package eu.earthobservatory.runtime.monetdb; 11.6 11.7 -import java.io.IOException; 11.8 import java.sql.SQLException; 11.9 11.10 import org.junit.AfterClass; 11.11 import org.junit.BeforeClass; 11.12 -import org.openrdf.repository.RepositoryException; 11.13 -import org.openrdf.rio.RDFHandlerException; 11.14 -import org.openrdf.rio.RDFParseException; 11.15 - 11.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 11.17 11.18 /** 11.19 * A set of simple tests on SPARQL query functionality 11.20 @@ -28,7 +22,7 @@ 11.21 public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 11.22 11.23 @BeforeClass 11.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 11.25 + public static void beforeClass() throws Exception 11.26 { 11.27 strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 11.28 }
12.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Thu Nov 29 14:38:04 2012 +0200 12.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Thu Nov 29 20:13:48 2012 +0200 12.3 @@ -34,7 +34,7 @@ 12.4 public class TemplateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 12.5 12.6 @BeforeClass 12.7 - public static Strabon beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 12.8 + public static Strabon beforeClass(String inputfile) throws Exception 12.9 { 12.10 // Read properties 12.11 Properties properties = new Properties();
13.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Thu Nov 29 14:38:04 2012 +0200 13.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Thu Nov 29 20:13:48 2012 +0200 13.3 @@ -9,16 +9,10 @@ 13.4 */ 13.5 package eu.earthobservatory.runtime.monetdb; 13.6 13.7 -import java.io.IOException; 13.8 import java.sql.SQLException; 13.9 13.10 import org.junit.AfterClass; 13.11 import org.junit.BeforeClass; 13.12 -import org.openrdf.repository.RepositoryException; 13.13 -import org.openrdf.rio.RDFHandlerException; 13.14 -import org.openrdf.rio.RDFParseException; 13.15 - 13.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 13.17 13.18 /** 13.19 * A set of simple tests on SPARQL query functionality 13.20 @@ -28,7 +22,7 @@ 13.21 public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 13.22 13.23 @BeforeClass 13.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 13.25 + public static void beforeClass() throws Exception 13.26 { 13.27 strabon = TemplateTests.beforeClass("/transform-tests.nt"); 13.28 }
14.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Thu Nov 29 14:38:04 2012 +0200 14.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Thu Nov 29 20:13:48 2012 +0200 14.3 @@ -9,22 +9,16 @@ 14.4 */ 14.5 package eu.earthobservatory.runtime.postgis; 14.6 14.7 -import java.io.IOException; 14.8 import java.sql.SQLException; 14.9 14.10 import org.junit.AfterClass; 14.11 import org.junit.BeforeClass; 14.12 -import org.openrdf.repository.RepositoryException; 14.13 -import org.openrdf.rio.RDFHandlerException; 14.14 -import org.openrdf.rio.RDFParseException; 14.15 - 14.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 14.17 14.18 14.19 public class AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 14.20 14.21 @BeforeClass 14.22 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 14.23 + public static void beforeClass() throws Exception 14.24 { 14.25 strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 14.26 }
15.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Thu Nov 29 14:38:04 2012 +0200 15.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Thu Nov 29 20:13:48 2012 +0200 15.3 @@ -18,11 +18,6 @@ 15.4 import org.openrdf.query.MalformedQueryException; 15.5 import org.openrdf.query.QueryEvaluationException; 15.6 import org.openrdf.query.TupleQueryResultHandlerException; 15.7 -import org.openrdf.repository.RepositoryException; 15.8 -import org.openrdf.rio.RDFHandlerException; 15.9 -import org.openrdf.rio.RDFParseException; 15.10 - 15.11 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 15.12 15.13 /** 15.14 * A set of simple tests on SPARQL query functionality 15.15 @@ -32,7 +27,7 @@ 15.16 public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 15.17 15.18 @BeforeClass 15.19 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 15.20 + public static void beforeClass() throws Exception 15.21 { 15.22 strabon = TemplateTests.beforeClass("/more-tests.nt"); 15.23 }
16.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Thu Nov 29 14:38:04 2012 +0200 16.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Thu Nov 29 20:13:48 2012 +0200 16.3 @@ -9,22 +9,16 @@ 16.4 */ 16.5 package eu.earthobservatory.runtime.postgis; 16.6 16.7 -import java.io.IOException; 16.8 import java.sql.SQLException; 16.9 16.10 import org.junit.AfterClass; 16.11 import org.junit.BeforeClass; 16.12 -import org.openrdf.repository.RepositoryException; 16.13 -import org.openrdf.rio.RDFHandlerException; 16.14 -import org.openrdf.rio.RDFParseException; 16.15 - 16.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 16.17 16.18 16.19 public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 16.20 16.21 @BeforeClass 16.22 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 16.23 + public static void beforeClass() throws Exception 16.24 { 16.25 strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 16.26 }
17.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Thu Nov 29 14:38:04 2012 +0200 17.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Thu Nov 29 20:13:48 2012 +0200 17.3 @@ -9,21 +9,15 @@ 17.4 */ 17.5 package eu.earthobservatory.runtime.postgis; 17.6 17.7 -import java.io.IOException; 17.8 import java.sql.SQLException; 17.9 17.10 import org.junit.AfterClass; 17.11 import org.junit.BeforeClass; 17.12 -import org.openrdf.repository.RepositoryException; 17.13 -import org.openrdf.rio.RDFHandlerException; 17.14 -import org.openrdf.rio.RDFParseException; 17.15 - 17.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 17.17 17.18 public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 17.19 17.20 @BeforeClass 17.21 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 17.22 + public static void beforeClass() throws Exception 17.23 { 17.24 strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 17.25 }
18.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Thu Nov 29 14:38:04 2012 +0200 18.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Thu Nov 29 20:13:48 2012 +0200 18.3 @@ -9,23 +9,17 @@ 18.4 */ 18.5 package eu.earthobservatory.runtime.postgis; 18.6 18.7 -import java.io.IOException; 18.8 import java.sql.SQLException; 18.9 18.10 import org.junit.AfterClass; 18.11 import org.junit.BeforeClass; 18.12 -import org.openrdf.repository.RepositoryException; 18.13 -import org.openrdf.rio.RDFHandlerException; 18.14 -import org.openrdf.rio.RDFParseException; 18.15 - 18.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 18.17 18.18 18.19 public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.MeaningfulAggregateTests { 18.20 18.21 18.22 @BeforeClass 18.23 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 18.24 + public static void beforeClass() throws Exception 18.25 { 18.26 strabon = TemplateTests.beforeClass("/group-tests-srid.nt"); 18.27 }
19.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Thu Nov 29 14:38:04 2012 +0200 19.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Thu Nov 29 20:13:48 2012 +0200 19.3 @@ -9,16 +9,10 @@ 19.4 */ 19.5 package eu.earthobservatory.runtime.postgis; 19.6 19.7 -import java.io.IOException; 19.8 import java.sql.SQLException; 19.9 19.10 import org.junit.AfterClass; 19.11 import org.junit.BeforeClass; 19.12 -import org.openrdf.repository.RepositoryException; 19.13 -import org.openrdf.rio.RDFHandlerException; 19.14 -import org.openrdf.rio.RDFParseException; 19.15 - 19.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 19.17 19.18 /** 19.19 * A set of simple tests on SPARQL query functionality 19.20 @@ -29,7 +23,7 @@ 19.21 public class SPARQL11Tests extends eu.earthobservatory.runtime.generaldb.SPARQL11Tests { 19.22 19.23 @BeforeClass 19.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 19.25 + public static void beforeClass() throws Exception 19.26 { 19.27 strabon = TemplateTests.beforeClass("/sparql11-tests.nt"); 19.28 }
20.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Thu Nov 29 14:38:04 2012 +0200 20.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Thu Nov 29 20:13:48 2012 +0200 20.3 @@ -9,16 +9,10 @@ 20.4 */ 20.5 package eu.earthobservatory.runtime.postgis; 20.6 20.7 -import java.io.IOException; 20.8 import java.sql.SQLException; 20.9 20.10 import org.junit.AfterClass; 20.11 import org.junit.BeforeClass; 20.12 -import org.openrdf.repository.RepositoryException; 20.13 -import org.openrdf.rio.RDFHandlerException; 20.14 -import org.openrdf.rio.RDFParseException; 20.15 - 20.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 20.17 20.18 /** 20.19 * A set of simple tests on SPARQL query functionality 20.20 @@ -28,7 +22,7 @@ 20.21 public class SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 20.22 20.23 @BeforeClass 20.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 20.25 + public static void beforeClass() throws Exception 20.26 { 20.27 strabon = TemplateTests.beforeClass("/simple-tests.nt"); 20.28 }
21.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Thu Nov 29 14:38:04 2012 +0200 21.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Thu Nov 29 20:13:48 2012 +0200 21.3 @@ -9,16 +9,10 @@ 21.4 */ 21.5 package eu.earthobservatory.runtime.postgis; 21.6 21.7 -import java.io.IOException; 21.8 import java.sql.SQLException; 21.9 21.10 import org.junit.AfterClass; 21.11 import org.junit.BeforeClass; 21.12 -import org.openrdf.repository.RepositoryException; 21.13 -import org.openrdf.rio.RDFHandlerException; 21.14 -import org.openrdf.rio.RDFParseException; 21.15 - 21.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 21.17 21.18 /** 21.19 * A set of simple tests on SPARQL query functionality 21.20 @@ -29,7 +23,7 @@ 21.21 public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 21.22 21.23 @BeforeClass 21.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 21.25 + public static void beforeClass() throws Exception 21.26 { 21.27 strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 21.28 }
22.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Thu Nov 29 14:38:04 2012 +0200 22.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Thu Nov 29 20:13:48 2012 +0200 22.3 @@ -44,8 +44,7 @@ 22.4 public static Integer port = null; 22.5 22.6 @BeforeClass 22.7 - public static Strabon beforeClass(String inputFile) 22.8 - throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 22.9 + public static Strabon beforeClass(String inputFile) throws Exception 22.10 { 22.11 // Read properties 22.12 Properties properties = new Properties();
23.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Thu Nov 29 14:38:04 2012 +0200 23.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Thu Nov 29 20:13:48 2012 +0200 23.3 @@ -9,16 +9,10 @@ 23.4 */ 23.5 package eu.earthobservatory.runtime.postgis; 23.6 23.7 -import java.io.IOException; 23.8 import java.sql.SQLException; 23.9 23.10 import org.junit.AfterClass; 23.11 import org.junit.BeforeClass; 23.12 -import org.openrdf.repository.RepositoryException; 23.13 -import org.openrdf.rio.RDFHandlerException; 23.14 -import org.openrdf.rio.RDFParseException; 23.15 - 23.16 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 23.17 23.18 /** 23.19 * A set of simple tests on SPARQL query functionality 23.20 @@ -29,7 +23,7 @@ 23.21 public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 23.22 23.23 @BeforeClass 23.24 - public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 23.25 + public static void beforeClass() throws Exception 23.26 { 23.27 strabon = TemplateTests.beforeClass("/transform-tests.nt"); 23.28 }