clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enrid...@apache.org
Subject [1/2] git commit: CLEREZZA-911 Fixed. Test improved.
Date Fri, 18 Apr 2014 18:04:16 GMT
Repository: clerezza
Updated Branches:
  refs/heads/master ad8b28e7d -> ff0badfda


CLEREZZA-911 Fixed. Test improved.


Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/c0abf9fb
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/c0abf9fb
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/c0abf9fb

Branch: refs/heads/master
Commit: c0abf9fb669bf82c55cc43c4072ab6f8a736b3e5
Parents: ad8b28e
Author: enridaga <enridaga@apache.org>
Authored: Fri Apr 18 18:52:45 2014 +0100
Committer: enridaga <enridaga@apache.org>
Committed: Fri Apr 18 18:52:45 2014 +0100

----------------------------------------------------------------------
 .../clerezza/rdf/virtuoso/storage/access/DataAccess.java    | 9 +++++++--
 .../rdf/virtuoso/storage/access/DataAccessTest.java         | 9 ++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/c0abf9fb/rdf.virtuoso.storage/src/main/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccess.java
----------------------------------------------------------------------
diff --git a/rdf.virtuoso.storage/src/main/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccess.java
b/rdf.virtuoso.storage/src/main/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccess.java
index f077d64..b1c441c 100644
--- a/rdf.virtuoso.storage/src/main/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccess.java
+++ b/rdf.virtuoso.storage/src/main/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccess.java
@@ -950,8 +950,13 @@ public class DataAccess {
 			// ASK :: Boolean
 			if (rs.getMetaData().getColumnCount() == 1
 					&& rs.getMetaData().getColumnType(1) == 4) {
-				rs.next();
-				returnThis = rs.getBoolean(1);
+//				rs.next();
+//				returnThis = rs.getBoolean(1);
+				if(rs.next()){
+					returnThis = rs.getBoolean(1);
+				}else{
+					returnThis = false;
+				}
 			} else
 			// CONSTRCUT/DESCRIBE :: TripleCollection
 			if (rs.getMetaData().getColumnCount() == 3

http://git-wip-us.apache.org/repos/asf/clerezza/blob/c0abf9fb/rdf.virtuoso.storage/src/test/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccessTest.java
----------------------------------------------------------------------
diff --git a/rdf.virtuoso.storage/src/test/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccessTest.java
b/rdf.virtuoso.storage/src/test/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccessTest.java
index 2d7bf46..6560628 100644
--- a/rdf.virtuoso.storage/src/test/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccessTest.java
+++ b/rdf.virtuoso.storage/src/test/java/org/apache/clerezza/rdf/virtuoso/storage/access/DataAccessTest.java
@@ -129,10 +129,17 @@ public class DataAccessTest {
 	@Test
 	public void testSparqlAsk(){
 		Triple t = new TripleImpl(new UriRef("urn:subject"), new UriRef("urn:predicate"), new UriRef("urn:object"));
-		da.insertQuad(testGraphName, t);
+		
 		String ask = "ASK { [] [] [] }";
 		Object result = da.executeSparqlQuery(ask, new UriRef(testGraphName));
 		Assert.assertTrue(result instanceof Boolean);
+		Assert.assertTrue(((Boolean)result) == false);
+		
+		da.insertQuad(testGraphName, t);
+
+		result = da.executeSparqlQuery(ask, new UriRef(testGraphName));
+		Assert.assertTrue(result instanceof Boolean);
+		
 		result = da.executeSparqlQuery(ask, null);
 	}
 	


Mime
View raw message