use of org.apache.axiom.om.OMXMLParserWrapper in project wso2-synapse by wso2.
the class SynapseTestCase method loadDescriptorInfoFile.
/**
* Reads the specific descriptor file for the particular sample
* from resource directory
*
* @return true if the configuration was loaded successfully
*/
private OMElement loadDescriptorInfoFile() {
String sampleDescriptor = "/sample" + sampleId + ".xml";
if (log.isDebugEnabled()) {
log.debug("Reading sample descriptor file from " + sampleDescriptor);
}
try {
InputStream in = this.getClass().getResourceAsStream(sampleDescriptor);
if (in == null) {
fail("Cannot read sample descriptor file");
}
OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(in);
return builder.getDocumentElement();
} catch (Exception e) {
log.error("Error loading test descriptor", e);
return null;
}
}
Aggregations