From: <mrp...@us...> - 2010-10-19 16:25:03
|
Revision: 3822 http://bigdata.svn.sourceforge.net/bigdata/?rev=3822&view=rev Author: mrpersonick Date: 2010-10-19 16:24:57 +0000 (Tue, 19 Oct 2010) Log Message: ----------- fixed the sesame operator tree for this test Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java 2010-10-19 16:02:18 UTC (rev 3821) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java 2010-10-19 16:24:57 UTC (rev 3822) @@ -57,6 +57,10 @@ import org.openrdf.query.QueryLanguage; import org.openrdf.query.TupleQuery; import org.openrdf.query.TupleQueryResult; +import org.openrdf.query.algebra.Projection; +import org.openrdf.query.algebra.ProjectionElem; +import org.openrdf.query.algebra.ProjectionElemList; +import org.openrdf.query.algebra.QueryRoot; import org.openrdf.query.algebra.StatementPattern; import org.openrdf.query.algebra.TupleExpr; import org.openrdf.query.algebra.Var; @@ -246,11 +250,16 @@ try { - final TupleExpr tupleExpr = new StatementPattern(// + final StatementPattern sp = new StatementPattern(// new Var("X"),// new Var("1", BD.SEARCH),// new Var("2", new LiteralImpl("Yellow"))// ); + final TupleExpr tupleExpr = + new QueryRoot( + new Projection( + sp, + new ProjectionElemList(new ProjectionElem("X")))); /* * Create a data set consisting of the contexts to be queried. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2011-05-20 18:57:18
|
Revision: 4536 http://bigdata.svn.sourceforge.net/bigdata/?rev=4536&view=rev Author: thompsonbry Date: 2011-05-20 18:57:12 +0000 (Fri, 20 May 2011) Log Message: ----------- bug fix introduced by change from System.err to conditional logging when iterator was being consumed by a side effect inside of the System.err construct.... Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java 2011-05-20 18:24:33 UTC (rev 4535) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSearchQuery.java 2011-05-20 18:57:12 UTC (rev 4536) @@ -81,10 +81,8 @@ import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.TermId; import com.bigdata.rdf.internal.VTE; -import com.bigdata.rdf.internal.XSDDoubleIV; import com.bigdata.rdf.lexicon.ITextIndexer; import com.bigdata.rdf.model.BigdataValue; -import com.bigdata.rdf.model.BigdataValueFactory; import com.bigdata.rdf.rio.StatementBuffer; import com.bigdata.rdf.sail.BigdataSail.Options; import com.bigdata.rdf.store.BD; @@ -100,7 +98,7 @@ */ public class TestSearchQuery extends ProxyBigdataSailTestCase { - protected static final Logger log = Logger.getLogger(TestSearchQuery.class); + private static final Logger log = Logger.getLogger(TestSearchQuery.class); public TestSearchQuery() { @@ -291,7 +289,7 @@ try { - log.info("Verifying query."); + log.info("Verifying query."); /* * These are the expected results for the query (the bindings @@ -788,8 +786,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results", 7, i); @@ -853,8 +853,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results", 5, i); @@ -920,8 +922,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results", 2, i); @@ -991,8 +995,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results: " + i, 2, i); @@ -1026,7 +1032,8 @@ new BindingImpl("s", s), new BindingImpl("o", o), new BindingImpl("score", score)); - log.info(bs); + if(log.isInfoEnabled()) + log.info(bs); answer.add(bs); } @@ -1063,8 +1070,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results: " + i, 3, i); @@ -1096,7 +1105,8 @@ new BindingImpl("s", s), new BindingImpl("o", o), new BindingImpl("score", score)); - log.info(bs); + if(log.isInfoEnabled()) + log.info(bs); answer.add(bs); } @@ -1133,8 +1143,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } assertEquals("wrong # of results: " + i, 1, i); @@ -1166,7 +1178,8 @@ new BindingImpl("s", s), new BindingImpl("o", o), new BindingImpl("score", score)); - log.info(bs); + if(log.isInfoEnabled()) + log.info(bs); answer.add(bs); } @@ -1189,7 +1202,8 @@ " ?o <"+BD.MATCH_ALL_TERMS+"> \"true\" . " + "}"; - log.info("\n"+query); + if(log.isInfoEnabled()) + log.info("\n"+query); final TupleQuery tupleQuery = cxn.prepareTupleQuery(QueryLanguage.SPARQL, query); @@ -1198,8 +1212,10 @@ int i = 0; while (result.hasNext()) { - if(log.isInfoEnabled()) - log.info(i++ + ": " + result.next().toString()); + final BindingSet tmp = result.next(); + if (log.isInfoEnabled()) + log.info(i + ": " + tmp.toString()); + i++; } // assertTrue("wrong # of results: " + i, i == 1); @@ -1229,7 +1245,8 @@ final BindingSet bs = createBindingSet( new BindingImpl("s", s), new BindingImpl("o", o)); - log.info(bs); + if(log.isInfoEnabled()) + log.info(bs); answer.add(bs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |