Strabon
changeset 169:ffd4c17e4ab9
Fix problems with strabon variable scope in tests
line diff
1.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SimpleTests.java Fri May 18 22:46:13 2012 +0300 1.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SimpleTests.java Mon May 21 12:28:33 2012 +0300 1.3 @@ -13,6 +13,8 @@ 1.4 import org.openrdf.query.QueryEvaluationException; 1.5 import org.openrdf.query.TupleQueryResultHandlerException; 1.6 1.7 +import eu.earthobservatory.runtime.monetdb.TemplateTests; 1.8 + 1.9 /** 1.10 * A set of simple tests on SPARQL query functionality 1.11 *
2.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Fri May 18 22:46:13 2012 +0300 2.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Mon May 21 12:28:33 2012 +0300 2.3 @@ -1,12 +1,7 @@ 2.4 package eu.earthobservatory.runtime.monetdb; 2.5 2.6 import java.io.IOException; 2.7 -import java.io.InputStream; 2.8 -import java.sql.DriverManager; 2.9 -import java.sql.ResultSet; 2.10 import java.sql.SQLException; 2.11 -import java.sql.Statement; 2.12 -import java.util.Properties; 2.13 2.14 import org.junit.AfterClass; 2.15 import org.junit.BeforeClass; 2.16 @@ -27,14 +22,14 @@ 2.17 @BeforeClass 2.18 public static void beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 2.19 { 2.20 - TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 2.21 + strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 2.22 2.23 } 2.24 2.25 @AfterClass 2.26 public static void afterClass() throws SQLException 2.27 { 2.28 - strabon.close(); 2.29 + TemplateTests.afterClass(strabon); 2.30 } 2.31 2.32
3.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Fri May 18 22:46:13 2012 +0300 3.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Mon May 21 12:28:33 2012 +0300 3.3 @@ -27,13 +27,13 @@ 3.4 @BeforeClass 3.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 3.6 { 3.7 - TemplateTests.beforeClass("/more-tests.nt"); 3.8 + strabon = TemplateTests.beforeClass("/more-tests.nt"); 3.9 } 3.10 3.11 @AfterClass 3.12 public static void afterClass() throws SQLException 3.13 { 3.14 - TemplateTests.afterClass(); 3.15 + TemplateTests.afterClass(strabon); 3.16 } 3.17 3.18 // /**
4.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Fri May 18 22:46:13 2012 +0300 4.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Mon May 21 12:28:33 2012 +0300 4.3 @@ -21,13 +21,13 @@ 4.4 @BeforeClass 4.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 4.6 { 4.7 - TemplateTests.beforeClass("/having-tests-srid.nt"); 4.8 + strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 4.9 } 4.10 4.11 @AfterClass 4.12 public static void afterClass() throws SQLException 4.13 { 4.14 - TemplateTests.afterClass(); 4.15 + TemplateTests.afterClass(strabon); 4.16 } 4.17 4.18 // /**
5.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java Fri May 18 22:46:13 2012 +0300 5.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java Mon May 21 12:28:33 2012 +0300 5.3 @@ -22,13 +22,13 @@ 5.4 @BeforeClass 5.5 public static void beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 5.6 { 5.7 - TemplateTests.beforeClass("/join-tests-srid"); 5.8 + strabon = TemplateTests.beforeClass("/join-tests-srid"); 5.9 } 5.10 5.11 @AfterClass 5.12 public static void afterClass() throws SQLException 5.13 { 5.14 - strabon.close(); 5.15 + TemplateTests.afterClass(strabon); 5.16 } 5.17 5.18 }
6.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Fri May 18 22:46:13 2012 +0300 6.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Mon May 21 12:28:33 2012 +0300 6.3 @@ -21,13 +21,13 @@ 6.4 @BeforeClass 6.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 6.6 { 6.7 - TemplateTests.beforeClass("/more-tests.nt"); 6.8 + strabon = TemplateTests.beforeClass("/more-tests.nt"); 6.9 } 6.10 6.11 @AfterClass 6.12 public static void afterClass() throws SQLException 6.13 { 6.14 - TemplateTests.afterClass(); 6.15 + TemplateTests.afterClass(strabon); 6.16 } 6.17 6.18
7.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Fri May 18 22:46:13 2012 +0300 7.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Mon May 21 12:28:33 2012 +0300 7.3 @@ -28,13 +28,13 @@ 7.4 @BeforeClass 7.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 7.6 { 7.7 - TemplateTests.beforeClass("/simple-tests.ntriples"); 7.8 + strabon = TemplateTests.beforeClass("/simple-tests.ntriples"); 7.9 } 7.10 7.11 @AfterClass 7.12 public static void afterClass() throws SQLException 7.13 { 7.14 - TemplateTests.afterClass(); 7.15 + TemplateTests.afterClass(strabon); 7.16 } 7.17 7.18 // /**
8.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Fri May 18 22:46:13 2012 +0300 8.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Mon May 21 12:28:33 2012 +0300 8.3 @@ -27,13 +27,13 @@ 8.4 @BeforeClass 8.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 8.6 { 8.7 - TemplateTests.beforeClass("/spatial-tests-srid.nt"); 8.8 + strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 8.9 } 8.10 8.11 @AfterClass 8.12 public static void afterClass() throws SQLException 8.13 { 8.14 - TemplateTests.afterClass(); 8.15 + TemplateTests.afterClass(strabon); 8.16 } 8.17 8.18 // /**
9.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Fri May 18 22:46:13 2012 +0300 9.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Mon May 21 12:28:33 2012 +0300 9.3 @@ -17,6 +17,7 @@ 9.4 9.5 import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 9.6 import eu.earthobservatory.runtime.generaldb.SimpleTests; 9.7 +import eu.earthobservatory.runtime.generaldb.Strabon; 9.8 9.9 /** 9.10 * A set of simple tests on SPARQL query functionality 9.11 @@ -27,7 +28,7 @@ 9.12 public class TemplateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 9.13 9.14 @BeforeClass 9.15 - public static void beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 9.16 + public static Strabon beforeClass(String inputfile) throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 9.17 { 9.18 // Read properties 9.19 Properties properties = new Properties(); 9.20 @@ -56,18 +57,20 @@ 9.21 } 9.22 stmt.close(); 9.23 9.24 - strabon = new Strabon(databaseName, username, password, port, serverName, true); 9.25 + Strabon strabon = new eu.earthobservatory.runtime.monetdb.Strabon(databaseName, username, password, port, serverName, true); 9.26 9.27 - TemplateTests.loadTestData(inputfile); 9.28 + TemplateTests.loadTestData(inputfile, strabon); 9.29 + 9.30 + return strabon; 9.31 } 9.32 9.33 @AfterClass 9.34 - public static void afterClass() throws SQLException 9.35 + public static void afterClass(Strabon strabon) throws SQLException 9.36 { 9.37 strabon.close(); 9.38 } 9.39 9.40 - protected static void loadTestData(String inputfile) 9.41 + protected static void loadTestData(String inputfile, Strabon strabon) 9.42 throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 9.43 { 9.44 URL src = SimpleTests.class.getResource(inputfile);
10.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Fri May 18 22:46:13 2012 +0300 10.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Mon May 21 12:28:33 2012 +0300 10.3 @@ -27,13 +27,13 @@ 10.4 @BeforeClass 10.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 10.6 { 10.7 - TemplateTests.beforeClass("/transform-tests.nt"); 10.8 + strabon = TemplateTests.beforeClass("/transform-tests.nt"); 10.9 } 10.10 10.11 @AfterClass 10.12 public static void afterClass() throws SQLException 10.13 { 10.14 - TemplateTests.afterClass(); 10.15 + TemplateTests.afterClass(strabon); 10.16 } 10.17 10.18 }
11.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Fri May 18 22:46:13 2012 +0300 11.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Mon May 21 12:28:33 2012 +0300 11.3 @@ -18,14 +18,13 @@ 11.4 @BeforeClass 11.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 11.6 { 11.7 - TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 11.8 - 11.9 + strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 11.10 } 11.11 11.12 @AfterClass 11.13 public static void afterClass() throws SQLException 11.14 { 11.15 - TemplateTests.afterClass(); 11.16 + TemplateTests.afterClass(strabon); 11.17 } 11.18 11.19 }
12.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Fri May 18 22:46:13 2012 +0300 12.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Mon May 21 12:28:33 2012 +0300 12.3 @@ -28,13 +28,13 @@ 12.4 @BeforeClass 12.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 12.6 { 12.7 - TemplateTests.beforeClass("/more-tests.nt"); 12.8 + strabon = TemplateTests.beforeClass("/more-tests.nt"); 12.9 } 12.10 12.11 @AfterClass 12.12 public static void afterClass() throws SQLException 12.13 { 12.14 - TemplateTests.afterClass(); 12.15 + TemplateTests.afterClass(strabon); 12.16 } 12.17 12.18
13.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Fri May 18 22:46:13 2012 +0300 13.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Mon May 21 12:28:33 2012 +0300 13.3 @@ -22,13 +22,13 @@ 13.4 @BeforeClass 13.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 13.6 { 13.7 - TemplateTests.beforeClass("/having-tests-srid.nt"); 13.8 + strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 13.9 } 13.10 13.11 @AfterClass 13.12 public static void afterClass() throws SQLException 13.13 { 13.14 - TemplateTests.afterClass(); 13.15 + TemplateTests.afterClass(strabon); 13.16 } 13.17 13.18 }
14.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Fri May 18 22:46:13 2012 +0300 14.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Mon May 21 12:28:33 2012 +0300 14.3 @@ -22,13 +22,13 @@ 14.4 @BeforeClass 14.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 14.6 { 14.7 - TemplateTests.beforeClass("/join-tests-srid.nt"); 14.8 + strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 14.9 } 14.10 14.11 @AfterClass 14.12 public static void afterClass() throws SQLException 14.13 { 14.14 - TemplateTests.afterClass(); 14.15 + TemplateTests.afterClass(strabon); 14.16 } 14.17 14.18 }
15.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Fri May 18 22:46:13 2012 +0300 15.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Mon May 21 12:28:33 2012 +0300 15.3 @@ -24,13 +24,13 @@ 15.4 @BeforeClass 15.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 15.6 { 15.7 - TemplateTests.beforeClass("/grouo-tests-srid.nt"); 15.8 + strabon = TemplateTests.beforeClass("/grouo-tests-srid.nt"); 15.9 } 15.10 15.11 @AfterClass 15.12 public static void afterClass() throws SQLException 15.13 { 15.14 - TemplateTests.afterClass(); 15.15 + TemplateTests.afterClass(strabon); 15.16 } 15.17 15.18
16.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Fri May 18 22:46:13 2012 +0300 16.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Mon May 21 12:28:33 2012 +0300 16.3 @@ -28,13 +28,13 @@ 16.4 @BeforeClass 16.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 16.6 { 16.7 - TemplateTests.beforeClass("/sparql11-tests.nt"); 16.8 + strabon = TemplateTests.beforeClass("/sparql11-tests.nt"); 16.9 } 16.10 16.11 @AfterClass 16.12 public static void afterClass() throws SQLException 16.13 { 16.14 - TemplateTests.afterClass(); 16.15 + TemplateTests.afterClass(strabon); 16.16 } 16.17 16.18
17.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Fri May 18 22:46:13 2012 +0300 17.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Mon May 21 12:28:33 2012 +0300 17.3 @@ -22,13 +22,13 @@ 17.4 @BeforeClass 17.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 17.6 { 17.7 - TemplateTests.beforeClass("/simple-tests.ntriples"); 17.8 + strabon = TemplateTests.beforeClass("/simple-tests.ntriples"); 17.9 } 17.10 17.11 @AfterClass 17.12 public static void afterClass() throws SQLException 17.13 { 17.14 - TemplateTests.afterClass(); 17.15 + TemplateTests.afterClass(strabon); 17.16 } 17.17 17.18 // /**
18.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Fri May 18 22:46:13 2012 +0300 18.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Mon May 21 12:28:33 2012 +0300 18.3 @@ -27,13 +27,13 @@ 18.4 @BeforeClass 18.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 18.6 { 18.7 - TemplateTests.beforeClass("./spatial-tests-srid.nt"); 18.8 + strabon = TemplateTests.beforeClass("./spatial-tests-srid.nt"); 18.9 } 18.10 18.11 @AfterClass 18.12 public static void afterClass() throws SQLException 18.13 { 18.14 - TemplateTests.afterClass(); 18.15 + TemplateTests.afterClass(strabon); 18.16 } 18.17 18.18 // /**
19.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Fri May 18 22:46:13 2012 +0300 19.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Mon May 21 12:28:33 2012 +0300 19.3 @@ -17,7 +17,7 @@ 19.4 19.5 import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 19.6 import eu.earthobservatory.runtime.generaldb.SimpleTests; 19.7 -import eu.earthobservatory.runtime.postgis.Strabon; 19.8 +import eu.earthobservatory.runtime.generaldb.Strabon; 19.9 19.10 /** 19.11 * A set of simple tests on SPARQL query functionality 19.12 @@ -27,8 +27,6 @@ 19.13 19.14 public class TemplateTests { 19.15 19.16 - public static Strabon strabon; 19.17 - 19.18 public static java.sql.Connection conn = null; 19.19 public static String databaseName = null; 19.20 19.21 @@ -39,7 +37,7 @@ 19.22 public static Integer port = null; 19.23 19.24 @BeforeClass 19.25 - public static void beforeClass(String inputFile) 19.26 + public static Strabon beforeClass(String inputFile) 19.27 throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 19.28 { 19.29 // Read properties 19.30 @@ -72,18 +70,20 @@ 19.31 } 19.32 stmt.close(); 19.33 19.34 - strabon = new Strabon(databaseName, username, password, port, serverName, true); 19.35 + Strabon strabon = new eu.earthobservatory.runtime.postgis.Strabon(databaseName, username, password, port, serverName, true); 19.36 19.37 - loadTestData(inputFile); 19.38 + loadTestData(inputFile, strabon); 19.39 + 19.40 + return strabon; 19.41 } 19.42 19.43 @AfterClass 19.44 - public static void afterClass() throws SQLException 19.45 + public static void afterClass(Strabon strabon) throws SQLException 19.46 { 19.47 strabon.close(); 19.48 } 19.49 19.50 - protected static void loadTestData(String inputfile) 19.51 + protected static void loadTestData(String inputfile, Strabon strabon) 19.52 throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 19.53 { 19.54 URL src = SimpleTests.class.getResource(inputfile);
20.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Fri May 18 22:46:13 2012 +0300 20.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Mon May 21 12:28:33 2012 +0300 20.3 @@ -27,13 +27,13 @@ 20.4 @BeforeClass 20.5 public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault 20.6 { 20.7 - TemplateTests.beforeClass("/transform-tests.nt"); 20.8 + strabon = TemplateTests.beforeClass("/transform-tests.nt"); 20.9 } 20.10 20.11 @AfterClass 20.12 public static void afterClass() throws SQLException 20.13 { 20.14 - TemplateTests.afterClass(); 20.15 + TemplateTests.afterClass(strabon); 20.16 } 20.17 20.18 // /**