diff --git a/xml/src/main/java/com/baeldung/xml/Dom4JParser.java b/xml/src/main/java/com/baeldung/xml/Dom4JParser.java old mode 100644 new mode 100755 index d1f3605160..155b1b8ac0 --- a/xml/src/main/java/com/baeldung/xml/Dom4JParser.java +++ b/xml/src/main/java/com/baeldung/xml/Dom4JParser.java @@ -82,7 +82,7 @@ public class Dom4JParser { title.setText(title.getText() + " updated"); } } - XMLWriter writer = new XMLWriter(new FileWriter(new File("src/test/resources/example_updated.xml"))); + XMLWriter writer = new XMLWriter(new FileWriter(new File("src/test/resources/example_dom4j_updated.xml"))); writer.write(document); writer.close(); } catch (DocumentException e) { @@ -110,7 +110,7 @@ public class Dom4JParser { tutorialElement.addElement("author").addText("Dom4J tech writer"); OutputFormat format = OutputFormat.createPrettyPrint(); - XMLWriter writer = new XMLWriter(new FileWriter(new File("src/test/resources/example_new.xml")), format); + XMLWriter writer = new XMLWriter(new FileWriter(new File("src/test/resources/example_dom4j_new.xml")), format); writer.write(document); writer.close(); } catch (IOException e) { diff --git a/xml/src/test/java/com/baeldung/xml/DefaultParserUnitTest.java b/xml/src/test/java/com/baeldung/xml/DefaultParserUnitTest.java old mode 100644 new mode 100755 index 29ede74931..9b4a916b7c --- a/xml/src/test/java/com/baeldung/xml/DefaultParserUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/DefaultParserUnitTest.java @@ -1,6 +1,8 @@ package com.baeldung.xml; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.File; @@ -10,9 +12,9 @@ import org.w3c.dom.NodeList; public class DefaultParserUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_default_parser.xml"; - final String fileNameSpace = "src/test/resources/example_namespace.xml"; + final String fileNameSpace = "src/test/resources/example_default_parser_namespace.xml"; DefaultParser parser; diff --git a/xml/src/test/java/com/baeldung/xml/Dom4JParserUnitTest.java b/xml/src/test/java/com/baeldung/xml/Dom4JParserUnitTest.java old mode 100644 new mode 100755 index ebb0adc2d1..a8d5864f02 --- a/xml/src/test/java/com/baeldung/xml/Dom4JParserUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/Dom4JParserUnitTest.java @@ -13,7 +13,7 @@ import org.junit.Test; public class Dom4JParserUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_dom4j.xml"; Dom4JParser parser; @@ -61,7 +61,7 @@ public class Dom4JParserUnitTest { parser = new Dom4JParser(new File(fileName)); parser.generateModifiedDocument(); - File generatedFile = new File("src/test/resources/example_updated.xml"); + File generatedFile = new File("src/test/resources/example_dom4j_updated.xml"); assertTrue(generatedFile.exists()); parser.setFile(generatedFile); @@ -76,13 +76,12 @@ public class Dom4JParserUnitTest { parser = new Dom4JParser(new File(fileName)); parser.generateNewDocument(); - File newFile = new File("src/test/resources/example_new.xml"); + File newFile = new File("src/test/resources/example_dom4j_new.xml"); assertTrue(newFile.exists()); parser.setFile(newFile); Node element = parser.getNodeById("01"); assertEquals("XML with Dom4J", element.selectSingleNode("title").getText()); - } } diff --git a/xml/src/test/java/com/baeldung/xml/JDomParserUnitTest.java b/xml/src/test/java/com/baeldung/xml/JDomParserUnitTest.java old mode 100644 new mode 100755 index f3373890b8..af97e1b16d --- a/xml/src/test/java/com/baeldung/xml/JDomParserUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/JDomParserUnitTest.java @@ -12,7 +12,7 @@ import org.junit.Test; public class JDomParserUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_jdom.xml"; JDomParser parser; diff --git a/xml/src/test/java/com/baeldung/xml/JaxbParserUnitTest.java b/xml/src/test/java/com/baeldung/xml/JaxbParserUnitTest.java old mode 100644 new mode 100755 index a7a2fc1e12..faed257298 --- a/xml/src/test/java/com/baeldung/xml/JaxbParserUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/JaxbParserUnitTest.java @@ -11,7 +11,7 @@ import com.baeldung.xml.binding.Tutorials; public class JaxbParserUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_jaxb.xml"; JaxbParser parser; @@ -27,7 +27,7 @@ public class JaxbParserUnitTest { @Test public void createNewDocumentTest() { - File newFile = new File("src/test/resources/example_new.xml"); + File newFile = new File("src/test/resources/example_jaxb_new.xml"); parser = new JaxbParser(newFile); parser.createNewDocument(); diff --git a/xml/src/test/java/com/baeldung/xml/JaxenDemoUnitTest.java b/xml/src/test/java/com/baeldung/xml/JaxenDemoUnitTest.java old mode 100644 new mode 100755 index 3e7f7e09b7..d13a49815c --- a/xml/src/test/java/com/baeldung/xml/JaxenDemoUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/JaxenDemoUnitTest.java @@ -10,7 +10,7 @@ import org.junit.Test; public class JaxenDemoUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_jaxen.xml"; JaxenDemo jaxenDemo; diff --git a/xml/src/test/java/com/baeldung/xml/StaxParserUnitTest.java b/xml/src/test/java/com/baeldung/xml/StaxParserUnitTest.java old mode 100644 new mode 100755 index ff9a17de14..6c3bbd9ef0 --- a/xml/src/test/java/com/baeldung/xml/StaxParserUnitTest.java +++ b/xml/src/test/java/com/baeldung/xml/StaxParserUnitTest.java @@ -12,7 +12,7 @@ import com.baeldung.xml.binding.Tutorial; public class StaxParserUnitTest { - final String fileName = "src/test/resources/example.xml"; + final String fileName = "src/test/resources/example_stax.xml"; StaxParser parser; diff --git a/xml/src/test/resources/Customer1.xml b/xml/src/test/resources/Customer1.xml old mode 100644 new mode 100755 diff --git a/xml/src/test/resources/example.xml b/xml/src/test/resources/example_default_parser.xml old mode 100644 new mode 100755 similarity index 100% rename from xml/src/test/resources/example.xml rename to xml/src/test/resources/example_default_parser.xml diff --git a/xml/src/test/resources/example_default_parser_namespace.xml b/xml/src/test/resources/example_default_parser_namespace.xml new file mode 100644 index 0000000000..0142e64735 --- /dev/null +++ b/xml/src/test/resources/example_default_parser_namespace.xml @@ -0,0 +1,32 @@ + + + + Guava + Introduction to Guava + 04/04/2016 + GuavaAuthor + + + XML + Introduction to XPath + 04/05/2016 + XMLAuthor + + + Android + Introduction to Android + 04/03/2016 + AndroidAuthor + + + Spring + Introduction to Spring + 04/02/2016 + SpringAuthor + +
Spring Core
+
Spring MVC
+
Spring Batch
+
+
+
\ No newline at end of file diff --git a/xml/src/test/resources/example_namespace.xml b/xml/src/test/resources/example_dom4j.xml old mode 100644 new mode 100755 similarity index 89% rename from xml/src/test/resources/example_namespace.xml rename to xml/src/test/resources/example_dom4j.xml index f1a880951a..0993b6240a --- a/xml/src/test/resources/example_namespace.xml +++ b/xml/src/test/resources/example_dom4j.xml @@ -1,6 +1,6 @@ - - + + Guava Introduction to Guava 04/04/2016 diff --git a/xml/src/test/resources/example_updated.xml b/xml/src/test/resources/example_dom4j_updated.xml old mode 100644 new mode 100755 similarity index 100% rename from xml/src/test/resources/example_updated.xml rename to xml/src/test/resources/example_dom4j_updated.xml diff --git a/xml/src/test/resources/example_jaxb.xml b/xml/src/test/resources/example_jaxb.xml new file mode 100755 index 0000000000..0993b6240a --- /dev/null +++ b/xml/src/test/resources/example_jaxb.xml @@ -0,0 +1,32 @@ + + + + Guava + Introduction to Guava + 04/04/2016 + GuavaAuthor + + + XML + Introduction to XPath + 04/05/2016 + XMLAuthor + + + Android + Introduction to Android + 04/03/2016 + AndroidAuthor + + + Spring + Introduction to Spring + 04/02/2016 + SpringAuthor + +
Spring Core
+
Spring MVC
+
Spring Batch
+
+
+
\ No newline at end of file diff --git a/xml/src/test/resources/example_jaxen.xml b/xml/src/test/resources/example_jaxen.xml new file mode 100755 index 0000000000..0993b6240a --- /dev/null +++ b/xml/src/test/resources/example_jaxen.xml @@ -0,0 +1,32 @@ + + + + Guava + Introduction to Guava + 04/04/2016 + GuavaAuthor + + + XML + Introduction to XPath + 04/05/2016 + XMLAuthor + + + Android + Introduction to Android + 04/03/2016 + AndroidAuthor + + + Spring + Introduction to Spring + 04/02/2016 + SpringAuthor + +
Spring Core
+
Spring MVC
+
Spring Batch
+
+
+
\ No newline at end of file diff --git a/xml/src/test/resources/example_jdom.xml b/xml/src/test/resources/example_jdom.xml new file mode 100755 index 0000000000..0993b6240a --- /dev/null +++ b/xml/src/test/resources/example_jdom.xml @@ -0,0 +1,32 @@ + + + + Guava + Introduction to Guava + 04/04/2016 + GuavaAuthor + + + XML + Introduction to XPath + 04/05/2016 + XMLAuthor + + + Android + Introduction to Android + 04/03/2016 + AndroidAuthor + + + Spring + Introduction to Spring + 04/02/2016 + SpringAuthor + +
Spring Core
+
Spring MVC
+
Spring Batch
+
+
+
\ No newline at end of file diff --git a/xml/src/test/resources/example_new.xml b/xml/src/test/resources/example_new.xml deleted file mode 100644 index 020760fdd3..0000000000 --- a/xml/src/test/resources/example_new.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - XML with Dom4J - XML handling with Dom4J - 14/06/2016 - Dom4J tech writer - - diff --git a/xml/src/test/resources/example_stax.xml b/xml/src/test/resources/example_stax.xml new file mode 100755 index 0000000000..0993b6240a --- /dev/null +++ b/xml/src/test/resources/example_stax.xml @@ -0,0 +1,32 @@ + + + + Guava + Introduction to Guava + 04/04/2016 + GuavaAuthor + + + XML + Introduction to XPath + 04/05/2016 + XMLAuthor + + + Android + Introduction to Android + 04/03/2016 + AndroidAuthor + + + Spring + Introduction to Spring + 04/02/2016 + SpringAuthor + +
Spring Core
+
Spring MVC
+
Spring Batch
+
+
+
\ No newline at end of file