Skip to content

Commit

Permalink
add regression test for works, closes #169
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Jul 10, 2018
1 parent 2fd2998 commit 3b0b085
Show file tree
Hide file tree
Showing 8 changed files with 2,707 additions and 7 deletions.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<target name="test">
<description>Run the regression test, i.e. diffing HTML pages against expected results</description>
<regressiontest doctype="works"/>
<regressiontest doctype="letters"/>
<regressiontest doctype="persons"/>
<regressiontest doctype="orgs"/>
Expand Down
12 changes: 5 additions & 7 deletions modules/query.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ declare function query:title($key as xs:string) as xs:string {
:)
declare function query:get-authorID($doc as document-node()?) as xs:string {
let $author-element := query:get-author-element($doc)[1]
let $id := $author-element/@key | $author-element/@dbkey
return
if(exists($doc)) then
if(config:is-diary($doc/tei:ab/@xml:id)) then 'A002068' (: Diverse Sonderbehandlungen fürs Tagebuch :)
else if($author-element/@key) then $author-element/@key/string()
else if($author-element/@dbkey) then $author-element/@dbkey/string()
else config:get-option('anonymusID')
if(exists($doc) and $id) then string($id)
else if(exists($doc)) then config:get-option('anonymusID')
else ''
};

Expand All @@ -69,9 +67,9 @@ declare function query:get-authorName($doc as document-node()?) as xs:string {
};

declare function query:get-author-element($doc as document-node()?) as element()* {
if(config:is-diary($doc/tei:ab/@xml:id)) then <tei:author key="A002068">Weber, Carl Maria von</tei:author>
if(config:is-diary($doc/tei:ab/@xml:id)) then <tei:author key="A002068">Weber, Carl Maria von</tei:author> (: Sonderbehandlung fürs Tagebuch :)
else (
$doc//mei:titleStmt/mei:respStmt/mei:persName[@role = ('cmp', 'aut', 'lbt')] |
$doc//mei:fileDesc/mei:titleStmt/mei:respStmt/mei:persName[@role = ('cmp', 'aut', 'lbt')] |
$doc//tei:fileDesc/tei:titleStmt/tei:author
)
};
Expand Down
543 changes: 543 additions & 0 deletions testing/expected-results/works/A020003.html

Large diffs are not rendered by default.

540 changes: 540 additions & 0 deletions testing/expected-results/works/A020053.html

Large diffs are not rendered by default.

530 changes: 530 additions & 0 deletions testing/expected-results/works/A020543.html

Large diffs are not rendered by default.

540 changes: 540 additions & 0 deletions testing/expected-results/works/A020656.html

Large diffs are not rendered by default.

543 changes: 543 additions & 0 deletions testing/expected-results/works/A020674.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions testing/urls/works.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
http://localhost:8080/exist/apps/WeGA-WebApp/A020543.html
http://localhost:8080/exist/apps/WeGA-WebApp/A020656.html
http://localhost:8080/exist/apps/WeGA-WebApp/A020003.html
http://localhost:8080/exist/apps/WeGA-WebApp/A020053.html
http://localhost:8080/exist/apps/WeGA-WebApp/A020674.html

0 comments on commit 3b0b085

Please sign in to comment.