jql: 8.0.0 -> 8.0.2 (#362884)
[NixPkgs.git] / pkgs / servers / nosql / apache-jena / fuseki-test.nix
blobaf0991cb666d33883cafc361ab238e549eaf4d26
2   runCommand,
3   apache-jena-fuseki,
4   curl,
5 }:
6 runCommand "fuseki-test-${apache-jena-fuseki.name}"
7   {
8     nativeBuildInputs = [
9       curl
10       apache-jena-fuseki
11     ];
12   }
13   ''
14     export FUSEKI_BASE="$PWD/fuseki-base"
15     mkdir -p "$FUSEKI_BASE/db"
16     FUSEKI_ARGS="--update --loc=$FUSEKI_BASE/db /dataset" fuseki start
17     fuseki status
18     for i in $(seq 120); do
19         if  curl http://127.0.0.1:3030/dataset/data; then
20             break;
21         fi
22         sleep 1
23     done
24     curl -d 'update=insert+data+{+<test://subject>+<test://predicate>+<test://object>+}' http://127.0.0.1:3030/dataset/update > /dev/null
25     curl http://127.0.0.1:3030/dataset/data | grep -C999 'test://predicate'
26     curl -d 'query=select+?s+?p+?o+where+{+?s+?p+?o+.+}' http://127.0.0.1:3030/dataset/query | grep -C999 'test://predicate'
27     touch $out
28   ''