Commit 4addeedb authored by Dr. Martin Goik's avatar Dr. Martin Goik

E-examination SDA1 / summer 2019

parent 2e1a60f7
This diff is collapsed.
/.classpath
/.project
/.settings
/.idea
/*.iml
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<!-- TODO: define required elements -->
</xs:schema>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
<category id="hardware">Tools, DIY</category>
<category id="lifestyle">Lifestyle products</category>
</categories>
<articles>
<article orderNo="232434">
<name>Super 3D Tin Lunch Box </name>
<cat>lifestyle</cat>
<cat>hardware</cat>
<img src="232434_1" type="png"/>
</article>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Various brands and flavours on offer.</description>
</article>
</articles>
</catalog>
\ No newline at end of file
DROP TABLE IF EXISTS Foo;
CREATE TABLE ... /* TODO: Create schema closely resembling catalog.xsd integrity rules */
/* sample data below may be used for checking your schema's consistence */
/* Inserting categories */
INSERT INTO Category
VALUES ('food', 'Food and drinking');
INSERT INTO Category
VALUES ('hardware', 'Tools, DIY');
INSERT INTO Category
VALUES ('lifestyle', 'Lifestyle products');
/* Inserting articles */
INSERT INTO Article
VALUES (232434, 'Super 3D Tin Lunch Box', NULL, '232434_1', 'png');
INSERT INTO Article
VALUES (544343, 'Monthly beer subscription box', 'Various brands and flavours on offer.', NULL, NULL);
/* Relating categories and articles */
INSERT INTO Category2Article
VALUES ('lifestyle', 232434);
INSERT INTO Category2Article
VALUES ('hardware', 232434);
INSERT INTO Category2Article
VALUES ('food', 544343);
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories/>
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories/>
<articles/>
<articles/> <!-- Expected error: More than one <articles > element -->
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0100validMinimum.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories/>
<categories/> <!-- Expected error: More than one <categories> element -->
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0100validMinimum.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories/>
<!-- Expected error: <articles > absent -->
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0100validMinimum.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<!-- Expected error: <categories> absent -->
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0100validMinimum.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="x">X category</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id=""> <!-- Expected error: Attribue id value must not be empty -->
X category</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0110validSingleCategory.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category> <!-- Expected error: Missing id attribute -->
X category</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0110validSingleCategory.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="red green"> <!-- Expected error: Attribute must not contain whitespace characters -->
X category</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0110validSingleCategory.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="x">X category</category>
<category id="y">Y category</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="x">X category</category>
<category id="x"> <!-- Expected error: Duplicate id attribute value -->
X category, identical id value</category>
</categories>
<articles/>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0120validMultiCategory.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article> <!-- Expected error: Missing orderNo attribute -->
<name>Monthly beer subscription box</name>
<cat>food</cat>
</article>
</articles>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0150validMinimumArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="0"> <!-- Expected error: Positive orderNo attribute value required -->
<name>Monthly beer subscription box</name>
<cat>food</cat>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0150validMinimumArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="-123"> <!-- Expected error: Negative orderNo attribute value-->
<name>Monthly beer subscription box</name>
<cat>food</cat>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0150validMinimumArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Enjoy your party!</description>
<img src="box" type="svg"/>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Enjoy your party!</description>
<description>Once more ... <!-- Expected error: Duplicate <description> -->
</description>
<img src="box" type="png"/>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0160validFullArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Enjoy your party!</description>
<img type="png"/> <!-- Expected error: Missing src attribute -->
</article>
</articles>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0160validFullArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Enjoy your party!</description>
<img src="box"/> <!-- Expected error: Missing type attribute -->
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0160validFullArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
</categories>
<articles>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Enjoy your party!</description>
<img src="box" type="ico"/> <!-- Expected error: Invalid image type "ico" -->
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0160validFullArticle.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
<category id="hardware">Tools, DIY</category>
<category id="lifestyle">Lifestyle products</category>
</categories>
<articles>
<article orderNo="232434">
<name>Super 3D Tin Lunch Box </name>
<cat>bogus</cat> <!-- Expected error: Reference to inexistent category id "bogus" -->
</article>
</articles>
</catalog>
<?xmlTest
points = "2"
expectedToBeValid = "false"
preconditionValid = "0200validTwoArticles.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
<category id="hardware">Tools, DIY</category>
<category id="lifestyle">Lifestyle products</category>
</categories>
<articles>
<article orderNo="232434">
<name>Super 3D Tin Lunch Box </name>
<cat>food</cat>
<cat>hardware</cat>
<cat>food</cat> <!-- Expected error: Duplicate category reference "food" -->
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0200validTwoArticles.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
<category id="hardware">Tools, DIY</category>
<category id="lifestyle">Lifestyle products</category>
</categories>
<articles>
<article orderNo="232434">
<name>Super 3D Tin Lunch Box </name>
<!-- Expected error: Missing <cat ...> reference -->
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "false"
preconditionValid = "0200validTwoArticles.xml"
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/catalog.xsd" >
<categories>
<category id="food">Food and drinking</category>
<category id="hardware">Tools, DIY</category>
<category id="lifestyle">Lifestyle products</category>
</categories>
<articles>
<article orderNo="232434">
<name>Super 3D Tin Lunch Box </name>
<cat>lifestyle</cat>
<cat>hardware</cat>
<img src="232434_1" type="png"/>
</article>
<article orderNo="544343">
<name>Monthly beer subscription box</name>
<cat>food</cat>
<description>Various brands and flavours on offer.</description>
</article>
</articles>
</catalog>
<?xmlTest
points = "1"
expectedToBeValid = "true"
?>
\ 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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm_stuttgart.mi.sda1</groupId>
<artifactId>sda1_summer2019_exam</artifactId>
<version>0.9</version>
<packaging>jar</packaging>
<name>sda1_summer2019_exam</name>
<url>https://freedocs.mi.hdm-stuttgart.de/sd1_sect_mavenCli.html</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<oxygenxml.version>21.1.0.0</oxygenxml.version>
</properties>
<repositories>
<repository>
<id>hdm-mi-internal-maven-repo</id>
<url>https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</url>
</repository>
<repository>
<id>oxygenxml-repo</id>
<url>https://maven.mi.hdm-stuttgart.de/nexus/repository/oxygen</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-patched-xerces</artifactId>
<version>${oxygenxml.version}</version>
</dependency>
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>${oxygenxml.version}</version>
</dependency>
<!-- Still needed to keep oxygenxml happy using legacy logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.rackspace.eclipse.webtools.sourceediting</groupId>
<artifactId>org.eclipse.wst.xml.xpath2.processor</artifactId>
<version>2.1.100</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>