Search in sources :

Example 1 with UnknownEncodingException

use of org.apache.jena.assembler.exceptions.UnknownEncodingException in project jena by apache.

the class TestContentAssembler method testTrapsBadEncodings.

public void testTrapsBadEncodings() {
    Assembler a = new ContentAssembler();
    Resource root = resourceInModel("x rdf:type ja:Content; x ja:contentEncoding 'bogus'; x ja:literalContent 'sham'");
    try {
        a.open(root);
        fail("should trap bad encoding");
    } catch (UnknownEncodingException e) {
        assertEquals("bogus", e.getEncoding());
        assertEquals(resource("x"), e.getRoot());
    }
}
Also used : UnknownEncodingException(org.apache.jena.assembler.exceptions.UnknownEncodingException) ContentAssembler(org.apache.jena.assembler.assemblers.ContentAssembler) ContentAssembler(org.apache.jena.assembler.assemblers.ContentAssembler)

Aggregations

ContentAssembler (org.apache.jena.assembler.assemblers.ContentAssembler)1 UnknownEncodingException (org.apache.jena.assembler.exceptions.UnknownEncodingException)1