Debian Codegraph @

debian/tests/Konclude.t

raw
1 use strict;
2 use warnings;
3
4 #use Proc::Daemon;
5
6 use Test::More;
7 use Test::Command::Simple;
8
9 my $NAME = 'Konclude';
10 my $CMD = $ENV{'KONCLUDE'} || 'Konclude';
11
12 run_ok $CMD;
13 like stdout, qr/ Usage: '$NAME'/, 'bare command, stdout';
14 cmp_ok stderr, 'eq', '', 'bare command, stderr';
15
16 run_ok $CMD, qw(-h);
17 like stdout, qr/ Usage: '$NAME'/, 'version, stdout';
18 cmp_ok stderr, 'eq', '', 'version, stderr';
19
20 run_ok $CMD, qw(owllinkfile -w 2 -i Tests/test-request.xml -o test-response.xml);
21 like stdout, qr[Realizing ontology 'http://www.konclude.com/test'], 'test, stdout';
22 cmp_ok stderr, 'eq', '', 'test, stderr';
23
24 run_ok $CMD, qw(owllinkfile -w 2 -c Configs/default-config.xml -i Tests/test-request.xml -o test-response-cfg.xml);
25 like stdout, qr[Realizing ontology 'http://www.konclude.com/test'], 'test with config, stdout';
26 cmp_ok stderr, 'eq', '', 'test with config, stderr';
27
28 # FIXME
29 #my $daemon_owl = Proc::Daemon->new({
30 # exec_command => "$Konclude owllinkserver -w 2 -c Configs/default-config.xml -p 8080",
31 #});
32 ##check stdout and stderr
33 ##POST < Tests/test-request.xml http://localhost:8080
34 ## shut down daemon
35
36 # TODO: check sanity of output files
37
38 run_ok $CMD, qw(satisfiability -w 2 -i Tests/galen.owl.xml -x), 'http://ex.test/galen#ExternalIliacVein';
39 like stdout, qr[Class 'http://ex.test/galen#ExternalIliacVein' for ontology 'Tests/galen.owl.xml' is satisfiable.], 'satisfiability, stdout';
40 cmp_ok stderr, 'eq', '', 'satisfiability, stderr';
41
42 run_ok $CMD, qw(classification -w 2 -i Tests/roberts-family-full-D.owl.xml -o test-response-class.xml);
43 like stdout, qr[Finished class classification in \d+ ms for ontology 'http://konclude.com/test/kb'.], 'classification, stdout';
44 cmp_ok stderr, 'eq', '', 'classification, stderr';
45
46 # TODO: check sanity of output files
47
48 run_ok $CMD, qw(realization -w 2 -i Tests/roberts-family-full-D.owl.xml -o test-response-real.xml);
49 like stdout, qr[Finished class classification in \d+ ms for ontology 'http://konclude.com/test/kb'.], 'realization, stdout';
50 cmp_ok stderr, 'eq', '', 'realization, stderr';
51
52 # TODO: check sanity of output files
53
54 # FIXME: hangs after "Realizing ontology ..."
55 #run_ok $CMD, qw(sparqlfile -w 2 -s Tests/lubm-univ-bench-sparql-load-and-query-test.sparql -o Tests/query-answers.xml -c Configs/querying-config.xml);
56 #like stdout, qr[Determined 208 answers for complex ABox query with 1 answer variables], 'test SPARQL query, stdout';
57 #cmp_ok stderr, 'eq', '', 'test SPARQL query, stderr';
58
59 # FIXME: hangs after "Realizing ontology ..."
60 #run_ok $CMD, qw(sparqlfile -w 2 -s Tests/lubm-univ-bench-sparql-load-and-complex-query-rasqal-test.sparql -o Tests/query-answers.xml -c Configs/querying-config.xml);
61 #like stdout, qr[Determined 208 answers for complex ABox query with 1 answer variables], 'test SPARQL query, stdout';
62 #cmp_ok stderr, 'eq', '', 'test SPARQL query, stderr';
63
64 # TODO: check sanity of output files
65
66 # FIXME
67 #my $daemon_sparql = Proc::Daemon->new({
68 # exec_command => "$CMD sparqlserver -w 2 -c Configs/querying-config.xml -p 8080",
69 #});
70 ##check stdout and stderr
71 ## redo SPARQL query against daemon (not directly to file)
72 ## shut down daemon
73
74 # TODO: check sanity of output files
75
76 done_testing;