aboutsummaryrefslogtreecommitdiff
path: root/dummy
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-08 21:16:31 +0200
committerAdrian Kummerländer2014-05-08 21:16:31 +0200
commit947603b5d7f05053a93a3cfe257fa7ab11304a90 (patch)
tree58ed6c641ac0e9f36b0ca6e8d347ab0308e81a51 /dummy
parent209f0b2fd9310f503d4599b12483fddc04d1f7dd (diff)
downloadInputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.gz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.bz2
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.lz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.xz
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.tar.zst
InputXSLT-947603b5d7f05053a93a3cfe257fa7ab11304a90.zip
Implemented black-box test cases
* the directories below "./test" contain test cases ** "transformation.xsl" and the expected result as "reference.xml" ** tests are performed by "check.sh" *** returns diff on error * this system enables simple verification of external function results ** way simpler than C++ unit tests would be in this scenario * expanded cmake instructions to automatically execute the test cases * old example transformation was removed
Diffstat (limited to 'dummy')
-rw-r--r--dummy/in.xml2
-rw-r--r--dummy/test.txt7
-rw-r--r--dummy/transform.xsl83
3 files changed, 0 insertions, 92 deletions
diff --git a/dummy/in.xml b/dummy/in.xml
deleted file mode 100644
index 6abcacd..0000000
--- a/dummy/in.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<dummy />
diff --git a/dummy/test.txt b/dummy/test.txt
deleted file mode 100644
index 046a6ef..0000000
--- a/dummy/test.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<tester>
- <eintrag>Hello 1</eintrag>
- <eintrag>Hello 2</eintrag>
- <eintrag>Hello 3</eintrag>
- <eintrag>Hello 4</eintrag>
-</tester>
diff --git a/dummy/transform.xsl b/dummy/transform.xsl
deleted file mode 100644
index 5e172b6..0000000
--- a/dummy/transform.xsl
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:InputXSLT="function.inputxslt.application"
- exclude-result-prefixes="InputXSLT"
->
-
-<xsl:output
- method="xml"
- doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
- doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- omit-xml-declaration="yes"
- encoding="UTF-8"
- indent="yes"
-/>
-
-<xsl:param name="test"/>
-
-<xsl:template match="/">
-<html>
- <head>
- </head>
- <body>
- <div id="parameter">
- Parameter "test" contains value "<xsl:value-of select="$test"/>"
- </div>
-
- <div id="raw">
- <xsl:variable name="testFile" select="InputXSLT:read-file('test.txt')"/>
- <xsl:choose>
- <xsl:when test="$testFile/self::error">
- Could not read text file.
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$testFile[@name='test.txt']"/>
- </xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div id="xml">
- <xsl:variable name="testXml" select="InputXSLT:read-xml-file('test.txt')"/>
- <xsl:choose>
- <xsl:when test="$testXml/self::error">
- Could not read XML file.
- </xsl:when>
- <xsl:otherwise>
- <ul id="xml">
- <xsl:for-each select="$testXml[@name='test.txt']/tester/eintrag">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </ul>
- </xsl:otherwise>
- </xsl:choose>
- </div>
-
- <div id="filelists">
- <xsl:variable name="fileList" select="InputXSLT:read-directory('../')"/>
- <xsl:choose>
- <xsl:when test="$fileList/self::error">
- Could not read directory.
- </xsl:when>
- <xsl:otherwise>
- <ul id="filelist1">
- <xsl:for-each select="$fileList[@type='file']">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </ul>
- <ul id="filelist2">
- <xsl:for-each select="$fileList[@type='directory']">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </ul>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </body>
-</html>
-</xsl:template>
-
-</xsl:stylesheet>
-
-