Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
This repository was 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

Description

@no-reply

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions