summaryrefslogtreecommitdiff
path: root/tests/functional-tests
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-12-30 13:26:04 +0100
committerCarlos Garnacho <carlosg@gnome.org>2020-02-17 18:57:46 +0100
commiteb3a756e8eb89278624a43b28538b74fea5c8e42 (patch)
treecb3bf69331f1f726d0d4bceb11cba20f8ea25b20 /tests/functional-tests
parent167e6e796ac16dee932e5ec4ff33b1d9f9aa4f3d (diff)
downloadtracker-eb3a756e8eb89278624a43b28538b74fea5c8e42.tar.gz
tests: Move functional test into libtracker-data
The insert-or-replace functional IPC test wasn't actually doing any specific functional testing, rather testing the INSERT OR REPLACE special syntax. It makes more sense to test for this specifically in libtracker-data tests. Also spares us a tracker_sparql_connection_get() call, which we are aiming to remove.
Diffstat (limited to 'tests/functional-tests')
-rw-r--r--tests/functional-tests/ipc/meson.build8
-rw-r--r--tests/functional-tests/ipc/test-insert-or-replace.vala156
2 files changed, 0 insertions, 164 deletions
diff --git a/tests/functional-tests/ipc/meson.build b/tests/functional-tests/ipc/meson.build
index 4bcfb0540..839fcefdc 100644
--- a/tests/functional-tests/ipc/meson.build
+++ b/tests/functional-tests/ipc/meson.build
@@ -14,14 +14,6 @@ test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies
test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', tracker_uninstalled_stop_words_dir)
test_env.set('TRACKER_TEST_DOMAIN_ONTOLOGY_RULE', tracker_uninstalled_domain_rule)
-insert_or_replace_test = executable('test-insert-or-replace',
- 'test-insert-or-replace.vala', tracker_sparql_vapi,
- dependencies: [tracker_common_dep, tracker_sparql_dep])
-test('insert-or-replace', python,
- args: sandbox_args + [insert_or_replace_test],
- env: test_env,
- suite: ['functional', 'ipc'])
-
bus_query_cancellation_test = executable('test-bus-query-cancellation',
'test-bus-query-cancellation.c',
c_args: functional_ipc_test_c_args,
diff --git a/tests/functional-tests/ipc/test-insert-or-replace.vala b/tests/functional-tests/ipc/test-insert-or-replace.vala
deleted file mode 100644
index f47d27713..000000000
--- a/tests/functional-tests/ipc/test-insert-or-replace.vala
+++ /dev/null
@@ -1,156 +0,0 @@
-using GLib;
-using Tracker;
-using Tracker.Sparql;
-
-const string insert_query_replace = "
-DELETE { ?r nao:hasTag ?tag . }
-WHERE {
- ?r a nco:PhoneNumber;
- nco:phoneNumber \"02141730585%d\";
- nao:hasTag ?tag .
-}
-
-DELETE {
- ?r a nco:CarPhoneNumber, nco:BbsNumber, nco:PagerNumber,
- nco:VideoTelephoneNumber, nco:MessagingNumber, nco:VoicePhoneNumber,
- nco:CellPhoneNumber, nco:FaxNumber, nco:ModemNumber .
-} WHERE {
- ?r a nco:PhoneNumber;
- nco:phoneNumber \"02141730585%d\" .
-}
-
-INSERT {
- _:tel a nco:PhoneNumber ;
- nco:phoneNumber \"02141730585%d\" .
-} WHERE {
- OPTIONAL {
- ?r a nco:PhoneNumber;
- nco:phoneNumber \"02141730585%d\" .
- }
- FILTER(!bound(?r)) .
-}
-
-INSERT OR REPLACE { <mailto:rhome0@example.com%d> a nco:EmailAddress ;
- nco:emailAddress \"rhome0@example.com%d\" . }
-
-DELETE { <contact:r:%d> nco:hasAffiliation ?e . ?e a rdfs:Resource }
-WHERE { <contact:r:%d> a nco:PersonContact ; nco:hasAffiliation ?e }
-
-INSERT OR REPLACE {
- _:af1 a nco:Affiliation ;
- rdfs:label \"Work\" ;
- nco:hasEmailAddress <mailto:rhome0@example.com%d> .
-
- _:af2 a nco:Affiliation ;
- rdfs:label \"Other\" ;
- nco:hasPhoneNumber ?tel .
-
- <contact:r:%d> a nco:PersonContact ;
- nco:nameGiven \"First %d\" ;
- nco:nameFamily \"Last %d\" ;
- nco:hasAffiliation _:af1 ;
- nco:hasAffiliation _:af2 ;
- nie:contentCreated \"2011-03-14T13:47:25\" ;
- nco:contactUID \"c1f1b12d-bc75-4d45-9a1f-b1efe934409f\" .
-} WHERE {
- ?tel nco:phoneNumber \"02141730585%d\"
-}";
-
-const string insert_query_original = "
-DELETE { ?r nao:tag ?tag . }
-WHERE {
- ?r a nco:PhoneNumber; nco:phoneNumber \"2141730585%d\";
- nao:hasTag ?tag .
-}
-
-DELETE {
- ?r a nco:CarPhoneNumber, nco:BbsNumber, nco:PagerNumber,
- nco:VideoTelephoneNumber, nco:MessagingNumber, nco:VoicePhoneNumber,
- nco:CellPhoneNumber, nco:FaxNumber, nco:ModemNumber .
-} WHERE {
- ?r a nco:PhoneNumber;
- nco:phoneNumber \"2141730585%d\" .
-}
-
-INSERT {
- _:tel a nco:PhoneNumber ;
- nco:phoneNumber \"2141730585%d\" .
-} WHERE {
- OPTIONAL {
- ?r a nco:PhoneNumber;
- nco:phoneNumber \"2141730585%d\" .
- }
- FILTER(!bound(?r)) .
-}
-
-INSERT { <mailto:home0@example.com%d> a nco:EmailAddress ;
- nco:emailAddress \"home0@example.com%d\" . }
-
-DELETE { <contact:o:%d> nco:hasAffiliation ?e . ?e a rdfs:Resource }
-WHERE { <contact:o:%d> a nco:PersonContact ; nco:hasAffiliation ?e }
-
-DELETE { GRAPH <urn:uuid:08070f5c-a334-4d19-a8b0-12a3071bfab9> {
- <contact:o:%d> ?predicate ?object .
-} } WHERE { GRAPH <urn:uuid:08070f5c-a334-4d19-a8b0-12a3071bfab9> {
- <contact:o:%d> ?predicate ?object .
- FILTER(?predicate NOT IN (nco:contactLocalUID,nco:contactUID,rdf:type)) .
-} }
-
-INSERT { GRAPH <urn:uuid:08070f5c-a334-4d19-a8b0-12a3071bfab9> {
- _:af1 a nco:Affiliation ;
- rdfs:label \"Work\" ;
- nco:hasEmailAddress <mailto:home0@example.com%d> .
-
- _:af2 a nco:Affiliation ;
- rdfs:label \"Other\" ;
- nco:hasPhoneNumber ?tel .
-
- <contact:o:%d> a nco:PersonContact ;
- nco:nameGiven \"First %d\" ;
- nco:nameFamily \"Last %d\" ;
- nco:hasAffiliation _:af1 ;
- nco:hasAffiliation _:af2 ;
- nie:contentCreated \"2011-03-14T13:47:25\" ;
- nco:contactUID \"c1f1b12d-bc75-4d45-9a1f-b1efe934409f\" .
-} } WHERE {
- ?tel nco:phoneNumber \"2141730585%d\"
-}";
-
-
-int main (string[] args) {
- try {
- uint i, y = 10;
- Timer timer = new Timer ();
- Connection c;
- c = Connection.get ();
-
- if (args.length == 3) {
- y = int.parse (args[2]);
- }
-
- if (args.length == 1 || args[1] == "replace") {
- timer.start ();
- for (i = 0; i < y; i++) {
- c.update (insert_query_replace.printf (i,i,i,i,i,i,i,i,i,i,i,i,i));
- }
- timer.stop ();
-
- print ("REPLACE : %u contacts: %f\n", y, timer.elapsed());
- }
-
-
- if (args.length == 1 || args[1] == "original") {
- timer.start ();
- for (i = 0; i < y; i++) {
- c.update (insert_query_original.printf (i,i,i,i,i,i,i,i,i,i,i,i,i,i,i));
- }
- timer.stop ();
-
- print ("ORIGINAL : %u contacts: %f\n", y, timer.elapsed());
- }
- return 0;
- } catch (GLib.Error e) {
- critical ("%s", e.message);
- return 1;
- }
-}