Commit 5931a140 authored by Dr. Martin Goik's avatar Dr. Martin Goik

MISSING REPO

parent e234a531
......@@ -9,12 +9,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm_stuttgart.mi.sda1.exam</groupId>
<artifactId>jdomtable</artifactId>
<artifactId>jdomtable_exercise</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jdomtable</name>
<name>jdomtable_exercise</name>
<url>http://www.mi.hdm-stuttgart.de/freedocs</url>
......@@ -22,19 +22,26 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>hdm-mi-internal-maven-repo</id>
<url>https://maven.mi.hdm-stuttgart.de/artifacts</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
</dependency>
<dependency>
......@@ -57,8 +64,8 @@
<dependency>
<groupId>de.hdm_stuttgart.mi.exam</groupId>
<artifactId>examtesting</artifactId>
<version>1.0</version>
<artifactId>unitmarking</artifactId>
<version>0.9</version>
</dependency>
</dependencies>
......
package de.hdm_stuttgart.mi.sda1.jdom.background;
import java.io.IOException;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import de.hdm_stuttgart.mi.exam.DomFilter;
/**
* Handling address book data.
......@@ -18,13 +13,13 @@ public class RowHighlighting implements DomFilter {
/**
* Read XML file data and create corresponding HTML output.
*
* @param xmlFilename The XML input file containing address book data.
* @throws JDOMException Internal error.
* @throws IOException IO related errors.
* @param addressbook The XML input file containing address book data.
*/
@Override
public Document process(Document addressbook) {
public Document process(final Document addressbook) {
// TODO: complete my implementation!
return new Document(new Element("table"));
}
}
\ No newline at end of file
package de.hdm_stuttgart.mi.sda1.jdom.background;
import java.io.IOException;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import de.hdm_stuttgart.mi.exam.DomFilter;
/**
* Address book data.
......@@ -15,13 +11,13 @@ import de.hdm_stuttgart.mi.exam.DomFilter;
public class TableRowColumnSwitch implements DomFilter {
/**
* Reading XML input an create corresponding HTML output
* @param xmlFilename XML file input data
* @throws JDOMException Internal errors
* @throws IOException IO related errors.
* @param addressbook XML input data
*/
@Override
public Document process(Document addressbook) {
// TODO: complete my implementation!
return new Document(new Element("table"));
// TODO: complete my implementation!
return new Document(new Element("table"));
}
}
\ No newline at end of file
package de.hdm_stuttgart.sda1.domhtml.test;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomAssert;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilterTest;
import org.junit.Test;
import de.hdm_stuttgart.de.mi.exam.test.dom.DomFilterTest;
import de.hdm_stuttgart.de.mi.exam.test.sax.DomAssert;
import de.hdm_stuttgart.mi.sda1.jdom.background.RowHighlighting;
/**
......
package de.hdm_stuttgart.sda1.domhtml.test;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomAssert;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilterTest;
import org.junit.Test;
import de.hdm_stuttgart.de.mi.exam.test.dom.DomFilterTest;
import de.hdm_stuttgart.de.mi.exam.test.sax.DomAssert;
import de.hdm_stuttgart.mi.sda1.jdom.background.TableRowColumnSwitch;
/**
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<description>Test execution requires 'mvn install' in the maven sub project
'GoikLectures/ws/eclipse/ExamTesting' within
https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures
to resolve the 'examtesting' dependency.</description>
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm_stuttgart.mi.sda1.exam</groupId>
<artifactId>jdomtable_solution</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jdomtable_solution</name>
<url>http://www.mi.hdm-stuttgart.de/freedocs</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>hdm-mi-internal-maven-repo</id>
<url>https://maven.mi.hdm-stuttgart.de/artifacts</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<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>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<configuration />
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>de.hdm_stuttgart.de.saxstandard.App</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -3,13 +3,13 @@ package de.hdm_stuttgart.mi.sda1.jdom.background;
import java.io.IOException;
import java.util.List;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
import de.hdm_stuttgart.mi.exam.DomFilter;
/**
* Handling address book data.
......@@ -20,12 +20,12 @@ public class RowHighlighting implements DomFilter {
/**
* Read XML file data and create corresponding HTML output.
*
* @param xmlFilename The XML input file containing address book data.
* @param addressbook The XML input file containing address book data.
* @throws JDOMException Internal error.
* @throws IOException IO related errors.
*/
@Override
public Document process(Document addressbook) {
public Document process(final Document addressbook) {
// Create <table> skeleton:
// <table>
......
......@@ -3,14 +3,13 @@ package de.hdm_stuttgart.mi.sda1.jdom.background;
import java.io.IOException;
import java.util.List;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
import de.hdm_stuttgart.mi.exam.DomFilter;
/**
* Address book data.
*
......@@ -18,7 +17,7 @@ import de.hdm_stuttgart.mi.exam.DomFilter;
public class TableRowColumnSwitch implements DomFilter {
/**
* Reading XML input an create corresponding HTML output
* @param xmlFilename XML file input data
* @param addressbook XML input data
* @throws JDOMException Internal errors
* @throws IOException IO related errors.
*/
......
package de.hdm_stuttgart.sda1.domhtml.test;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomAssert;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilterTest;
import org.junit.Test;
import de.hdm_stuttgart.mi.sda1.jdom.background.RowHighlighting;
/**
* Unit testing DOM HTML output
*/
@SuppressWarnings("javadoc")
public class TestRowHighlighting extends DomFilterTest {
static {
init("src/main/resources/persons.xml", new RowHighlighting(), ".highlight.html");
}
@Test public void testNumberOfColumnHeaders() {
DomAssert.assertNumberOfNodes(
"Two column headers expected",
xmlRootElement,
"tr", 4);
}
@Test public void testColumnHeader_Name() {
DomAssert.assertSingleNodeContent("Checking first <th>",
xmlRootElement,
"tr/th[1]",
"th", "Name");
}
@Test public void testColumnHeader_Birthday() {
DomAssert.assertSingleNodeContent("Checking second <th>",
xmlRootElement,
"tr/th[2]",
"th", "Birthday");
}
@Test public void testNumberOfHeaderRows() {
DomAssert.assertNumberOfNodes(
"1 <tr> element containing <th> expected",
xmlRootElement,
"tr[th]", 1);
}
@Test public void testNumberOfDataRows() {
DomAssert.assertNumberOfNodes(
"3 <tr> element containing <td> expected",
xmlRootElement,
"tr[td]", 3);
}
@Test public void testNumberOfHighlightedRows() {
DomAssert.assertNumberOfNodes(
"2 <tr style='background-color: #FFFF88;> elements expected",
xmlRootElement,
"tr[@style='background-color: #FFFF88;']", 2);
}
@Test public void testRowWithoutHighlighing() {
DomAssert.assertNumberOfNodes(
"Middle data row shall not contain highlighting",
xmlRootElement,
"tr[not(@style) and position() = 3]", 1);
}
@Test public void testLastRecord_Name() {
DomAssert.assertSingleNodeContent("Last record must start with <td>Jim Smith</td>",
xmlRootElement,
"tr[last()]/td[1]",
"td", "Jim Smith");
}
@Test public void testLastRecord_Date() {
DomAssert.assertSingleNodeContent("Last record must end with <td>1981-04-13</td>",
xmlRootElement,
"tr[last()]/td[2]",
"td", "1981-04-13");
}
}
\ No newline at end of file
package de.hdm_stuttgart.sda1.domhtml.test;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomAssert;
import de.hdm_stuttgart.mi.unitmarking.jdom.DomFilterTest;
import org.junit.Test;
import de.hdm_stuttgart.mi.sda1.jdom.background.TableRowColumnSwitch;
/**
* Unit testing dom HTML output
*/
@SuppressWarnings("javadoc")
public class TestTableRowColumnSwitch extends DomFilterTest {
static {
init("src/main/resources/persons.xml", new TableRowColumnSwitch(), ".switch.html");
}
@Test public void testNumberOfColumnHeaders() {
DomAssert.assertNumberOfNodes(
"Two <tr> expected",
xmlRootElement,
"tr", 2);
}
@Test public void testColumnHeader_Name() {
DomAssert.assertSingleNodeContent("Checking 'Name' <th>",
xmlRootElement,
"tr[1]/th",
"th", "Name");
}
@Test public void testColumnHeader_Birthday() {
DomAssert.assertSingleNodeContent("Checking 'Birthday' <th>",
xmlRootElement,
"tr[2]/th",
"th", "Birthday");
}
@Test public void testNumberOfTd() {
DomAssert.assertNumberOfNodes(
"6 <td> in two groups of 3 expected",
xmlRootElement,
"tr[1]/td[0 < position() and position() < 4]|tr[2]/td[0 < position() and position() < 4]", 6);
}
@Test public void testNameFirstDataRecord() {
DomAssert.assertSingleNodeContent("Checking Name of first data record",
xmlRootElement,
"tr[1]/*[2]",
"td", "Scott Geoffrey");
}
@Test public void testBirthdayLastDataRecord() {
DomAssert.assertSingleNodeContent("Checking birthday of last data record",
xmlRootElement,
"tr[2]/*[last()]",
"td", "1981-04-13");
}
}
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<description>Test execution requires 'mvn install' in the maven sub project
'GoikLectures/ws/eclipse/ExamTesting' within
https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures
to resolve the 'examtesting' dependency.</description>
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm_stuttgart.mi.sda1.exam</groupId>
<artifactId>jdomtable</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jdomtable</name>
<url>http://www.mi.hdm-stuttgart.de/freedocs</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<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>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<configuration />
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>de.hdm_stuttgart.de.saxstandard.App</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<table>
<tr>
<th>Name</th>
<th>Birthday</th>
</tr>
<tr style="background-color: #FFFF88;">
<td>Scott Geoffrey</td>
<td>1942-07-22</td>
</tr>
<tr>
<td>Julia Duncan</td>
<td>2001-11-07</td>
</tr>
<tr style="background-color: #FFFF88;">
<td>Jim Smith</td>
<td>1981-04-13</td>
</tr>
</table>
<?xml version="1.0" encoding="UTF-8"?>
<table>
<tr>
<th>Name</th>
<td>Scott Geoffrey</td>
<td>Julia Duncan</td>
<td>Jim Smith</td>
</tr>
<tr>
<th>Birthday</th>
<td>1942-07-22</td>
<td>2001-11-07</td>
<td>1981-04-13</td>
</tr>
</table>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<description>Test execution requires 'mvn install' in the maven sub project
'GoikLectures/ws/eclipse/ExamTesting' within
https://gitlab.mi.hdm-stuttgart.de/goik/GoikLectures
to resolve the 'examtesting' dependency.</description>
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm_stuttgart.mi.sda1.exam</groupId>
<artifactId>jdomtable_solution</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jdomtable_solution</name>
<url>http://www.mi.hdm-stuttgart.de/freedocs</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<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>examtesting</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>