Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / nosql / apache-jena / fuseki-test.nix
blobdd8a82d8494f0acecff2db2f5c97e9109652e7f6
1 { runCommand, apache-jena-fuseki, curl }:
2 runCommand "fuseki-test-${apache-jena-fuseki.name}"
3 { nativeBuildInputs = [ curl apache-jena-fuseki ]; } ''
4   export FUSEKI_BASE="$PWD/fuseki-base"
5   mkdir -p "$FUSEKI_BASE/db"
6   FUSEKI_ARGS="--update --loc=$FUSEKI_BASE/db /dataset" fuseki start
7   fuseki status
8   for i in $(seq 120); do
9       if  curl http://127.0.0.1:3030/dataset/data; then
10           break;
11       fi
12       sleep 1
13   done
14   curl -d 'update=insert+data+{+<test://subject>+<test://predicate>+<test://object>+}' http://127.0.0.1:3030/dataset/update > /dev/null
15   curl http://127.0.0.1:3030/dataset/data | grep -C999 'test://predicate'
16   curl -d 'query=select+?s+?p+?o+where+{+?s+?p+?o+.+}' http://127.0.0.1:3030/dataset/query | grep -C999 'test://predicate'
17   touch $out