use of org.apache.jena.shared.JenaException in project jena by apache.
the class N3IndentedWriter method println.
public void println(String s) {
try {
writer.write(s);
println();
} catch (java.io.IOException ex) {
throw new JenaException(ex);
}
}
use of org.apache.jena.shared.JenaException in project jena by apache.
the class ExceptionTests method testDefaultDemotedFatal.
public void testDefaultDemotedFatal() {
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setProperty("ERR_SAX_FATAL_ERROR", "EM_ERROR");
rdr.read(m, "file:testing/arp/error-msgs/test06.rdf");
} catch (JenaException e) {
System.err.println(e.getMessage());
e.printStackTrace();
fail("Demoted.error error threw an exception");
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
use of org.apache.jena.shared.JenaException in project jena by apache.
the class ExceptionTests method testDefaultPromotedWarning.
public void testDefaultPromotedWarning() {
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setProperty("WARN_BAD_NAME", "EM_FATAL");
rdr.read(m, "file:testing/arp/qname-in-ID/bug74_0.rdf");
fail("Promoted warning did not throw exception");
} catch (JenaException e) {
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
use of org.apache.jena.shared.JenaException in project jena by apache.
the class ExceptionTests method testDefaultFatal.
public void testDefaultFatal() {
//E301
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
m.read("file:testing/arp/error-msgs/test06.rdf");
fail("Fatal error did not throw exception");
} catch (JenaException e) {
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
use of org.apache.jena.shared.JenaException in project jena by apache.
the class ExceptionTests method testNonExceptionFatal.
public void testNonExceptionFatal() {
try {
Model m = ModelFactory.createDefaultModel();
RDFReader rdr = m.getReader();
rdr.setErrorHandler(this);
rdr.read(m, "file:testing/arp/error-msgs/test06.rdf");
} catch (JenaException e) {
fail("Fatal error threw an exception with non-exception handler");
}
}
Aggregations