You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/06/06 21:20:25 UTC
svn commit: r1490401 - in /jena/Experimental/jena-jdbc:
jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/
jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/
jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connecti...
Author: rvesse
Date: Thu Jun 6 19:20:24 2013
New Revision: 1490401
URL: http://svn.apache.org/r1490401
Log:
More fixes to timeout tests
Modified:
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/TripleIteratorResults.java
jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnection.java
jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithGraphUris.java
jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithResultSetTypes.java
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java Thu Jun 6 19:20:24 2013
@@ -148,7 +148,8 @@ public class SelectResults extends Strea
try {
return this.innerResults.hasNext();
} catch (QueryCancelledException e) {
- throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout", e);
+ throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout",
+ e);
} catch (Throwable e) {
// Wrap as SQL exception
throw new SQLException("Unexpected error while moving through results", e);
@@ -162,6 +163,14 @@ public class SelectResults extends Strea
protected Binding moveNext() throws SQLException {
// No null check here because superclass will not call us after we are
// closed and set to null
- return this.innerResults.nextBinding();
+ try {
+ return this.innerResults.nextBinding();
+ } catch (QueryCancelledException e) {
+ throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout",
+ e);
+ } catch (Throwable e) {
+ // Wrap as SQL exception
+ throw new SQLException("Unexpected error while moving through results", e);
+ }
}
}
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/TripleIteratorResults.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/TripleIteratorResults.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/TripleIteratorResults.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/TripleIteratorResults.java Thu Jun 6 19:20:24 2013
@@ -86,7 +86,8 @@ public class TripleIteratorResults exten
try {
return this.triples.hasNext();
} catch (QueryCancelledException e) {
- throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout", e);
+ throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout",
+ e);
} catch (Throwable e) {
// Wrap as SQL exception
throw new SQLException("Unexpected error while moving through results", e);
@@ -95,7 +96,15 @@ public class TripleIteratorResults exten
@Override
protected Triple moveNext() throws SQLException {
- return this.triples.next();
+ try {
+ return this.triples.next();
+ } catch (QueryCancelledException e) {
+ throw new SQLException("Query was cancelled, it is likely that your query exceeded the specified execution timeout",
+ e);
+ } catch (Throwable e) {
+ // Wrap as SQL exception
+ throw new SQLException("Unexpected error while moving through results", e);
+ }
}
@Override
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java Thu Jun 6 19:20:24 2013
@@ -1048,7 +1048,7 @@ public abstract class AbstractJenaConnec
try {
ResultSet rset = stmt.executeQuery("SELECT * WHERE { "
+ (this.usesNamedGraphAsDefault() ? "GRAPH <" + this.getDefaultGraphName() + "> {" : "")
- + " ?a ?b ?c . ?d ?e ?f . ?g ?h ?i . " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
+ + " ?a ?b ?c . ?d ?e ?f . ?g ?h ?i " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
// Note that we have to start iterating otherwise the query doesn't
// get executed and the timeout will never apply
@@ -1126,7 +1126,7 @@ public abstract class AbstractJenaConnec
try {
ResultSet rset = stmt.executeQuery("CONSTRUCT { ?s ?p ?o } WHERE { "
+ (this.usesNamedGraphAsDefault() ? "GRAPH <" + this.getDefaultGraphName() + "> {" : "")
- + " ?a ?b ?c . ?d ?e ?f . ?g ?h ?i . " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
+ + " ?a ?b ?c . ?s ?p ?o . " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
// Note that we have to start iterating otherwise the query doesn't
// get executed and the timeout will never apply
@@ -1165,7 +1165,7 @@ public abstract class AbstractJenaConnec
try {
ResultSet rset = stmt.executeQuery("CONSTRUCT { ?s ?p ?o } WHERE { "
+ (this.usesNamedGraphAsDefault() ? "GRAPH <" + this.getDefaultGraphName() + "> {" : "")
- + " ?a ?b ?c . ?d ?e ?f . ?g ?h ?i . " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
+ + " ?a ?b ?c . ?s ?p ?o . " + (this.usesNamedGraphAsDefault() ? "}" : "") + "}");
// Note that we have to start iterating otherwise the query doesn't
// get executed and the timeout will never apply
Modified: jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnection.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnection.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnection.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnection.java Thu Jun 6 19:20:24 2013
@@ -63,6 +63,12 @@ public class TestRemoteEndpointConnectio
}
@Override
+ protected boolean supportsTimeouts() {
+ // While timeouts are supported they are unreliable for remote connections
+ return false;
+ }
+
+ @Override
protected JenaConnection getConnection() throws SQLException {
return new RemoteEndpointConnection(BaseServerTest.serviceQuery, BaseServerTest.serviceUpdate, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT);
}
Modified: jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithGraphUris.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithGraphUris.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithGraphUris.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithGraphUris.java Thu Jun 6 19:20:24 2013
@@ -70,6 +70,12 @@ public class TestRemoteEndpointConnectio
public static void cleanup() {
ServerTest.freeServer();
}
+
+ @Override
+ protected boolean supportsTimeouts() {
+ // While timeouts are supported they are unreliable for remote connections
+ return false;
+ }
@Override
protected JenaConnection getConnection() throws SQLException {
Modified: jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithResultSetTypes.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithResultSetTypes.java?rev=1490401&r1=1490400&r2=1490401&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithResultSetTypes.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/src/test/java/org/apache/jena/jdbc/remote/connections/TestRemoteEndpointConnectionWithResultSetTypes.java Thu Jun 6 19:20:24 2013
@@ -62,6 +62,12 @@ public class TestRemoteEndpointConnectio
public static void cleanup() {
ServerTest.freeServer();
}
+
+ @Override
+ protected boolean supportsTimeouts() {
+ // While timeouts are supported they are unreliable for remote connections
+ return false;
+ }
@Override
protected JenaConnection getConnection() throws SQLException {