### Question:
BpmnDeploymentListener implements ArtifactUrlTransformer { protected Document parse(File artifact) throws Exception { if (dbf == null) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); } DocumentBuilder db = dbf.newDocumentBuilder(); db.setErrorHandler(new ErrorHandler() { @Override public void warning(SAXParseException exception) throws SAXException { } @Override public void error(SAXParseException exception) throws SAXException { } @Override public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); return db.parse(artifact); }  @Override boolean canHandle(File artifact); @Override URL transform(URL artifact);  }### Answer:
@Test public void parseBpmnFile() throws Exception { Document doc = listener.parse(new File( "src/test/resources/testprocess.bpmn")); assertThat(doc, is(notNullValue())); assertThat(doc.getDocumentElement().toString(), containsString("bpmn2:definitions")); }
@Test(expected = IllegalArgumentException.class) public void parseNull() throws Exception { Document doc = listener.parse(null); assertThat(doc, is(notNullValue())); }
@Test(expected=SAXParseException.class) public void parseWrongFile() throws Exception { File file = new File("test.txt"); file.deleteOnExit(); FileUtils.write(file, "bpmn xml process defintion task"); Document doc = listener.parse(file); assertThat(doc, is(notNullValue())); }