diff options
author | Peter Foley <pefoley2@verizon.net> | 2011-12-24 09:44:24 -0500 |
---|---|---|
committer | Peter Foley <pefoley2@verizon.net> | 2011-12-24 09:44:24 -0500 |
commit | fd6649175956c9d322fe02fd413fe6970aa6819e (patch) | |
tree | ce2691616f82ef55d3b8f3e45812777477e8668f /unoxml | |
parent | 79b252a56db8f1c2159d3269de415ffe2f2d9bb1 (diff) | |
parent | a8feb5b1df99c12a5cb644097f935e9ccf512ed5 (diff) |
Merge remote-tracking branch 'origin/master' into feature/gbuild_extensions
Conflicts:
Module_tail_build.mk
Repository.mk
extensions/util/makefile.pmk
postprocess/prj/build.lst
svx/AllLangResTarget_svx.mk
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/qa/complex/unoxml/RDFRepositoryTest.java | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java index 7944a0edc064..d1006c232cc1 100644 --- a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java +++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java @@ -785,15 +785,30 @@ public class RDFRepositoryTest String[] vars = (String[]) i_Result.getBindingNames(); XEnumeration iter = (XEnumeration) i_Result; XNode[][] bindings = toSeqs(iter); - if (vars.length != i_Vars.length) { - System.out.println("var lengths differ"); - return false; - } if (bindings.length != i_Bindings.length) { System.out.println("binding lengths differ: " + i_Bindings.length + " vs " + bindings.length ); return false; } + if (vars.length != i_Vars.length) { + // ignore for empty result: it is unclear to me whether SPARQL + // spec requires returning the variables in this case, + // and evidently newer rasqal versions don't + if (0 != i_Bindings.length || 0 != vars.length) + { + System.out.println("var lengths differ: expected " + + i_Vars.length + " but got " + vars.length); + return false; + } + } else { + for (int i = 0; i < i_Vars.length; ++i) { + if (!vars[i].equals(i_Vars[i])) { + System.out.println("variable names differ: " + + vars[i] + " != " + i_Vars[i]); + return false; + } + } + } java.util.Arrays.sort(bindings, new BindingComp()); java.util.Arrays.sort(i_Bindings, new BindingComp()); for (int i = 0; i < i_Bindings.length; ++i) { @@ -813,13 +828,6 @@ public class RDFRepositoryTest } } } - for (int i = 0; i < i_Vars.length; ++i) { - if (!vars[i].equals(i_Vars[i])) { - System.out.println("variable names differ: " + - vars[i] + " != " + i_Vars[i]); - return false; - } - } return true; } @@ -839,6 +847,20 @@ public class RDFRepositoryTest return namespaces; } + // useful when debugging + static void dumpRepo(XDocumentRepository xRep) throws Exception + { + XEnumeration xEnum = xRep.getStatements(null, null, null); + while (xEnum.hasMoreElements()) + { + Statement s = (Statement) xEnum.nextElement(); + System.out.println("STATEMENT IN: " + toS(s.Graph) + + "\n S: " + toS(s.Subject) + + "\n P: " + toS(s.Predicate) + + "\n O: " + toS(s.Object)); + } + } + class TestRange implements XTextRange, XMetadatable, XServiceInfo { String m_Stream; |