From 9cf446a8efaa8a6d16c260e343adb17ae3c75ff2 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sun, 27 Jun 2021 10:59:09 +0200 Subject: Starting the XMLHandler tests --- src/test/java/musichub/util/XMLHandlerTest.java | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/java/musichub/util/XMLHandlerTest.java (limited to 'src/test/java') diff --git a/src/test/java/musichub/util/XMLHandlerTest.java b/src/test/java/musichub/util/XMLHandlerTest.java new file mode 100644 index 0000000..1be2258 --- /dev/null +++ b/src/test/java/musichub/util/XMLHandlerTest.java @@ -0,0 +1,30 @@ +package musichub.util; + + +import org.junit.jupiter.api.Test; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; + +public class XMLHandlerTest { + + final String DIR = System.getProperty("user.dir"); + final String JUNIT_FILE_PATH = DIR + "/files/JUnit.xml"; + +/* @Test + void testXMLHandlerClass() { + XMLHandler xmlHandler = new XMLHandler(); + }*/ + + @Test + void testCreateXML() { + XMLHandler xmlHandler = new XMLHandler(); //XML class + Document document = xmlHandler.createXMLDocument(); //XMLDocument method + xmlHandler.createXMLFile(document, JUNIT_FILE_PATH); //XMLFile method + } + + @Test + void testParseXMLFile() { + XMLHandler xmlHandler = new XMLHandler(); + NodeList albumNodes = xmlHandler.parseXMLFile(JUNIT_FILE_PATH); + } +} -- cgit v1.2.3