Class AbstractQueryResultIOTest
java.lang.Object
org.eclipse.rdf4j.testsuite.query.resultio.AbstractQueryResultIOTest
- Direct Known Subclasses:
AbstractQueryResultIOBooleanTest
,AbstractQueryResultIOTupleTest
- Author:
- Peter Ansell
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertQueryResultsEqual(TupleQueryResult expected, TupleQueryResult output)
protected TupleQueryResult
protected TupleQueryResult
protected TupleQueryResult
protected void
doBooleanLinks(BooleanQueryResultFormat format, boolean input, List<String> links)
protected void
doBooleanLinksAndStylesheet(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl)
protected void
doBooleanLinksAndStylesheetAndNamespaces(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl, Map<String,String> namespaces)
protected void
doBooleanLinksOnly(BooleanQueryResultFormat format, boolean input, List<String> links)
protected void
doBooleanNoHandler(BooleanQueryResultFormat format, boolean input)
Tests that parsing a boolean without specifying aBooleanQueryResultHandler
does not throw any exceptions.protected void
doBooleanNoLinks(BooleanQueryResultFormat format, boolean input)
protected void
doBooleanParseNoHandlerOnTupleResults(BooleanQueryResultFormat format, TupleQueryResult tqr, TupleQueryResultFormat matchingTupleFormat)
Tests that the parser returned for a BooleanQueryResultFormat is not able to parse a TupleQueryResultFormat using the deprecatedBooleanQueryResultParser.parse(java.io.InputStream)
method, and that it does indeed through an exception of typeQueryResultParseException
.protected void
doBooleanStylesheet(BooleanQueryResultFormat format, boolean input, String stylesheetUrl)
protected void
doInvalidBooleanAfterStartQueryResult(BooleanQueryResultFormat format, boolean input, List<String> links)
protected void
doTupleJSONPCallback(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected)
Test specifically for JSONP callback support.protected void
doTupleLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links)
protected void
doTupleLinksAndStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl)
protected void
doTupleLinksAndStylesheetAndNamespaces(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String,String> namespaces)
protected void
doTupleLinksAndStylesheetAndNamespacesQName(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String,String> namespaces)
Test specifically for QName support.protected void
doTupleLinksAndStylesheetMultipleEndHeaders(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl)
protected void
doTupleLinksAndStylesheetNoStarts(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl)
protected void
doTupleMissingStartQueryResult(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl)
protected void
doTupleNoHandler(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected)
Tests that parsing a tuple results set without specifying aTupleQueryResultHandler
does not throw any exceptions.protected void
doTupleNoLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected)
protected void
doTupleParseNoHandlerOnBooleanResults(TupleQueryResultFormat format, boolean input, BooleanQueryResultFormat matchingBooleanFormat)
Tests that the parser returned for a TupleQueryResultFormat is not able to parse a BooleanQueryResultFormat using the deprecatedTupleQueryResultParser.parse(java.io.InputStream)
method, and that it does indeed through an exception of typeQueryResultParseException
.protected void
doTupleStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, String stylesheetUrl)
protected abstract String
protected abstract QueryResultFormat
protected TupleQueryResult
parseTupleInternal(TupleQueryResultFormat format, InputStream in)
Override this to customise how the tuple parsing is performed, particularly to test background and other parsing strategies.void
Test method forQueryResultIO.getParserFormatForFileName(java.lang.String)
.
-
Constructor Details
-
AbstractQueryResultIOTest
public AbstractQueryResultIOTest()
-
-
Method Details
-
getFileName
- Returns:
- An example filename that will match the
QueryResultFormat
returned bygetFormat()
.
-
getFormat
-
parseTupleInternal
protected TupleQueryResult parseTupleInternal(TupleQueryResultFormat format, InputStream in) throws IOException, QueryResultParseException, TupleQueryResultHandlerException, UnsupportedQueryResultFormatExceptionOverride this to customise how the tuple parsing is performed, particularly to test background and other parsing strategies.- Parameters:
format
- TheTupleQueryResultFormat
for the parser.in
- The InputStream to parse- Returns:
- A
TupleQueryResult
that can be parsed. - Throws:
IOException
QueryResultParseException
TupleQueryResultHandlerException
UnsupportedQueryResultFormatException
-
testGetParserFormatForFileNameString
Test method forQueryResultIO.getParserFormatForFileName(java.lang.String)
.- Throws:
Exception
-
createTupleSingleVarMultipleBindingSets
-
createTupleMultipleBindingSets
-
getNamespaces
- Returns:
- A map of test namespaces for the writer to handle.
-
getNamespacesWithEmpty
- Returns:
- A map of test namespaces for the writer to handle, including an empty namespace.
-
createTupleNoBindingSets
-
doTupleLinks
protected void doTupleLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleLinksAndStylesheet
protected void doTupleLinksAndStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleLinksAndStylesheetAndNamespaces
protected void doTupleLinksAndStylesheetAndNamespaces(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String,String> namespaces) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleLinksAndStylesheetAndNamespacesQName
protected void doTupleLinksAndStylesheetAndNamespacesQName(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String,String> namespaces) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOExceptionTest specifically for QName support. -
doTupleJSONPCallback
protected void doTupleJSONPCallback(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOExceptionTest specifically for JSONP callback support. -
doTupleNoLinks
protected void doTupleNoLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) throws IOException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException, QueryResultHandlerException -
doTupleStylesheet
protected void doTupleStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleLinksAndStylesheetNoStarts
protected void doTupleLinksAndStylesheetNoStarts(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleLinksAndStylesheetMultipleEndHeaders
protected void doTupleLinksAndStylesheetMultipleEndHeaders(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
assertQueryResultsEqual
protected void assertQueryResultsEqual(TupleQueryResult expected, TupleQueryResult output) throws QueryEvaluationException, TupleQueryResultHandlerException, QueryResultHandlerException, UnsupportedEncodingException -
doTupleMissingStartQueryResult
protected void doTupleMissingStartQueryResult(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException -
doTupleNoHandler
protected void doTupleNoHandler(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) throws QueryResultParseException, IOException, TupleQueryResultHandlerException, UnsupportedQueryResultFormatException, QueryEvaluationExceptionTests that parsing a tuple results set without specifying aTupleQueryResultHandler
does not throw any exceptions.- Parameters:
format
-input
-- Throws:
QueryResultParseException
IOException
TupleQueryResultHandlerException
QueryEvaluationException
UnsupportedQueryResultFormatException
-
doTupleParseNoHandlerOnBooleanResults
protected void doTupleParseNoHandlerOnBooleanResults(TupleQueryResultFormat format, boolean input, BooleanQueryResultFormat matchingBooleanFormat) throws UnsupportedQueryResultFormatException, QueryResultHandlerException, IOExceptionTests that the parser returned for a TupleQueryResultFormat is not able to parse a BooleanQueryResultFormat using the deprecatedTupleQueryResultParser.parse(java.io.InputStream)
method, and that it does indeed through an exception of typeQueryResultParseException
.- Parameters:
format
-input
-matchingBooleanFormat
- A BooleanQueryResultFormat that matches the given TupleQueryResultFormat .- Throws:
IOException
QueryEvaluationException
UnsupportedQueryResultFormatException
QueryResultHandlerException
- See Also:
- SES-1860
-
doBooleanNoLinks
protected void doBooleanNoLinks(BooleanQueryResultFormat format, boolean input) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanLinksOnly
protected void doBooleanLinksOnly(BooleanQueryResultFormat format, boolean input, List<String> links) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doInvalidBooleanAfterStartQueryResult
protected void doInvalidBooleanAfterStartQueryResult(BooleanQueryResultFormat format, boolean input, List<String> links) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanLinks
protected void doBooleanLinks(BooleanQueryResultFormat format, boolean input, List<String> links) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanLinksAndStylesheet
protected void doBooleanLinksAndStylesheet(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanLinksAndStylesheetAndNamespaces
protected void doBooleanLinksAndStylesheetAndNamespaces(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl, Map<String,String> namespaces) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanStylesheet
protected void doBooleanStylesheet(BooleanQueryResultFormat format, boolean input, String stylesheetUrl) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException -
doBooleanNoHandler
protected void doBooleanNoHandler(BooleanQueryResultFormat format, boolean input) throws QueryResultParseException, IOExceptionTests that parsing a boolean without specifying aBooleanQueryResultHandler
does not throw any exceptions.- Parameters:
format
-input
-- Throws:
QueryResultParseException
IOException
-
doBooleanParseNoHandlerOnTupleResults
protected void doBooleanParseNoHandlerOnTupleResults(BooleanQueryResultFormat format, TupleQueryResult tqr, TupleQueryResultFormat matchingTupleFormat) throws TupleQueryResultHandlerException, UnsupportedQueryResultFormatException, QueryEvaluationException, IOExceptionTests that the parser returned for a BooleanQueryResultFormat is not able to parse a TupleQueryResultFormat using the deprecatedBooleanQueryResultParser.parse(java.io.InputStream)
method, and that it does indeed through an exception of typeQueryResultParseException
.- Parameters:
format
-tqr
-matchingTupleFormat
- A TupleQueryResultFormat that matches the given BooleanQueryResultFormat.- Throws:
IOException
QueryEvaluationException
UnsupportedQueryResultFormatException
TupleQueryResultHandlerException
- See Also:
- SES-1860
-