OKW_XmlReader { public String getXMLFile() { return myXMLFile.toString(); } OKW_XmlReader(String fpsXMLFile); String getXMLFile(); String getTextContentSingleValue( String fpsXPathExpression ); ArrayList<String> getTextContentAsList( String fpsXPathExpression );  }
@Test public void TC_getXMLFile() { try { OKW_XmlReader myXlReader = new OKW_XmlReader("/OKW_XmlReaderTestXML.xml"); String Actuell = myXlReader.getXMLFile(); assertEquals("Ein Wert wird erwartet:", "/OKW_XmlReaderTestXML.xml", Actuell); } catch (JAXBException | ParserConfigurationException | SAXException | IOException e) { fail(e.getMessage()); } }
@Test public void TC_getXMLFil2e() { try { OKW_XmlReader myXlReader = new OKW_XmlReader("/xml/OKW_Ini.xml"); String Actuell = myXlReader.getXMLFile(); assertEquals("Ein Wert wird erwartet:", "/xml/OKW_Ini.xml", Actuell); } catch (JAXBException | ParserConfigurationException | SAXException | IOException e) { fail(e.getMessage()); } }
@Test public void TC_getXMLFile_FileNotFoundException() throws JAXBException, ParserConfigurationException, SAXException, IOException { OKW_XmlReader myXlReader = new OKW_XmlReader("DoesNotExists.xml"); Assertions.assertThrows( FileNotFoundException.class, () -> { myXlReader.getXMLFile(); }); }