use of org.apache.jena.shared.JenaException in project jena by apache.
the class WGTestSuite method loadRDF.
private Model loadRDF(final TestInputStreamFactory fact, final String file) {
Model m = null;
String base = fact.getBase().toString();
if (!base.endsWith("/"))
base = base + "/";
try (InputStream in = fact.fullyOpen(file)) {
if (in == null)
return null;
m = loadRDF(new InFactoryX() {
@Override
public InputStream open() throws IOException {
return fact.fullyOpen(file);
}
}, null, base + file);
} catch (JenaException e) {
// System.out.println(e.getMessage());
throw e;
} catch (Exception e) {
// e.printStackTrace();
if (file.equals("Manifest.rdf")) {
System.err.println("Failed to open Manifest.rdf");
e.printStackTrace();
}
}
return m;
}
use of org.apache.jena.shared.JenaException in project jena by apache.
the class ExceptionTests method testDefaultWarning.
public void testDefaultWarning() {
// W108
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
m.read("file:testing/arp/qname-in-ID/bug74_0.rdf");
} catch (JenaException e) {
fail("Warning threw exception");
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
use of org.apache.jena.shared.JenaException 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.shared.JenaException 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.shared.JenaException in project jena by apache.
the class ExceptionTests method testDefaultError.
public void testDefaultError() {
// E206
RDFDefaultErrorHandler.silent = true;
try {
Model m = ModelFactory.createDefaultModel();
m.read("file:testing/wg/rdfms-abouteach/error002.rdf");
} catch (JenaException e) {
fail("Error threw exception");
} finally {
RDFDefaultErrorHandler.silent = false;
}
}
Aggregations