Class AbstractQueryResultIOTest
- java.lang.Object
-
- org.eclipse.rdf4j.testsuite.query.resultio.AbstractQueryResultIOTest
-
- Direct Known Subclasses:
AbstractQueryResultIOBooleanTest
,AbstractQueryResultIOTupleTest
public abstract class AbstractQueryResultIOTest extends Object
- Author:
- Peter Ansell
-
-
Constructor Summary
Constructors Constructor Description AbstractQueryResultIOTest()
-
Method Summary
-
-
-
Method Detail
-
getFileName
protected abstract String getFileName()
- Returns:
- An example filename that will match the
QueryResultFormat
returned bygetFormat()
.
-
getFormat
protected abstract QueryResultFormat getFormat()
-
parseTupleInternal
protected TupleQueryResult parseTupleInternal(TupleQueryResultFormat format, InputStream in) throws IOException, QueryResultParseException, TupleQueryResultHandlerException, UnsupportedQueryResultFormatException
Override 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 public final void testGetParserFormatForFileNameString() throws Exception
Test method forQueryResultIO.getParserFormatForFileName(java.lang.String)
.- Throws:
Exception
-
createTupleSingleVarMultipleBindingSets
protected TupleQueryResult createTupleSingleVarMultipleBindingSets()
-
createTupleMultipleBindingSets
protected TupleQueryResult createTupleMultipleBindingSets()
-
getNamespaces
protected Map<String,String> getNamespaces()
- Returns:
- A map of test namespaces for the writer to handle.
-
getNamespacesWithEmpty
protected Map<String,String> getNamespacesWithEmpty()
- Returns:
- A map of test namespaces for the writer to handle, including an empty namespace.
-
createTupleNoBindingSets
protected TupleQueryResult 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, IOException
Test specifically for QName support.
-
doTupleJSONPCallback
protected void doTupleJSONPCallback(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException, IOException
Test 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, QueryEvaluationException
Tests 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, IOException
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
.- 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, IOException
Tests 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, IOException
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
.- Parameters:
format
-tqr
-matchingTupleFormat
- A TupleQueryResultFormat that matches the given BooleanQueryResultFormat.- Throws:
IOException
QueryEvaluationException
UnsupportedQueryResultFormatException
TupleQueryResultHandlerException
- See Also:
- SES-1860
-
-