[tracker] tests/libtracker-data: Added unit test for ontology change coping for domain indexes
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tests/libtracker-data: Added unit test for ontology change coping for domain indexes
- Date: Fri, 16 Jul 2010 08:52:14 +0000 (UTC)
commit 63814db39507cfca67a784860a7a97a093cb79d7
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Jul 13 12:41:57 2010 +0200
tests/libtracker-data: Added unit test for ontology change coping for domain indexes
tests/libtracker-data/Makefile.am | 4 ++
.../change/source/99-example.ontology.v4 | 9 +++
.../change/source/99-example.ontology.v5 | 54 ++++++++++++++++++++
.../change/source/99-example.ontology.v6 | 54 ++++++++++++++++++++
tests/libtracker-data/change/test-4.out | 1 +
tests/libtracker-data/change/test-4.rq | 1 +
tests/libtracker-data/change/test-5.out | 1 +
tests/libtracker-data/change/test-5.rq | 1 +
tests/libtracker-data/tracker-ontology-test.c | 4 ++
9 files changed, 129 insertions(+), 0 deletions(-)
---
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index 6f0d44c..2abfe5e 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -83,6 +83,8 @@ EXTRA_DIST = \
change/source/99-example.ontology.v2 \
change/source/99-example.ontology.v3 \
change/source/99-example.ontology.v4 \
+ change/source/99-example.ontology.v5 \
+ change/source/99-example.ontology.v6 \
change/test-1.out \
change/test-1.rq \
change/test-2.out \
@@ -92,6 +94,8 @@ EXTRA_DIST = \
change/updates/99-example.queries.v2 \
change/updates/99-example.queries.v3 \
change/updates/99-example.queries.v4 \
+ change/updates/99-example.queries.v5 \
+ change/updates/99-example.queries.v6 \
ontologies/20-dc.ontology \
ontologies/31-nao.ontology \
ontologies/90-tracker.ontology
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v4 b/tests/libtracker-data/change/source/99-example.ontology.v4
index 08b0a28..84ce7a2 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v4
+++ b/tests/libtracker-data/change/source/99-example.ontology.v4
@@ -13,6 +13,9 @@ example: a tracker:Namespace, tracker:Ontology ;
example:A a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+example:DomA a rdfs:Class ;
+ rdfs:subClassOf example:A .
+
example:B a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
@@ -34,6 +37,12 @@ example:single1 a rdf:Property ;
nrl:maxCardinality 1 ;
tracker:indexed false .
+example:single2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
example:ib a rdf:Property ;
rdfs:domain example:B ;
rdfs:range xsd:integer .
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v5 b/tests/libtracker-data/change/source/99-example.ontology.v5
new file mode 100644
index 0000000..4229990
--- /dev/null
+++ b/tests/libtracker-data/change/source/99-example.ontology.v5
@@ -0,0 +1,54 @@
+ prefix example: <http://example/> .
+ prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ prefix tracker: <http://www.tracker-project.org/ontologies/tracker#> .
+ prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
+ prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+
+example: a tracker:Namespace, tracker:Ontology ;
+ nao:lastModified "2010-03-23T11:00:05Z" ;
+ tracker:prefix "example" .
+
+example:A a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+example:DomA a rdfs:Class ;
+ tracker:domainIndex example:single1, example:single2 ;
+ rdfs:subClassOf example:A .
+
+example:B a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+example:b a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range example:B .
+
+example:i1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:i2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:single1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:single2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:ib a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:integer .
+
+example:sb a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:string .
+
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v6 b/tests/libtracker-data/change/source/99-example.ontology.v6
new file mode 100644
index 0000000..5b12426
--- /dev/null
+++ b/tests/libtracker-data/change/source/99-example.ontology.v6
@@ -0,0 +1,54 @@
+ prefix example: <http://example/> .
+ prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ prefix tracker: <http://www.tracker-project.org/ontologies/tracker#> .
+ prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
+ prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+
+example: a tracker:Namespace, tracker:Ontology ;
+ nao:lastModified "2010-03-23T11:00:06Z" ;
+ tracker:prefix "example" .
+
+example:A a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+example:DomA a rdfs:Class ;
+ tracker:domainIndex example:single2 ;
+ rdfs:subClassOf example:A .
+
+example:B a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+example:b a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range example:B .
+
+example:i1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:i2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:single1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:single2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:ib a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:integer .
+
+example:sb a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:string .
+
diff --git a/tests/libtracker-data/change/test-4.out b/tests/libtracker-data/change/test-4.out
new file mode 100644
index 0000000..dc3682e
--- /dev/null
+++ b/tests/libtracker-data/change/test-4.out
@@ -0,0 +1 @@
+"2" "s2"
diff --git a/tests/libtracker-data/change/test-4.rq b/tests/libtracker-data/change/test-4.rq
new file mode 100644
index 0000000..25d5f3c
--- /dev/null
+++ b/tests/libtracker-data/change/test-4.rq
@@ -0,0 +1 @@
+select ?ib ?sb { <b02> example:ib ?ib; example:sb ?sb }
diff --git a/tests/libtracker-data/change/test-5.out b/tests/libtracker-data/change/test-5.out
new file mode 100644
index 0000000..531acfc
--- /dev/null
+++ b/tests/libtracker-data/change/test-5.out
@@ -0,0 +1 @@
+"http://example/single2"
diff --git a/tests/libtracker-data/change/test-5.rq b/tests/libtracker-data/change/test-5.rq
new file mode 100644
index 0000000..3c04ff5
--- /dev/null
+++ b/tests/libtracker-data/change/test-5.rq
@@ -0,0 +1 @@
+select ?index { example:DomA tracker:domainIndex ?index }
diff --git a/tests/libtracker-data/change/updates/99-example.queries.v5 b/tests/libtracker-data/change/updates/99-example.queries.v5
new file mode 100644
index 0000000..e69de29
diff --git a/tests/libtracker-data/change/updates/99-example.queries.v6 b/tests/libtracker-data/change/updates/99-example.queries.v6
new file mode 100644
index 0000000..e69de29
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 9781e85..d7f6cc9 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -85,6 +85,8 @@ const TestInfo change_tests[] = {
{ "change/test-1", "change/data-1" },
{ "change/test-2", "change/data-2" },
{ "change/test-3", "change/data-3" },
+ { "change/test-4", "change/data-4" },
+ { "change/test-5", "change/data-5" },
{ NULL }
};
@@ -93,6 +95,8 @@ const ChangeInfo changes[] = {
{ "99-example.ontology.v2", "99-example.queries.v2" },
{ "99-example.ontology.v3", "99-example.queries.v3" },
{ "99-example.ontology.v4", "99-example.queries.v4" },
+ { "99-example.ontology.v5", "99-example.queries.v5" },
+ { "99-example.ontology.v6", "99-example.queries.v6" },
{ NULL }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]