Skip to content
Snippets Groups Projects
Commit 9de02c99 authored by Michelle Weidling's avatar Michelle Weidling :blowfish:
Browse files

Merge branch 'develop' into feature/#155-add-links-to-licenses

parents 0636ac2c 2b93ac31
No related branches found
No related tags found
2 merge requests!142Merge branch 'develop' into 'main',!134Feature/#155 add links to licenses
......@@ -5,12 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [5.8.0] - 2021-04-14
## [5.9.0] - 2021-04-14
### Added
- the license ID for manifests now contains a link to the legal code of the license.
## [5.8.0] - 2021-04-15
### Added
- temporarily added the end points "/http-403", "/http-404", "/http-500", "/http-503" for testing TIDO's behavior when getting these status codes.
## [5.7.1] - 2021-04-13
### Fixed
......
......@@ -17,6 +17,10 @@ body {
font-size: 133%;
text-align: center; }
.body {
text-align: right;
width: 100%; }
.catchwords {
color: #9D205E; }
......
xquery version "3.1";
(:~
: This module provides some test end points that simply return HTTP headers
: with different status codes.
:
: @author Michelle Weidling
: :)
module namespace head="http://ahikar.sub.uni-goettingen.de/ns/http-headers";
declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";
import module namespace rest="http://exquery.org/ns/restxq";
declare
%rest:GET
%rest:HEAD
%rest:path("/http-403")
%output:method("json")
function head:http-403()
as item()+ {
<rest:response>
<http:response xmlns:http="http://expath.org/ns/http-client" status="403">
<http:header name="Access-Control-Allow-Origin" value="*"/>
</http:response>
</rest:response>
};
declare
%rest:GET
%rest:HEAD
%rest:path("/http-404")
%output:method("json")
function head:http-404()
as item()+ {
<rest:response>
<http:response xmlns:http="http://expath.org/ns/http-client" status="404">
<http:header name="Access-Control-Allow-Origin" value="*"/>
</http:response>
</rest:response>
};
declare
%rest:GET
%rest:HEAD
%rest:path("/http-500")
%output:method("json")
function head:http-500()
as item()+ {
<rest:response>
<http:response xmlns:http="http://expath.org/ns/http-client" status="500">
<http:header name="Access-Control-Allow-Origin" value="*"/>
</http:response>
</rest:response>
};
declare
%rest:GET
%rest:HEAD
%rest:path("/http-503")
%output:method("json")
function head:http-503()
as item()+ {
<rest:response>
<http:response xmlns:http="http://expath.org/ns/http-client" status="503">
<http:header name="Access-Control-Allow-Origin" value="*"/>
</http:response>
</rest:response>
};
......@@ -28,6 +28,7 @@ import module namespace t2ht="http://ahikar.sub.uni-goettingen.de/ns/tei2html-te
import module namespace t2jt="http://ahikar.sub.uni-goettingen.de/ns/tei2json/tests" at "../tests/tei2json-tests.xqm";
import module namespace t2htextt="http://ahikar.sub.uni-goettingen.de/ns/tei2html-textprocessing-tests" at "../tests/tei2html-textprocessing-tests.xqm";
import module namespace tokt="http://ahikar.sub.uni-goettingen.de/ns/tokenize/tests" at "../tests/tokenize-tests.xqm";
import module namespace ht="http://ahikar.sub.uni-goettingen.de/ns/http-headers/tests" at "../tests/http-headers-tests.xqm";
(: modules that need credentials for the tests to work :)
import module namespace titemtc="http://ahikar.sub.uni-goettingen.de/ns/tapi/item/tests/credentials" at "../tests/tapi-item-tests-credentials-needed.xqm";
......@@ -84,6 +85,7 @@ as element()+ {
test:suite(util:list-functions("http://ahikar.sub.uni-goettingen.de/ns/tapi/images/tests")),
test:suite(util:list-functions("http://ahikar.sub.uni-goettingen.de/ns/tokenize/tests")),
test:suite(util:list-functions("http://ahikar.sub.uni-goettingen.de/ns/tei2json/tests")),
test:suite(util:list-functions("http://ahikar.sub.uni-goettingen.de/ns/http-headers/tests")),
(: tests with credentials needed :)
if (environment-variable("TGLOGIN")) then
(
......@@ -115,6 +117,7 @@ as element()+ {
declare function local:get-human-readable-pkg-name($package as xs:string)
as xs:string? {
switch ($package)
case "http://ahikar.sub.uni-goettingen.de/ns/http-headers/tests" return "HTTP Headers"
case "http://ahikar.sub.uni-goettingen.de/ns/tapi/tests" return "TextAPI general"
case "http://ahikar.sub.uni-goettingen.de/ns/commons-tests" return "Commons"
case "http://ahikar.sub.uni-goettingen.de/ns/tapi/collection/tests" return "TextAPI Collections"
......
xquery version "3.1";
module namespace ht="http://ahikar.sub.uni-goettingen.de/ns/http-headers/tests";
import module namespace tc="http://ahikar.sub.uni-goettingen.de/ns/tests/commons" at "test-commons.xqm";
import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
declare
%test:assertEquals("403")
function ht:http-403()
as xs:string {
let $url := $tc:server || "/http-403"
return
tc:get-http-status($url)
};
declare
%test:assertEquals("404")
function ht:http-404()
as xs:string {
let $url := $tc:server || "/http-404"
return
tc:get-http-status($url)
};
declare
%test:assertEquals("500")
function ht:http-500()
as xs:string {
let $url := $tc:server || "/http-500"
return
tc:get-http-status($url)
};
declare
%test:assertEquals("503")
function ht:http-503()
as xs:string {
let $url := $tc:server || "/http-503"
return
tc:get-http-status($url)
};
......@@ -12,7 +12,6 @@ module namespace tt="http://ahikar.sub.uni-goettingen.de/ns/tapi/tests";
declare namespace http = "http://expath.org/ns/http-client";
declare namespace tei="http://www.tei-c.org/ns/1.0";
import module namespace map="http://www.w3.org/2005/xpath-functions/map";
import module namespace tapi="http://ahikar.sub.uni-goettingen.de/ns/tapi" at "../modules/tapi.xqm";
import module namespace tc="http://ahikar.sub.uni-goettingen.de/ns/tests/commons" at "test-commons.xqm";
import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment