Search in sources :

Example 1 with RDFReaderFImpl

use of org.apache.jena.rdf.model.impl.RDFReaderFImpl in project jena by apache.

the class TestIO_JenaReaders method wireIntoJena.

@Test
public void wireIntoJena() {
    IO_Jena.wireIntoJena();
    RDFReaderF readerF = new RDFReaderFImpl();
    assertEquals(RDFReaderRIOT.class, readerF.getReader().getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("RDF/XML").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("RDF/XML-ABBREV").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("N-TRIPLES").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("N-Triples").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("N-TRIPLE").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("N3").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("TURTLE").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("Turtle").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("TTL").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("JSON-LD").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("JSONLD").getClass());
    assertEquals(RDFReaderRIOT.class, readerF.getReader("RDF/JSON").getClass());
}
Also used : RDFReaderFImpl(org.apache.jena.rdf.model.impl.RDFReaderFImpl) RDFReaderF(org.apache.jena.rdf.model.RDFReaderF) Test(org.junit.Test)

Example 2 with RDFReaderFImpl

use of org.apache.jena.rdf.model.impl.RDFReaderFImpl 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)2 RDFReaderFImpl (org.apache.jena.rdf.model.impl.RDFReaderFImpl)2 Test (org.junit.Test)2 NoReaderForLangException (org.apache.jena.shared.NoReaderForLangException)1