From 206e0738f78e727577cacc711258c01dd7c11d33 Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Fri, 17 Jun 2016 14:40:40 +0200
Subject: [PATCH] Exam 2015 summer to Unitmarking lib.

---
 Klausuren/Sda1/SoSe2015/Exam/pom.xml          |  14 ++
 .../test/ignore/InstanceSetEvaluation.java    | 136 ------------------
 .../sda1/exam/test/ignore/InstanceTest.java   | 134 -----------------
 .../mi/sda1/scripts/SchemaTest.java           |   8 +-
 Klausuren/Sda1/SoSe2015/Exam_solve/pom.xml    |  14 ++
 .../test/ignore/InstanceSetEvaluation.java    | 136 ------------------
 .../sda1/exam/test/ignore/InstanceTest.java   | 134 -----------------
 .../mi/sda1/scripts/SchemaTest.java           |   8 +-
 8 files changed, 36 insertions(+), 548 deletions(-)
 delete mode 100644 Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
 delete mode 100644 Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java
 delete mode 100644 Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
 delete mode 100644 Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java

diff --git a/Klausuren/Sda1/SoSe2015/Exam/pom.xml b/Klausuren/Sda1/SoSe2015/Exam/pom.xml
index 885703a4e..aab552d47 100644
--- a/Klausuren/Sda1/SoSe2015/Exam/pom.xml
+++ b/Klausuren/Sda1/SoSe2015/Exam/pom.xml
@@ -16,6 +16,13 @@
 	</properties>
 
 	<dependencies>
+
+		<dependency>
+			<groupId>org.opengis.cite.xerces</groupId>
+			<artifactId>xercesImpl-xsd11</artifactId>
+			<version>2.12-beta-r1667115</version>
+		</dependency>
+
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
@@ -46,12 +53,19 @@
 			<artifactId>log4j-api</artifactId>
 			<version>2.1</version>
 		</dependency>
+
 		<dependency>
 			<groupId>org.apache.logging.log4j</groupId>
 			<artifactId>log4j-core</artifactId>
 			<version>2.1</version>
 		</dependency>
 
+		<dependency>
+			<groupId>de.hdm_stuttgart.mi.exam</groupId>
+			<artifactId>unitmarking</artifactId>
+			<version>0.9</version>
+		</dependency>
+
 	</dependencies>
 
 	<build>
diff --git a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java b/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
deleted file mode 100644
index 4f36858fe..000000000
--- a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package de.hdm_stuttgart.mi.sda1.exam.test.ignore;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.jdom2.Document;
-import org.jdom2.JDOMException;
-import org.jdom2.ProcessingInstruction;
-import org.jdom2.filter.Filters;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.input.sax.XMLReaders;
-import org.jdom2.xpath.XPathExpression;
-import org.jdom2.xpath.XPathFactory;
-
-/**
- * Evaluate a given set of XML document instances
- *
- */
-public class InstanceSetEvaluation {
-   
-   /**
-    * Base directory containing xml test file instances.
-    */
-   public final String xmlTestFileDir;
-   
-   /**
-    * true if all tests have been successful.
-    */
-   public final boolean allTestsSucceeded;
-   
-   private static Logger log = LogManager.getLogger(InstanceSetEvaluation.class);
-   
-   final static List<InstanceTest> tests = new Vector<>();
-   
-   final StringBuffer messages = new StringBuffer(), errorMessages = new StringBuffer();
-
-   /**
-    * @param args unused
-    */
-   public static void main(String[] args) {
-      final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest");
-      System.out.println(ise.getMessages());
-      System.out.println("All tests succeeded:" + ise.allTestsSucceeded);
-   }
-
-   /**
-    * @return Individual failed test(s) error message(s).
-    */
-   public String getErrorMessages() {
-      return errorMessages.toString();
-   }
-   
-   /**
-    * @return Individual test's and aggregated results.
-    */
-   public String getMessages() {
-      return messages.toString();
-   }
-   
-   /**
-    * 
-    * @param xmlTestFileDir Directory containing XML instances to be processed.
-    */
-   public InstanceSetEvaluation(final String xmlTestFileDir) {
-      this.xmlTestFileDir = xmlTestFileDir;
-	   	   
-	  final File rootDirectory = new File(xmlTestFileDir);
-	  
-	  for (final File f: rootDirectory.listFiles(
-			  path -> path.getPath().endsWith(".xml"))) {
-		  readTestHeader(f);
-	  }
-    
-     tests.forEach(t -> messages.append(t + "\n"));      
-     tests.stream().filter(t -> !t.testSucceeded).forEach(t -> errorMessages.append(t + "\n"));      
-
-     allTestsSucceeded = tests.
-           stream().
-           map(t -> t.testSucceeded).
-           reduce((a, b) -> a && b).
-           get(); 
-
-	  int reachedPoints = 0, maxPoints = 0;
-	  
-	  for (final InstanceTest t: tests) {
-	     maxPoints += t.reachablePoints;
-        if (t.testSucceeded) {
-           reachedPoints += t.reachablePoints;
-        }
-	  }
-     messages.append(reachedPoints + " of " + maxPoints +
-           " points have been reached");
-   }
-
-    void readTestHeader(final File instanceFilename) {
-      
-      final SAXBuilder metainfoParser = new SAXBuilder(XMLReaders.NONVALIDATING);
-      try {
-         final Document doc = metainfoParser.build(instanceFilename);
-         
-         final XPathExpression<ProcessingInstruction> searchHeader = 
-               XPathFactory.instance().compile(
-                     "/processing-instruction('xmlTest')", 
-               Filters.processinginstruction());
-         final List<ProcessingInstruction> xmlTestList = 
-               searchHeader.evaluate(doc);
-         
-         switch (xmlTestList.size()) {
-         case 0:
-            log.info("No 'xmlTest PI found, possible dependency file");
-            break;
-         case 1:
-            tests.add(new InstanceTest(xmlTestList.get(0), xmlTestFileDir, instanceFilename));
-            break;
-            default:
-               log.error("Fatal: Found " + xmlTestList.size() +
-                     " <?xmltest ... ?> annotations in file '" + 
-                     instanceFilename + "'");
-               System.exit(1);
-         }        
-         
-      } catch (final JDOMException e) {
-         log.fatal("Document '" + instanceFilename.getPath() +
-               "' is invalid:", e);
-         System.exit(1);
-      } catch (final IOException e) {
-         log.fatal("Unable to open '" + instanceFilename.getPath() + 
-               "' for reading:", e);
-         System.exit(1);
-      }
-   }
-}
diff --git a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java b/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java
deleted file mode 100644
index f4f0262d5..000000000
--- a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package de.hdm_stuttgart.mi.sda1.exam.test.ignore;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Optional;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.jdom2.JDOMException;
-import org.jdom2.ProcessingInstruction;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.input.sax.XMLReaders;
-
-/**
- * Test and evaluate an individual XML instance.
- *
- */
-public class InstanceTest {
-
-   final SAXBuilder parser = new SAXBuilder(XMLReaders.XSDVALIDATING);
-
-   final File instanceFilename;
-
-   /**
-    * An examinee may reach this number of point. The value is being defined in
-    * the corresponding XML instance's PI like e.g.:
-    * 
-    * &lt;?xmlTest
-    points = "2" ... ?&gt;
-    *   
-    */
-   public final int reachablePoints;
-
-   /**
-    * Is this instance expected to be valid or not? The value is being defined in
-    * the corresponding XML instance's PI like e.g.:
-    * 
-    * &lt;?xmlTest expectedToBeValid= "false" ... ?&gt;
-    */
-   public final boolean expectedToBeValid;
-   /**
-    * Does the current instance test succeed?
-    */
-   public final boolean testSucceeded;
-
-   /**
-    * Error message in case of unexpected behavior e.g.
-    * when an invalid instance is supposed to be valid.
-    */
-   public final Optional<String> errMsg;
-
-   private static Logger log = LogManager.getLogger(InstanceTest.class);
-
-   @Override
-   public String toString() {
-      if (testSucceeded) {
-         return instanceFilename + ": " + reachablePoints + " point" + (1 == reachablePoints ? "" : "s") ;
-      } else {
-         return instanceFilename + ": " + errMsg.get() + "missing " + reachablePoints +" point(s)\n" +
-               "-----------------------------------------------";
-      }
-   }
-
-   /**
-    * Testing an individual instance to be either valid or invalid.
-    * 
-    * @param xmlTest The PI meta annotation header containing the expected
-    *        result, points etc.
-    * @param xmlTestFileDir The directory containing the XML instance files.
-    * @param xmlInstance The current instance to be evaluated.
-    */
-   public InstanceTest(final ProcessingInstruction xmlTest,
-         final String xmlTestFileDir, final File xmlInstance) {
-
-      this.instanceFilename = xmlInstance;
-
-      if (null == xmlTest.getPseudoAttributeValue("points")) {
-         log.fatal("Mandatory <?xmlTest points='...' ... ?> is missing in file '"
-               + xmlInstance + "'");
-         System.exit(1);
-      }
-      reachablePoints = Integer.parseInt(xmlTest.getPseudoAttributeValue("points"));
-
-      if (null == xmlTest.getPseudoAttributeValue("expectedToBeValid")) {
-         log.fatal("Mandatory <?xmlTest expectedToBeValid='true|false' ... ?> is missing in file '" + xmlInstance + "'");
-         System.exit(1);
-      }
-      expectedToBeValid = Boolean.parseBoolean(xmlTest.getPseudoAttributeValue("expectedToBeValid"));
-
-      final Optional<String> preconditionValidFilename;
-
-      boolean preconditionSucceeded = false;
-      String tmpPreconditionErrMsg = null;
-
-      if (null == xmlTest.getPseudoAttributeValue("preconditionValid")) {
-         preconditionValidFilename = Optional.empty();
-      } else {
-         preconditionValidFilename = Optional.of(xmlTestFileDir + File.separator + 
-               xmlTest.getPseudoAttributeValue("preconditionValid"));
-         try {
-            parser.build(preconditionValidFilename.get());
-            log.info("Precondition file '" + preconditionValidFilename.get() + "' is valid");
-            preconditionSucceeded = true;            
-         } catch (final JDOMException | IOException e) {
-            log.info("Precondition file '" + preconditionValidFilename.get() + "' is invalid or missing:", e);
-            tmpPreconditionErrMsg = "File '" + preconditionValidFilename.get() + "' is either invalid or missing";
-         }
-      }
-
-      if (!preconditionValidFilename.isPresent() || preconditionSucceeded) {
-         boolean tmpInstanceIsValid = false;
-         try {
-            parser.build(xmlInstance);
-            tmpInstanceIsValid = true;
-         } catch (final JDOMException | IOException e) {
-            log.info("Instance file '" + xmlInstance + "' is invalid:", e);
-         }
-         testSucceeded =  expectedToBeValid == tmpInstanceIsValid; 
-         if (testSucceeded) {
-            errMsg = Optional.empty();
-         } else if (expectedToBeValid) {
-            errMsg = Optional.of("\nInstance '" + xmlInstance +
-                  "' is expected to be valid!\n");
-         } else {
-            errMsg = Optional.of("\nInstance '" + xmlInstance +
-                  "' is expected to be invalid!\n");
-         }         
-      } else {
-         testSucceeded = false;
-         errMsg = Optional.of(tmpPreconditionErrMsg);
-
-      }
-   }
-}
diff --git a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java b/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
index b2f1cf106..cd69c964c 100644
--- a/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
+++ b/Klausuren/Sda1/SoSe2015/Exam/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
@@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sda1.scripts;
 import org.junit.Assert;
 import org.junit.Test;
 
-import de.hdm_stuttgart.mi.sda1.exam.test.ignore.InstanceSetEvaluation;
+import de.hdm_stuttgart.mi.sda1.exam.xsdmarking.InstanceSetEvaluation;
 
 /**
  * Unit test for an XML instance set.
@@ -15,10 +15,10 @@ public class SchemaTest {
     @Test
     public void testXmlInstanceSet() {
        
-       final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest");
-       
-       Assert.assertTrue(ise.getErrorMessages(), ise.allTestsSucceeded);
+       final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest", "Schema/scripts.xsd");
        
        System.out.println(ise.getMessages());
+
+       Assert.assertTrue(ise.getErrorMessages(), ise.allTestsSucceeded);
     }
 }
diff --git a/Klausuren/Sda1/SoSe2015/Exam_solve/pom.xml b/Klausuren/Sda1/SoSe2015/Exam_solve/pom.xml
index 25d221391..5affa5671 100644
--- a/Klausuren/Sda1/SoSe2015/Exam_solve/pom.xml
+++ b/Klausuren/Sda1/SoSe2015/Exam_solve/pom.xml
@@ -16,6 +16,13 @@
 	</properties>
 
 	<dependencies>
+
+		<dependency>
+			<groupId>org.opengis.cite.xerces</groupId>
+			<artifactId>xercesImpl-xsd11</artifactId>
+			<version>2.12-beta-r1667115</version>
+		</dependency>
+
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
@@ -46,12 +53,19 @@
 			<artifactId>log4j-api</artifactId>
 			<version>2.1</version>
 		</dependency>
+
 		<dependency>
 			<groupId>org.apache.logging.log4j</groupId>
 			<artifactId>log4j-core</artifactId>
 			<version>2.1</version>
 		</dependency>
 
+		<dependency>
+			<groupId>de.hdm_stuttgart.mi.exam</groupId>
+			<artifactId>unitmarking</artifactId>
+			<version>0.9</version>
+		</dependency>
+
 	</dependencies>
 
 	<build>
diff --git a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java b/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
deleted file mode 100644
index 4f36858fe..000000000
--- a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceSetEvaluation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package de.hdm_stuttgart.mi.sda1.exam.test.ignore;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.jdom2.Document;
-import org.jdom2.JDOMException;
-import org.jdom2.ProcessingInstruction;
-import org.jdom2.filter.Filters;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.input.sax.XMLReaders;
-import org.jdom2.xpath.XPathExpression;
-import org.jdom2.xpath.XPathFactory;
-
-/**
- * Evaluate a given set of XML document instances
- *
- */
-public class InstanceSetEvaluation {
-   
-   /**
-    * Base directory containing xml test file instances.
-    */
-   public final String xmlTestFileDir;
-   
-   /**
-    * true if all tests have been successful.
-    */
-   public final boolean allTestsSucceeded;
-   
-   private static Logger log = LogManager.getLogger(InstanceSetEvaluation.class);
-   
-   final static List<InstanceTest> tests = new Vector<>();
-   
-   final StringBuffer messages = new StringBuffer(), errorMessages = new StringBuffer();
-
-   /**
-    * @param args unused
-    */
-   public static void main(String[] args) {
-      final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest");
-      System.out.println(ise.getMessages());
-      System.out.println("All tests succeeded:" + ise.allTestsSucceeded);
-   }
-
-   /**
-    * @return Individual failed test(s) error message(s).
-    */
-   public String getErrorMessages() {
-      return errorMessages.toString();
-   }
-   
-   /**
-    * @return Individual test's and aggregated results.
-    */
-   public String getMessages() {
-      return messages.toString();
-   }
-   
-   /**
-    * 
-    * @param xmlTestFileDir Directory containing XML instances to be processed.
-    */
-   public InstanceSetEvaluation(final String xmlTestFileDir) {
-      this.xmlTestFileDir = xmlTestFileDir;
-	   	   
-	  final File rootDirectory = new File(xmlTestFileDir);
-	  
-	  for (final File f: rootDirectory.listFiles(
-			  path -> path.getPath().endsWith(".xml"))) {
-		  readTestHeader(f);
-	  }
-    
-     tests.forEach(t -> messages.append(t + "\n"));      
-     tests.stream().filter(t -> !t.testSucceeded).forEach(t -> errorMessages.append(t + "\n"));      
-
-     allTestsSucceeded = tests.
-           stream().
-           map(t -> t.testSucceeded).
-           reduce((a, b) -> a && b).
-           get(); 
-
-	  int reachedPoints = 0, maxPoints = 0;
-	  
-	  for (final InstanceTest t: tests) {
-	     maxPoints += t.reachablePoints;
-        if (t.testSucceeded) {
-           reachedPoints += t.reachablePoints;
-        }
-	  }
-     messages.append(reachedPoints + " of " + maxPoints +
-           " points have been reached");
-   }
-
-    void readTestHeader(final File instanceFilename) {
-      
-      final SAXBuilder metainfoParser = new SAXBuilder(XMLReaders.NONVALIDATING);
-      try {
-         final Document doc = metainfoParser.build(instanceFilename);
-         
-         final XPathExpression<ProcessingInstruction> searchHeader = 
-               XPathFactory.instance().compile(
-                     "/processing-instruction('xmlTest')", 
-               Filters.processinginstruction());
-         final List<ProcessingInstruction> xmlTestList = 
-               searchHeader.evaluate(doc);
-         
-         switch (xmlTestList.size()) {
-         case 0:
-            log.info("No 'xmlTest PI found, possible dependency file");
-            break;
-         case 1:
-            tests.add(new InstanceTest(xmlTestList.get(0), xmlTestFileDir, instanceFilename));
-            break;
-            default:
-               log.error("Fatal: Found " + xmlTestList.size() +
-                     " <?xmltest ... ?> annotations in file '" + 
-                     instanceFilename + "'");
-               System.exit(1);
-         }        
-         
-      } catch (final JDOMException e) {
-         log.fatal("Document '" + instanceFilename.getPath() +
-               "' is invalid:", e);
-         System.exit(1);
-      } catch (final IOException e) {
-         log.fatal("Unable to open '" + instanceFilename.getPath() + 
-               "' for reading:", e);
-         System.exit(1);
-      }
-   }
-}
diff --git a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java b/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java
deleted file mode 100644
index f4f0262d5..000000000
--- a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/exam/test/ignore/InstanceTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package de.hdm_stuttgart.mi.sda1.exam.test.ignore;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Optional;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.jdom2.JDOMException;
-import org.jdom2.ProcessingInstruction;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.input.sax.XMLReaders;
-
-/**
- * Test and evaluate an individual XML instance.
- *
- */
-public class InstanceTest {
-
-   final SAXBuilder parser = new SAXBuilder(XMLReaders.XSDVALIDATING);
-
-   final File instanceFilename;
-
-   /**
-    * An examinee may reach this number of point. The value is being defined in
-    * the corresponding XML instance's PI like e.g.:
-    * 
-    * &lt;?xmlTest
-    points = "2" ... ?&gt;
-    *   
-    */
-   public final int reachablePoints;
-
-   /**
-    * Is this instance expected to be valid or not? The value is being defined in
-    * the corresponding XML instance's PI like e.g.:
-    * 
-    * &lt;?xmlTest expectedToBeValid= "false" ... ?&gt;
-    */
-   public final boolean expectedToBeValid;
-   /**
-    * Does the current instance test succeed?
-    */
-   public final boolean testSucceeded;
-
-   /**
-    * Error message in case of unexpected behavior e.g.
-    * when an invalid instance is supposed to be valid.
-    */
-   public final Optional<String> errMsg;
-
-   private static Logger log = LogManager.getLogger(InstanceTest.class);
-
-   @Override
-   public String toString() {
-      if (testSucceeded) {
-         return instanceFilename + ": " + reachablePoints + " point" + (1 == reachablePoints ? "" : "s") ;
-      } else {
-         return instanceFilename + ": " + errMsg.get() + "missing " + reachablePoints +" point(s)\n" +
-               "-----------------------------------------------";
-      }
-   }
-
-   /**
-    * Testing an individual instance to be either valid or invalid.
-    * 
-    * @param xmlTest The PI meta annotation header containing the expected
-    *        result, points etc.
-    * @param xmlTestFileDir The directory containing the XML instance files.
-    * @param xmlInstance The current instance to be evaluated.
-    */
-   public InstanceTest(final ProcessingInstruction xmlTest,
-         final String xmlTestFileDir, final File xmlInstance) {
-
-      this.instanceFilename = xmlInstance;
-
-      if (null == xmlTest.getPseudoAttributeValue("points")) {
-         log.fatal("Mandatory <?xmlTest points='...' ... ?> is missing in file '"
-               + xmlInstance + "'");
-         System.exit(1);
-      }
-      reachablePoints = Integer.parseInt(xmlTest.getPseudoAttributeValue("points"));
-
-      if (null == xmlTest.getPseudoAttributeValue("expectedToBeValid")) {
-         log.fatal("Mandatory <?xmlTest expectedToBeValid='true|false' ... ?> is missing in file '" + xmlInstance + "'");
-         System.exit(1);
-      }
-      expectedToBeValid = Boolean.parseBoolean(xmlTest.getPseudoAttributeValue("expectedToBeValid"));
-
-      final Optional<String> preconditionValidFilename;
-
-      boolean preconditionSucceeded = false;
-      String tmpPreconditionErrMsg = null;
-
-      if (null == xmlTest.getPseudoAttributeValue("preconditionValid")) {
-         preconditionValidFilename = Optional.empty();
-      } else {
-         preconditionValidFilename = Optional.of(xmlTestFileDir + File.separator + 
-               xmlTest.getPseudoAttributeValue("preconditionValid"));
-         try {
-            parser.build(preconditionValidFilename.get());
-            log.info("Precondition file '" + preconditionValidFilename.get() + "' is valid");
-            preconditionSucceeded = true;            
-         } catch (final JDOMException | IOException e) {
-            log.info("Precondition file '" + preconditionValidFilename.get() + "' is invalid or missing:", e);
-            tmpPreconditionErrMsg = "File '" + preconditionValidFilename.get() + "' is either invalid or missing";
-         }
-      }
-
-      if (!preconditionValidFilename.isPresent() || preconditionSucceeded) {
-         boolean tmpInstanceIsValid = false;
-         try {
-            parser.build(xmlInstance);
-            tmpInstanceIsValid = true;
-         } catch (final JDOMException | IOException e) {
-            log.info("Instance file '" + xmlInstance + "' is invalid:", e);
-         }
-         testSucceeded =  expectedToBeValid == tmpInstanceIsValid; 
-         if (testSucceeded) {
-            errMsg = Optional.empty();
-         } else if (expectedToBeValid) {
-            errMsg = Optional.of("\nInstance '" + xmlInstance +
-                  "' is expected to be valid!\n");
-         } else {
-            errMsg = Optional.of("\nInstance '" + xmlInstance +
-                  "' is expected to be invalid!\n");
-         }         
-      } else {
-         testSucceeded = false;
-         errMsg = Optional.of(tmpPreconditionErrMsg);
-
-      }
-   }
-}
diff --git a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java b/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
index b2f1cf106..cd69c964c 100644
--- a/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
+++ b/Klausuren/Sda1/SoSe2015/Exam_solve/src/test/java/de/hdm_stuttgart/mi/sda1/scripts/SchemaTest.java
@@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sda1.scripts;
 import org.junit.Assert;
 import org.junit.Test;
 
-import de.hdm_stuttgart.mi.sda1.exam.test.ignore.InstanceSetEvaluation;
+import de.hdm_stuttgart.mi.sda1.exam.xsdmarking.InstanceSetEvaluation;
 
 /**
  * Unit test for an XML instance set.
@@ -15,10 +15,10 @@ public class SchemaTest {
     @Test
     public void testXmlInstanceSet() {
        
-       final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest");
-       
-       Assert.assertTrue(ise.getErrorMessages(), ise.allTestsSucceeded);
+       final InstanceSetEvaluation ise = new InstanceSetEvaluation("SchemaTest", "Schema/scripts.xsd");
        
        System.out.println(ise.getMessages());
+
+       Assert.assertTrue(ise.getErrorMessages(), ise.allTestsSucceeded);
     }
 }
-- 
GitLab