@Test(expected = DocumentManipulatorException.class) public void testParseDocumentEmptyFile() throws DocumentManipulatorException { handler.parseDocument(new File("")); }
protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; }
DocumentManipulator { protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; } }
DocumentManipulator { protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; } DocumentManipulator(); }
DocumentManipulator { protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; } DocumentManipulator(); NodeList getNodeList(Document doc, String expression); void serializeDocumentToHtml(Document document, File outputFile, File xslFile); void serializeDocumentToXml(Document document, File outputFile); String serializeDocumentToString(Document document); }
DocumentManipulator { protected Document parseDocument(File file) throws DocumentManipulatorException { Document doc = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); doc = builder.parse(file); } catch (SAXException e) { throw new DocumentManipulatorException(e); } catch (IOException e) { throw new DocumentManipulatorException(e); } catch (ParserConfigurationException e) { throw new DocumentManipulatorException(e); } return doc; } DocumentManipulator(); NodeList getNodeList(Document doc, String expression); void serializeDocumentToHtml(Document document, File outputFile, File xslFile); void serializeDocumentToXml(Document document, File outputFile); String serializeDocumentToString(Document document);  }