Search in sources :

Example 1 with NoReaderForLangException

use of org.apache.jena.shared.NoReaderForLangException in project jena by apache.

the class TestIO_JenaReaders method resetJena.

@Test
public void resetJena() {
    IO_Jena.wireIntoJena();
    IO_Jena.resetJena();
    RDFReaderF readerF = new RDFReaderFImpl();
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader().getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("RDF/XML").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("RDF/XML-ABBREV").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("N-TRIPLES").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("N-Triples").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("N-TRIPLE").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("N3").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("TURTLE").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("Turtle").getClass());
    assertNotEquals(RDFReaderRIOT.class, readerF.getReader("TTL").getClass());
    try {
        readerF.getReader("NT");
        fail("Exception expected");
    } catch (NoReaderForLangException e) {
    }
    try {
        readerF.getReader("JSON_LD");
        fail("Exception expected");
    } catch (NoReaderForLangException e) {
    }
    try {
        readerF.getReader("RDF/JSON");
        fail("Exception expected");
    } catch (NoReaderForLangException e) {
    }
    IO_Jena.wireIntoJena();
}
Also used : NoReaderForLangException(org.apache.jena.shared.NoReaderForLangException) RDFReaderFImpl(org.apache.jena.rdf.model.impl.RDFReaderFImpl) RDFReaderF(org.apache.jena.rdf.model.RDFReaderF) Test(org.junit.Test)

Aggregations

RDFReaderF (org.apache.jena.rdf.model.RDFReaderF)1 RDFReaderFImpl (org.apache.jena.rdf.model.impl.RDFReaderFImpl)1 NoReaderForLangException (org.apache.jena.shared.NoReaderForLangException)1 Test (org.junit.Test)1