@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")); }
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); }
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); } }
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); }  }
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); }
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);  }