From d4c6fe18ca94ed0880720d7ff135b82920d764b4 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sun, 27 Jun 2021 11:16:21 +0200 Subject: XMLHandler tests covered at 91% --- target/site/jacoco/musichub.util/XMLHandler.html | 2 +- .../site/jacoco/musichub.util/XMLHandler.java.html | 42 +++++++++++----------- target/site/jacoco/musichub.util/index.html | 2 +- target/site/jacoco/musichub.util/index.source.html | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'target/site/jacoco/musichub.util') diff --git a/target/site/jacoco/musichub.util/XMLHandler.html b/target/site/jacoco/musichub.util/XMLHandler.html index 7aff8c8..a99c1d8 100644 --- a/target/site/jacoco/musichub.util/XMLHandler.html +++ b/target/site/jacoco/musichub.util/XMLHandler.html @@ -1 +1 @@ -XMLHandler

XMLHandler

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total72 of 720 %0 of 0n/a44252544
XMLHandler()230 %n/a119911
createXMLFile(Document, String)230 %n/a117711
parseXMLFile(String)220 %n/a118811
createXMLDocument()40 %n/a111111
\ No newline at end of file +XMLHandler

XMLHandler

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total6 of 7291 %0 of 0n/a0442504
XMLHandler()32086 %n/a012901
createXMLFile(Document, String)32086 %n/a012701
parseXMLFile(String)22100 %n/a010801
createXMLDocument()4100 %n/a010101
\ No newline at end of file diff --git a/target/site/jacoco/musichub.util/XMLHandler.java.html b/target/site/jacoco/musichub.util/XMLHandler.java.html index b8ee27a..7d6e751 100644 --- a/target/site/jacoco/musichub.util/XMLHandler.java.html +++ b/target/site/jacoco/musichub.util/XMLHandler.java.html @@ -23,51 +23,51 @@ public class XMLHandler { DocumentBuilderFactory documentFactory; DocumentBuilder documentBuilder; - public XMLHandler() { + public XMLHandler() { try { - transformerFactory = TransformerFactory.newInstance(); - transformer = transformerFactory.newTransformer(); - documentFactory = DocumentBuilderFactory.newInstance(); - documentBuilder = documentFactory.newDocumentBuilder(); + transformerFactory = TransformerFactory.newInstance(); + transformer = transformerFactory.newTransformer(); + documentFactory = DocumentBuilderFactory.newInstance(); + documentBuilder = documentFactory.newDocumentBuilder(); } catch (TransformerException | ParserConfigurationException tfe) { tfe.printStackTrace(); - } - } + } + } public void createXMLFile(Document document, String filePath) { try { // create the xml file //transform the DOM Object to an XML File - DOMSource domSource = new DOMSource(document); - StreamResult streamResult = new StreamResult(new File(filePath)); + DOMSource domSource = new DOMSource(document); + StreamResult streamResult = new StreamResult(new File(filePath)); // If you use // StreamResult result = new StreamResult(System.out); // the output will be pushed to the standard output ... // You can use that for debugging - transformer.transform(domSource, streamResult); + transformer.transform(domSource, streamResult); } catch (TransformerException tfe) { tfe.printStackTrace(); - } - } + } + } public Document createXMLDocument() { - return documentBuilder.newDocument(); + return documentBuilder.newDocument(); } public NodeList parseXMLFile(String filePath) { - NodeList elementNodes = null; + NodeList elementNodes = null; try { - Document document = documentBuilder.parse(new File(filePath)); - Element root = document.getDocumentElement(); + Document document = documentBuilder.parse(new File(filePath)); + Element root = document.getDocumentElement(); - elementNodes = root.getChildNodes(); - } catch (SAXException | IOException e) { - e.printStackTrace(); - } - return elementNodes; + elementNodes = root.getChildNodes(); + } catch (SAXException | IOException e) { + e.printStackTrace(); + } + return elementNodes; } diff --git a/target/site/jacoco/musichub.util/index.html b/target/site/jacoco/musichub.util/index.html index 20f0d2b..8091491 100644 --- a/target/site/jacoco/musichub.util/index.html +++ b/target/site/jacoco/musichub.util/index.html @@ -1 +1 @@ -musichub.util

musichub.util

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total72 of 13546 %0 of 0n/a4925404913
XMLHandler720 %n/a4425254411
LogHandler46100 %n/a030110301
PathValidation17100 %n/a02040201
\ No newline at end of file +musichub.util

musichub.util

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total6 of 13595 %0 of 0n/a094400903
XMLHandler66691 %n/a044250401
LogHandler46100 %n/a030110301
PathValidation17100 %n/a02040201
\ No newline at end of file diff --git a/target/site/jacoco/musichub.util/index.source.html b/target/site/jacoco/musichub.util/index.source.html index f8bbd4e..ce29c52 100644 --- a/target/site/jacoco/musichub.util/index.source.html +++ b/target/site/jacoco/musichub.util/index.source.html @@ -1 +1 @@ -musichub.util

musichub.util

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total72 of 13546 %0 of 0n/a4925404913
XMLHandler.java720 %n/a4425254411
LogHandler.java46100 %n/a030110301
PathValidation.java17100 %n/a02040201
\ No newline at end of file +musichub.util

musichub.util

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total6 of 13595 %0 of 0n/a094400903
XMLHandler.java66691 %n/a044250401
LogHandler.java46100 %n/a030110301
PathValidation.java17100 %n/a02040201
\ No newline at end of file -- cgit v1.2.3