Class AbstractQueryResultIOTest
java.lang.Object
org.eclipse.rdf4j.testsuite.query.resultio.AbstractQueryResultIOTest
- Direct Known Subclasses:
AbstractQueryResultIOBooleanTest,AbstractQueryResultIOTupleTest
- Author:
- Peter Ansell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertQueryResultsEqual(TupleQueryResult expected, TupleQueryResult output) protected TupleQueryResultprotected TupleQueryResultprotected TupleQueryResultprotected voiddoBooleanLinks(BooleanQueryResultFormat format, boolean input, List<String> links) protected voiddoBooleanLinksAndStylesheet(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl) protected voiddoBooleanLinksAndStylesheetAndNamespaces(BooleanQueryResultFormat format, boolean input, List<String> links, String stylesheetUrl, Map<String, String> namespaces) protected voiddoBooleanLinksOnly(BooleanQueryResultFormat format, boolean input, List<String> links) protected voiddoBooleanNoHandler(BooleanQueryResultFormat format, boolean input) Tests that parsing a boolean without specifying aBooleanQueryResultHandlerdoes not throw any exceptions.protected voiddoBooleanNoLinks(BooleanQueryResultFormat format, boolean input) protected voiddoBooleanParseNoHandlerOnTupleResults(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 voiddoBooleanStylesheet(BooleanQueryResultFormat format, boolean input, String stylesheetUrl) protected voiddoInvalidBooleanAfterStartQueryResult(BooleanQueryResultFormat format, boolean input, List<String> links) protected voiddoTupleJSONPCallback(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) Test specifically for JSONP callback support.protected voiddoTupleLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links) protected voiddoTupleLinksAndStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) protected voiddoTupleLinksAndStylesheetAndNamespaces(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String, String> namespaces) protected voiddoTupleLinksAndStylesheetAndNamespacesQName(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl, Map<String, String> namespaces) Test specifically for QName support.protected voiddoTupleLinksAndStylesheetMultipleEndHeaders(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) protected voiddoTupleLinksAndStylesheetNoStarts(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) protected voiddoTupleMissingStartQueryResult(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) protected voiddoTupleNoHandler(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) Tests that parsing a tuple results set without specifying aTupleQueryResultHandlerdoes not throw any exceptions.protected voiddoTupleNoLinks(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected) protected voiddoTupleParseNoHandlerOnBooleanResults(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 voiddoTupleStylesheet(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, String stylesheetUrl) protected abstract Stringprotected abstract QueryResultFormatprotected TupleQueryResultparseTupleInternal(TupleQueryResultFormat format, InputStream in) Override this to customise how the tuple parsing is performed, particularly to test background and other parsing strategies.final voidTest method forQueryResultIO.getParserFormatForFileName(java.lang.String).
-
Constructor Details
-
AbstractQueryResultIOTest
public AbstractQueryResultIOTest()
-
-
Method Details
-
getFileName
- Returns:
- An example filename that will match the
QueryResultFormatreturned bygetFormat().
-
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- TheTupleQueryResultFormatfor the parser.in- The InputStream to parse- Returns:
- A
TupleQueryResultthat can be parsed. - Throws:
IOExceptionQueryResultParseExceptionTupleQueryResultHandlerExceptionUnsupportedQueryResultFormatException
-
testGetParserFormatForFileNameString
@Test public final void testGetParserFormatForFileNameString()Test method forQueryResultIO.getParserFormatForFileName(java.lang.String). -
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, 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 -
doTupleMissingStartQueryResult
protected void doTupleMissingStartQueryResult(TupleQueryResultFormat format, TupleQueryResult input, TupleQueryResult expected, List<String> links, String stylesheetUrl) throws QueryResultHandlerException, QueryEvaluationException, QueryResultParseException, UnsupportedQueryResultFormatException -
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 aTupleQueryResultHandlerdoes not throw any exceptions.- Parameters:
format-input-- Throws:
QueryResultParseExceptionIOExceptionTupleQueryResultHandlerExceptionQueryEvaluationExceptionUnsupportedQueryResultFormatException
-
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:
IOExceptionQueryEvaluationExceptionUnsupportedQueryResultFormatExceptionQueryResultHandlerException- See Also:
-
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 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 aBooleanQueryResultHandlerdoes not throw any exceptions.- Parameters:
format-input-- Throws:
QueryResultParseExceptionIOException
-
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:
IOExceptionQueryEvaluationExceptionUnsupportedQueryResultFormatExceptionTupleQueryResultHandlerException- See Also:
-