use of javax.xml.parsers.FactoryConfigurationError in project robovm by robovm.
the class FactoryConfigurationErrorTest method test_Constructor.
public void test_Constructor() {
FactoryConfigurationError fce = new FactoryConfigurationError();
assertNull(fce.getMessage());
assertNull(fce.getLocalizedMessage());
assertNull(fce.getCause());
}
use of javax.xml.parsers.FactoryConfigurationError in project robovm by robovm.
the class FactoryConfigurationErrorTest method test_ConstructorLjava_lang_ExceptionLjava_lang_String.
public void test_ConstructorLjava_lang_ExceptionLjava_lang_String() {
Exception e = new Exception();
// case 1: Try to create FactoryConfigurationError
// which is based on Exception without parameters.
FactoryConfigurationError fce = new FactoryConfigurationError(e, "msg");
assertNotNull(fce.getMessage());
assertNotNull(fce.getLocalizedMessage());
assertEquals(e.getCause(), fce.getCause());
// case 2: Try to create FactoryConfigurationError
// which is based on Exception with String parameter.
e = new Exception("test message");
fce = new FactoryConfigurationError(e, "msg");
assertEquals("msg", fce.getMessage());
assertEquals("msg", fce.getLocalizedMessage());
assertEquals(e.getCause(), fce.getCause());
}
use of javax.xml.parsers.FactoryConfigurationError in project spring-security by spring-projects.
the class WebXmlMappableAttributesRetriever method getDocument.
/**
* @return Document for the specified InputStream
*/
private Document getDocument(InputStream aStream) {
Document doc;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
DocumentBuilder db = factory.newDocumentBuilder();
db.setEntityResolver(new MyEntityResolver());
doc = db.parse(aStream);
return doc;
} catch (FactoryConfigurationError e) {
throw new RuntimeException("Unable to parse document object", e);
} catch (ParserConfigurationException e) {
throw new RuntimeException("Unable to parse document object", e);
} catch (SAXException e) {
throw new RuntimeException("Unable to parse document object", e);
} catch (IOException e) {
throw new RuntimeException("Unable to parse document object", e);
} finally {
try {
aStream.close();
} catch (IOException e) {
logger.warn("Failed to close input stream for web.xml", e);
}
}
}
Aggregations