From d6cc8a6a8e57f3a9026aab4f0b1f805b92efc653 Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <andreas.romeyke@slub-dresden.de>
Date: Mon, 20 Feb 2023 15:26:37 +0100
Subject: [PATCH] - reordered tests

---
 .../TestSLUBXmlFormatValidationPlugin.java    | 21 +++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/java/org/slub/rosetta/dps/repository/plugin/TestSLUBXmlFormatValidationPlugin.java b/java/org/slub/rosetta/dps/repository/plugin/TestSLUBXmlFormatValidationPlugin.java
index ec8d617..08b1577 100644
--- a/java/org/slub/rosetta/dps/repository/plugin/TestSLUBXmlFormatValidationPlugin.java
+++ b/java/org/slub/rosetta/dps/repository/plugin/TestSLUBXmlFormatValidationPlugin.java
@@ -11,8 +11,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.stream.Stream;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 /**
  * Tests for {@link SLUBXmlFormatValidationPlugin}.
@@ -29,7 +28,7 @@ public class TestSLUBXmlFormatValidationPlugin {
     public void setUp() {
         Stream<Path> findFiles;
         try {
-            findFiles = Files.find(Path.of("resources/test/"), 5, ((path, basicFileAttributes) -> Files.isRegularFile(path)));
+            findFiles = Files.find(Path.of("resources/test/mods"), 5, ((path, basicFileAttributes) -> Files.isRegularFile(path)));
             testPaths = findFiles.toArray(Path[]::new);
         } catch (IOException e) {
             // do nothing, because nothing found
@@ -46,14 +45,14 @@ public class TestSLUBXmlFormatValidationPlugin {
                 System.out.println("file " + path + " ignored");
                 continue;
             }
-            if (path.toString().contains("test-4.2.xml")) {
-                continue;
-            }
-            assertTrue("validateFormat (pass), check if "+path+" exist", Files.exists(path));
-            assertTrue("validateFormat(" + path + "), returns valid?", mock.validateFormat(path.toString()));
-            assertTrue("validateFormat(" + path + "), is valid?", mock.validateFormat(path.toString()));
-            assertTrue( "validateFormat(" + path + "), is wellformed?", mock.isWellFormed());
-            assertNotNull("getValidationDetails(), " + path + ", not null", mock.getValidationDetails());
+            System.out.println("==================================================================================");
+            assertTrue   ("validateFormat (pass), check if "+path+" exist",    Files.exists(path));
+            assertTrue   ("validateFormat(" + path + "), returns valid?",      mock.validateFormat(path.toString()));
+            assertTrue   ( "validateFormat(" + path + "), is wellformed?",     mock.isWellFormed());
+            assertNull   ( "validateFormat(" + path + "), reports no errors?", mock.getErrors());
+            assertNotNull("getValidationDetails(), " + path + ", not null",    mock.getValidationDetails());
+            assertTrue   ("validateFormat(" + path + "), is valid?",           mock.isValid());
+
         }
     }
 }
-- 
GitLab