use of org.apache.jena.rdf.model.RDFReader in project jena by apache.
the class ExceptionTests method testExceptionWarning.
public void testExceptionWarning() {
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setErrorHandler(this);
rdr.read(m, "file:testing/arp/qname-in-ID/bug74_0.rdf");
fail("Warning did not throw exception with non-standard handler");
} catch (JenaException e) {
}
}
use of org.apache.jena.rdf.model.RDFReader in project jena by apache.
the class ExceptionTests method testExceptionError.
public void testExceptionError() {
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setErrorHandler(this);
rdr.read(m, "file:testing/wg/rdfms-abouteach/error002.rdf");
fail("Error did not throw exception with non-standard handler");
} catch (JenaException e) {
}
}
use of org.apache.jena.rdf.model.RDFReader in project jena by apache.
the class ExceptionTests method testDefaultPromotedError.
public void testDefaultPromotedError() {
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setProperty("ERR_BAD_RDF_ATTRIBUTE", "EM_FATAL");
rdr.read(m, "file:testing/wg/rdfms-abouteach/error002.rdf");
fail("Promoted error did not throw exception");
} catch (JenaException e) {
// System.err.println(e.getMessage());
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
use of org.apache.jena.rdf.model.RDFReader in project jena by apache.
the class MoreTests method testLatin1.
public void testLatin1() throws IOException {
Model m = createMemModel();
RDFReader rdr = m.getReader();
InputStream r = new FileInputStream("testing/arp/i18n/latin1.rdf");
rdr.setErrorHandler(this);
expected = new int[] { WARN_NONCANONICAL_IANA_NAME };
rdr.read(m, r, "http://example.org/");
checkExpected();
}
use of org.apache.jena.rdf.model.RDFReader in project jena by apache.
the class MoreTests method testARPMacArabic.
public void testARPMacArabic() throws IOException {
Model m = createMemModel();
RDFReader rdr = m.getReader();
InputStream r = new FileInputStream("testing/arp/i18n/arabic-macarabic.rdf");
rdr.setErrorHandler(this);
expected = new int[] { WARN_UNSUPPORTED_ENCODING, WARN_NON_IANA_ENCODING };
expected[Charset.isSupported("MacArabic") ? 0 : 1] = 0;
// Only one of the warnings is expected, which depends on Java version
rdr.read(m, r, "http://example.org/");
checkExpected();
}
Aggregations