Strabon
changeset 1383:406d4e773eee
tests in endpoint-client were not using any assertions
line diff
1.1 --- a/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointStoreWithStrabon.java Wed Sep 17 14:15:46 2014 +0300 1.2 +++ b/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointStoreWithStrabon.java Wed Sep 17 14:35:26 2014 +0300 1.3 @@ -9,6 +9,8 @@ 1.4 */ 1.5 package eu.earthobservatory.org.StrabonEndpoint.client; 1.6 1.7 +import static org.junit.Assert.assertTrue; 1.8 + 1.9 import java.io.IOException; 1.10 import java.net.MalformedURLException; 1.11 import java.net.URL; 1.12 @@ -55,12 +57,7 @@ 1.13 URL namedGraph = new URL("http://geo.linkedopendata.gr/map/example"); 1.14 Boolean response = endpoint.store(data, RDFFormat.NTRIPLES , namedGraph); 1.15 1.16 - if (response != true) 1.17 - System.err.println("Error"); 1.18 - 1.19 - 1.20 - // assertTrue(response == true); 1.21 - 1.22 + assertTrue(response == true); 1.23 } 1.24 1.25 1.26 @@ -75,11 +72,7 @@ 1.27 String data = "<http://geo.linkedopendata.gr/map/id/l22> <http://geo.linkedopendata.gr/map/hasName> \"layer22\" . "; 1.28 Boolean response = endpoint.store(data, RDFFormat.NTRIPLES , namedGraph); 1.29 1.30 - if (response != true) 1.31 - System.err.println("Error"); 1.32 - 1.33 - 1.34 - // assertTrue(response == true); 1.35 + assertTrue(response == true); 1.36 1.37 } 1.38 } 1.39 \ No newline at end of file
2.1 --- a/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointUpdateWithStrabon.java Wed Sep 17 14:15:46 2014 +0300 2.2 +++ b/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointUpdateWithStrabon.java Wed Sep 17 14:35:26 2014 +0300 2.3 @@ -1,5 +1,7 @@ 2.4 package eu.earthobservatory.org.StrabonEndpoint.client; 2.5 2.6 +import static org.junit.Assert.assertTrue; 2.7 + 2.8 import java.io.IOException; 2.9 2.10 import org.junit.Before; 2.11 @@ -32,15 +34,8 @@ 2.12 */ 2.13 @Test 2.14 public void testUpdate() throws IOException { 2.15 - 2.16 Boolean response = endpoint.update(query); 2.17 - 2.18 - if (response != true) 2.19 - System.err.println("Error"); 2.20 - 2.21 - 2.22 - // assertTrue(response == true); 2.23 - 2.24 + assertTrue(response == true); 2.25 } 2.26 2.27 }
3.1 --- a/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointWithStrabon.java Wed Sep 17 14:15:46 2014 +0300 3.2 +++ b/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointWithStrabon.java Wed Sep 17 14:35:26 2014 +0300 3.3 @@ -9,6 +9,8 @@ 3.4 */ 3.5 package eu.earthobservatory.org.StrabonEndpoint.client; 3.6 3.7 +import static org.junit.Assert.assertTrue; 3.8 + 3.9 import java.io.IOException; 3.10 import java.util.Vector; 3.11 3.12 @@ -65,10 +67,9 @@ 3.13 3.14 if (response.getStatusCode() != 200) { 3.15 System.err.println("Status code ("+response.getStatusCode()+"):" + response.getStatusText()); 3.16 - 3.17 } 3.18 3.19 - // assertTrue(response.getStatusCode() == 200); 3.20 + assertTrue(response.getStatusCode() == 200); 3.21 3.22 } catch (IOException e) { 3.23 e.printStackTrace(); 3.24 @@ -82,7 +83,7 @@ 3.25 * returns an IOException when it should do so. 3.26 */ 3.27 @Test(expected= IOException.class) 3.28 - public void testIOException() throws Exception { 3.29 + public void testIOException() throws IOException { 3.30 SPARQLEndpoint ep = new SPARQLEndpoint("blabla.dgr", 80, "bla"); 3.31 ep.query(query, formats.get(0)); 3.32 }
4.1 --- a/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointWithVirtuoso.java Wed Sep 17 14:15:46 2014 +0300 4.2 +++ b/endpoint-client/src/test/java/eu/earthobservatory/org/StrabonEndpoint/client/TestSPARQLEndpointWithVirtuoso.java Wed Sep 17 14:35:26 2014 +0300 4.3 @@ -9,6 +9,8 @@ 4.4 */ 4.5 package eu.earthobservatory.org.StrabonEndpoint.client; 4.6 4.7 +import static org.junit.Assert.assertTrue; 4.8 + 4.9 import java.io.IOException; 4.10 import java.util.Vector; 4.11 4.12 @@ -65,7 +67,7 @@ 4.13 4.14 } 4.15 4.16 - // assertTrue(response.getStatusCode() == 200); 4.17 + assertTrue(response.getStatusCode() == 200); 4.18 4.19 } catch (IOException e) { 4.20 e.printStackTrace();
5.1 --- a/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java Wed Sep 17 14:15:46 2014 +0300 5.2 +++ b/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java Wed Sep 17 14:35:26 2014 +0300 5.3 @@ -34,10 +34,6 @@ 5.4 // constructing a new literal is the only way if we want to reuse the {@link #writeValue(Value)} method 5.5 GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) val; 5.6 val = new LiteralImpl(dbpolyhedron.stringValue()); 5.7 -// if(String.valueOf(dbpolyhedron.getDatatype()) == GeoConstants.WKT) 5.8 -// val = new LiteralImpl(dbpolyhedron.getPolyhedronStringRep()+";http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID(), dbpolyhedron.getDatatype()); 5.9 -// else 5.10 -// val = new LiteralImpl("<http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID()+"> "+dbpolyhedron.getPolyhedronStringRep(),dbpolyhedron.getDatatype()); 5.11 } 5.12 5.13 // write value