Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Many tests fail with NullPointerError if a representation is an empty graph #224

Open
no-reply opened this issue Jul 27, 2015 · 1 comment

Comments

@no-reply
Copy link

The string "" is a valid Turtle representation of a resource, but at least 6 tests fail with errors like the following if that is returned for a newly created resource:

[FAILURE] BasicContainerTest.testGetResourceAcceptTurtle

LDP servers must respond with a Turtle representation of the requested LDP-RS
when the request includes an Accept header specifying text/turtle, unless HTTP
content negotiation requires a different outcome [turtle].

java.lang.NullPointerException
    at com.jayway.restassured.internal.support.CloseHTTPClientConnectionInputStreamWrapper.read(CloseHTTPClientConnectionInputStreamWrapper.java:49)
    at java.io.FilterInputStream.read(FilterInputStream.java:133)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.Reader.read(Reader.java:140)
    at org.apache.jena.atlas.io.CharStreamBuffered$SourceReader.fill(CharStreamBuffered.java:77)
    at org.apache.jena.atlas.io.CharStreamBuffered.fillArray(CharStreamBuffered.java:154)
    at org.apache.jena.atlas.io.CharStreamBuffered.advance(CharStreamBuffered.java:137)
    at org.apache.jena.atlas.io.PeekReader.advanceAndSet(PeekReader.java:241)
    at org.apache.jena.atlas.io.PeekReader.init(PeekReader.java:235)
    at org.apache.jena.atlas.io.PeekReader.peekChar(PeekReader.java:157)
    at org.apache.jena.atlas.io.PeekReader.makeUTF8(PeekReader.java:98)
    at org.apache.jena.riot.tokens.TokenizerFactory.makeTokenizerUTF8(TokenizerFactory.java:41)
    at org.apache.jena.riot.RiotReader.createParser(RiotReader.java:138)
    at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:164)
    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:859)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:255)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:241)
    at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
    at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
    at org.w3.ldp.testsuite.mapper.RdfObjectMapper.deserialize(RdfObjectMapper.java:50)
    at com.jayway.restassured.mapper.ObjectMapper$deserialize$0.call(Unknown Source)
    at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.as(RestAssuredResponseOptionsGroovyImpl.groovy:218)
    at com.jayway.restassured.internal.RestAssuredResponseOptionsImpl.as(RestAssuredResponseOptionsImpl.java:161)
    at org.w3.ldp.testsuite.test.RdfSourceTest.testGetResourceAcceptTurtle(RdfSourceTest.java:290)
    at org.w3.ldp.testsuite.LdpTestSuite.run(LdpTestSuite.java:379)
    at org.w3.ldp.testsuite.LdpTestSuite.executeTestSuite(LdpTestSuite.java:415)
    at org.w3.ldp.testsuite.LdpTestSuite.executeTestSuite(LdpTestSuite.java:407)
    at org.w3.ldp.testsuite.RunLdpTestSuite.main(RunLdpTestSuite.java:26)
... Removed 21 stack frames
@no-reply
Copy link
Author

This arose while working on https://github.com/ruby-rdf/rdf-ldp. Because this project includes library with middleware for building your own LDP server behavior, the design avoids adding triples to representations except where required by the LDP spec.

Unless we interpret the requirement to respond with a turtle representation as a requirement to respond with a non-empty representation, this seems like a bug in the test suite.

no-reply pushed a commit to ruby-rdf/rdf-ldp that referenced this issue Jul 27, 2015
cbeer added a commit to cbeer/ldp-testsuite that referenced this issue Feb 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant