Commit 09c2d66f authored by Mathias Goebel's avatar Mathias Goebel 🎠

Merge branch 'bugfix/#123-confserv' into 'develop'

fix confserv function

Closes #123

See merge request !89
parents 44a6a56c 6e40d3d5
......@@ -61,7 +61,7 @@ installation:
script:
- bash test/eXist-db-*/bin/startup.sh | tee output.log &
# wait for eXist to have started
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 1s; done
# shutdown eXist
- bash test/eXist-db-*/bin/shutdown.sh
- ls -al /tmp; mv /tmp/tests-* . || true
......
project.name=http://sade.textgrid.de/ns/SADE-develop
project.version=4.1.0
project.version=4.2.0
project.title=Scalable Architecture for Digital Editions powered by TextGrid
project.abbrev=SADE-develop
project.processorversion=5.1.0
project.processorversion=5.2.0
destfile=${build.dir}/${project.abbrev}-${project.version}.xar
test.dir=test
......
......@@ -203,19 +203,28 @@ return
doc($url|| $parameter )
};
declare function tgclient:confserv(){
(:~
: Read the current configuration from Confserv (https://textgridlab.org/1.0/confserv/getAll).
: @author: Mathias Göbel
: @return: map(*) with on level of key-value-pairs.
:)
declare
%test:name("confserv")
%test:assertExists
%test:assertXPath("$result?('tgcrud') => boolean()")
function tgclient:confserv(){
let $confservUrl := "https://textgridlab.org/1.0/confserv/getAll"
let $reqGet :=
<http:request method="get" />
let $confserv :=
http:send-request($reqGet, $confservUrl)[2]/text()
http:send-request($reqGet, $confservUrl)[2]
=> util:base64-decode()
=> parse-json()
return
map:merge(
for $key at $pos in $conf?*?*?*?("key")
let $value := $conf?*?*?*?("value")[$pos]
for $key at $pos in $confserv?*?*?*?("key")
let $value := $confserv?*?*?*?("value")[$pos]
return
map:entry($key, $value))
};
......
......@@ -14,6 +14,20 @@
<prepare>pre-install.xq</prepare>
<finish>post-install.xq</finish>
<changelog>
<change version="5.1.0">
<ul xmlns="http://www.w3.org/1999/xhtml">
<li class="feat">Features
<ul>
<li/>
</ul>
</li>
<li class="bugs">Bugfixes
<ul>
<li>tgclient:confserv#0 – refactor, documentation</li>
</ul>
</li>
</ul>
</change>
<change version="5.0.0">
<ul xmlns="http://www.w3.org/1999/xhtml">
<li class="feat">Features
......
xquery version "3.1";
(:~
: Script providing access to the test functions (XQSuite). Called
: at post-install stage, evaluated at CI.
:)
import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
import module namespace tests="https://sade.textgrid.de/ns/tests" at "test.xqm";
(: callgraph :)
import module namespace callgraph-test = "https://sade.textgrid.de/ns/callgraph-test" at "modules/callgraph/tests/callgraph-test.xq";
import module namespace inspect2graphml-test = "https://sade.textgrid.de/ns/inspect2graphml-test" at "modules/callgraph/tests/inspect2graphml-test.xq";
import module namespace tgclient="https://sade.textgrid.de/ns/tgclient" at "/db/apps/sade/modules/textgrid/client.xqm";
test:suite(util:list-functions("https://sade.textgrid.de/ns/tests")),
(: * CALLGRAPH * :)
test:suite(util:list-functions("https://sade.textgrid.de/ns/callgraph-test")),
test:suite(util:list-functions("https://sade.textgrid.de/ns/inspect2graphml-test"))
\ No newline at end of file
test:suite(util:list-functions("https://sade.textgrid.de/ns/inspect2graphml-test")),
(: * TGCLIENT * :)
test:suite(util:list-functions("https://sade.textgrid.de/ns/tgclient"))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment