using Folks;
using Gee;
-public class AddContactsStressTestTests : Folks.TestCase
+public class AddContactsStressTestTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private Edsf.PersonaStore _pstore;
private bool _added_contacts = false;
this.add_test (test_desc, this.test_add_contacts);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_add_contacts ()
{
this._main_loop = new GLib.MainLoop (null, false);
{
this._pstore =
(Edsf.PersonaStore) backend.persona_stores.get (
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
if (this._pstore != null)
break;
}
using Folks;
using Gee;
-public class AddPersonaTests : Folks.TestCase
+public class AddPersonaTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private string _persona_nickname;
this.add_test ("test adding a persona to e-d-s ", this.test_add_persona);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_add_persona ()
{
this._main_loop = new GLib.MainLoop (null, false);
{
this._pstore =
(Edsf.PersonaStore) backend.persona_stores.get (
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
if (this._pstore != null)
break;
}
using Folks;
using Gee;
-public class AntiLinkingTests : Folks.TestCase
+public class AntiLinkingTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
public override void set_up ()
{
+ base.set_up ();
+
this._found_before_update = false;
this._found_after_update = false;
this._found_after_final_update = false;
- this._eds_backend = new EdsTest.Backend ();
+ }
+ public override void create_backend ()
+ {
/* Create a new backend (by name) each set up to guarantee we don't
* inherit state from the last test.
* FIXME: bgo#690830 */
this._test_num++;
- this._eds_backend.set_up (false, @"test$_test_num");
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
+ this.eds_backend = new EdsTest.Backend ();
+ this.eds_backend.set_up (false, @"test$_test_num");
}
public override void tear_down ()
{
- this._eds_backend.tear_down ();
-
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
-
/* necessary to clean out some stale state */
- this._eds_backend = null;
this._aggregator = null;
+
+ base.tear_down ();
}
/* Confirm that basic anti-linking works for two Personas who have a common
v = Value (typeof (string));
v.set_string (_email_1);
c.set ("email_1", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
c = new Gee.HashMap<string, Value?> ();
v = Value (typeof (string));
/* Intentionally set the same email address so these will be linked */
v.set_string (_email_1);
c.set ("email_1", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
this._test_anti_linking_basic_async.begin ();
private async void _test_anti_linking_basic_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
v = Value (typeof (string));
v.set_string (_email_1);
c.set ("email_1", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
c = new Gee.HashMap<string, Value?> ();
v = Value (typeof (string));
/* Intentionally set the same email address so these will be linked */
v.set_string (_email_1);
c.set ("email_1", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
this._test_anti_linking_removal_async.begin ();
private async void _test_anti_linking_removal_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class AvatarDetailsTests : Folks.TestCase
+public class AvatarDetailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private Gee.HashMap<string, Value?> _c1;
this.add_test ("avatar details interface", this.test_avatar);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_avatar ()
{
this._c1 = new Gee.HashMap<string, Value?> ();
this._avatars_are_equal = false;
Value? v;
- this._eds_backend.reset();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string (this._avatar_path);
this._c1.set ("avatar",(owned) v);
- this._eds_backend.add_contact (this._c1);
+ this.eds_backend.add_contact (this._c1);
this._test_avatar_async.begin ();
private async void _test_avatar_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class CreateRemoveStoresTests : Folks.TestCase
+public class CreateRemoveStoresTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend? _eds_backend;
private IndividualAggregator _aggregator;
private HashMap<string, bool> _store_removed;
private HashMap<string, bool> _store_added;
public override void set_up ()
{
- this._eds_backend = new EdsTest.Backend ();
+ base.set_up ();
+
this._store_removed = new HashMap<string, bool> ();
this._store_added = new HashMap<string, bool> ();
this._backend_store = BackendStore.dup();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
Environment.set_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS",
"test:other:test1:test2", true);
}
public override void tear_down ()
{
- this._eds_backend.tear_down ();
-
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
Environment.unset_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS");
- this._eds_backend = null;
+ base.tear_down ();
}
public void test_creating_removing_stores ()
using Folks;
using Gee;
-public class EmailDetailsTests : Folks.TestCase
+public class EmailDetailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private int _email_count;
this.add_test ("email details interface", this.test_email_details);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_email_details ()
{
this._email_count = 0;
this._main_loop = new GLib.MainLoop (null, false);
Value? v;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string ("bernie.innocenti@example.org");
this._c1.set (Edsf.Persona.email_fields[1], (owned) v);
- this._eds_backend.add_contact (this._c1);
+ this.eds_backend.add_contact (this._c1);
v = Value (typeof (string));
v.set_string ("richard m. stallman");
v = Value (typeof (string));
v.set_string ("rms.1@example.org");
this._c2.set (Edsf.Persona.email_fields[1], (owned) v);
- this._eds_backend.add_contact (this._c2);
+ this.eds_backend.add_contact (this._c2);
v = Value (typeof (string));
v.set_string ("foo bar");
v = Value (typeof (string));
v.set_string ("foo.bar@example.org");
this._c3.set (Edsf.Persona.email_fields[1], (owned) v);
- this._eds_backend.add_contact (this._c3);
+ this.eds_backend.add_contact (this._c3);
this._test_email_details_async.begin ();
private async void _test_email_details_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class EnableDisableStoresTests : Folks.TestCase
+public class EnableDisableStoresTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend? _eds_backend;
private EdsTest.Backend? _eds_backend_other;
private IndividualAggregator _aggregator;
private HashMap<PersonaStore, bool> _store_removed;
public override void set_up ()
{
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend_other = new EdsTest.Backend ();
+ base.set_up ();
+
this._store_removed = new HashMap<PersonaStore, bool> ();
this._store_added = new HashMap<PersonaStore, bool> ();
this._backend_store = BackendStore.dup();
- this._eds_backend.set_up ();
+ this._eds_backend_other = new EdsTest.Backend ();
this._eds_backend_other.set_up (false, "other");
/* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
Environment.set_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS",
"test:other", true);
}
public override void tear_down ()
{
- this._eds_backend.tear_down ();
this._eds_backend_other.tear_down ();
-
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
-
- this._eds_backend = null;
this._eds_backend_other = null;
+
+ base.tear_down ();
}
public void test_disabling_stores ()
backend.persona_store_added.connect (this._store_added_cb);
var pstore = this._get_store (this._backend_store,
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
assert (pstore != null);
this._store_removed[pstore] = false;
this._store_added[pstore] = false;
using Folks;
using Gee;
-public class ImDetailsTests : Folks.TestCase
+public class ImDetailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private int _num_addrs;
this.test_im_details_interface);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_im_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._im_addrs += ",im_yahoo_home_1#test2@example.org";
Value? v;
- this._eds_backend.reset();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string (this._fullname);
v.set_string (this._im_addrs);
c1.set ("im_addresses", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._num_addrs = 0;
this._found_addr_1 = false;
private async void _test_im_details_interface_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class IndividualRetrievalTests : Folks.TestCase
+public class IndividualRetrievalTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private HashSet<string> _found_individuals;
this.add_test ("singleton individuals", this.test_singleton_individuals);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_singleton_individuals ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._main_loop = new GLib.MainLoop (null, false);
Value? v;
- this._eds_backend.reset();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string ("bernie@example.org");
c1.set(Edsf.Persona.email_fields[0], (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
v = Value (typeof (string));
v.set_string ("richard m. stallman");
v = Value (typeof (string));
v.set_string ("rms@example.org");
c2.set(Edsf.Persona.email_fields[0], (owned) v);
- this._eds_backend.add_contact (c2);
+ this.eds_backend.add_contact (c2);
this._test_singleton_individuals_async.begin ();
private async void _test_singleton_individuals_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class LinkPersonasDiffStoresTests : Folks.TestCase
+public class LinkPersonasDiffStoresTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend? _eds_backend;
private EdsTest.Backend? _eds_backend_other;
private IndividualAggregator _aggregator;
private string _persona_fullname_1;
public override void set_up ()
{
- this._eds_backend = new EdsTest.Backend ();
+ base.set_up ();
this._eds_backend_other = new EdsTest.Backend ();
-
- this._eds_backend.set_up ();
this._eds_backend_other.set_up (false, "other");
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
Environment.set_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS",
"test:other", true);
}
public override void tear_down ()
{
- this._eds_backend.tear_down ();
this._eds_backend_other.tear_down ();
-
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
-
- this._eds_backend = null;
this._eds_backend_other = null;
+ base.tear_down ();
}
public void test_linking_via_local_ids_diff_stores ()
this._aggregator.notify["is-quiescent"].connect ((obj, pspec) =>
{
var pstore = this._get_store (store,
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
assert (pstore != null);
assert (pstore.is_prepared == true);
}
-public class LinkPersonasTests : Folks.TestCase
+public class LinkPersonasTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend? _eds_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1;
private string _persona_fullname_2;
this.test_linking_via_email_as_im_address);
}
- public override void set_up ()
+ public override void create_backend ()
{
- this._eds_backend = new EdsTest.Backend ();
-
/* Create a new backend (by name) each set up to guarantee we don't
* inherit state from the last test.
* FIXME: bgo#690830 */
this._test_num++;
- this._eds_backend.set_up (false, @"test$_test_num");
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
-
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
-
- this._eds_backend = null;
+ this.eds_backend = new EdsTest.Backend ();
+ this.eds_backend.set_up (false, @"test$_test_num");
}
public void test_linking_personas_via_im_addresses ()
yield this._aggregator.prepare ();
var pstore = this._get_store (store,
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
assert (pstore != null);
pstore.notify["is-prepared"].connect (this._notify_pstore_cb);
using Folks;
using Gee;
-public class LinkablePropertiesTests : Folks.TestCase
+public class LinkablePropertiesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
public override void set_up ()
{
+ base.set_up ();
+
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
}
/* Check that two unaggregated Personas get aggregated after one changes its
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
c = new Gee.HashMap<string, Value?> ();
v = Value (typeof (string));
v = Value (typeof (string));
v.set_string (_phone_1);
c.set ("home_phone", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
c = new Gee.HashMap<string, Value?> ();
v = Value (typeof (string));
v = Value (typeof (string));
v.set_string (_phone_2);
c.set ("mobile_phone", (owned) v);
- this._eds_backend.add_contact (c);
+ this.eds_backend.add_contact (c);
this._test_linkable_properties_aggregate_after_change_async.begin ();
private async void _test_linkable_properties_aggregate_after_change_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class NameDetailsTests : Folks.TestCase
+public class NameDetailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private int _names_count;
this.add_test ("name details interface", this.test_names);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_names ()
{
this._c1 = new Gee.HashMap<string, Value?> ();
this._main_loop = new GLib.MainLoop (null, false);
Value? v;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
/* FIXME: passing the EContactName would be better */
v = Value (typeof (string));
v = Value (typeof (string));
v.set_string ("(sysadmin FSF)");
this._c1.set ("contact_name_suffixes", (owned) v);
- this._eds_backend.add_contact (this._c1);
+ this.eds_backend.add_contact (this._c1);
v = Value (typeof (string));
v.set_string ("richard m. stallman");
v = Value (typeof (string));
v.set_string ("Richard M.");
this._c2.set ("contact_name_given", (owned) v);
- this._eds_backend.add_contact (this._c2);
+ this.eds_backend.add_contact (this._c2);
this._test_names_async.begin ();
private async void _test_names_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class PersonaStoreTests : Folks.TestCase
+public class PersonaStoreTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private HashSet<string> _capabilities_received;
public PersonaStoreTests ()
{
base ("PersonaStoreTests");
- this._eds_backend = new EdsTest.Backend ();
this.add_test ("persona store tests", this.test_persona_store);
}
public override void set_up ()
{
+ base.set_up ();
this._capabilities_received = new HashSet<string> ();
-
- this._eds_backend.set_up ();
- }
-
- public override void tear_down ()
- {
}
public void test_persona_store ()
var main_loop = new GLib.MainLoop (null, false);
Value? v;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string ("bernie@example.org");
c1.set (Edsf.Persona.email_fields[0], (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
v = Value (typeof (string));
v.set_string ("richard m. stallman");
v = Value (typeof (string));
v.set_string ("rms@example.org");
c2.set (Edsf.Persona.email_fields[0], (owned) v);
- this._eds_backend.add_contact (c2);
+ this.eds_backend.add_contact (c2);
var backend_store = BackendStore.dup ();
backend_store.prepare.begin ((o, r) =>
assert (!this._capabilities_received.contains ("can-alias-personas"));
assert (this._capabilities_received.contains ("can-group-personas"));
- this._eds_backend.tear_down ();
+ this.eds_backend.tear_down ();
}
private void _set_up_persona_store (Folks.PersonaStore store)
using Folks;
using Gee;
-public class PhoneDetailsTests : Folks.TestCase
+public class PhoneDetailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private int _phones_count;
this.add_test ("phone details interface", this.test_phone_numbers);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_phone_numbers ()
{
this._phones_count = 0;
this._main_loop = new GLib.MainLoop (null, false);
Value? v;
- this._eds_backend.reset();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string ("12345");
this._c1.set ("home_phone", (owned) v);
- this._eds_backend.add_contact (this._c1);
+ this.eds_backend.add_contact (this._c1);
v = Value (typeof (string));
v.set_string ("richard m. stallman");
v = Value (typeof (string));
v.set_string ("321");
this._c2.set ("home_phone", (owned) v);
- this._eds_backend.add_contact (this._c2);
+ this.eds_backend.add_contact (this._c2);
this._test_phone_numbers_async.begin ();
private async void _test_phone_numbers_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class PostalAddressDetailsTests : Folks.TestCase
+public class PostalAddressDetailsTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private EdsTest.Backend _eds_backend;
private string _pobox = "12345";
private string _locality = "example locality";
private string _postalcode = "example postalcode";
this.test_postal_address_details_interface);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_postal_address_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
/* corresponds to address of type "home" */
c1.set (Edsf.Persona.address_fields[0], (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._found_postal_address = false;
private async void _test_postal_address_details_interface_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class RemovePersonaTests : Folks.TestCase
+public class RemovePersonaTests : EdsTest.TestCase
{
private GLib.MainLoop _main_loop;
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _persona_removed;
this.test_remove_persona);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_remove_persona ()
{
this._main_loop = new GLib.MainLoop (null, false);
{
this._pstore =
(Edsf.PersonaStore) backend.persona_stores.get (
- this._eds_backend.address_book_uid);
+ this.eds_backend.address_book_uid);
if (this._pstore != null)
break;
}
using Folks;
using Gee;
-public class RemovingContactsTests : Folks.TestCase
+public class RemovingContactsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _removed;
this.add_test ("removing contact", this.test_removal);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_removal ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._added = false;
this._removed = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_removal_async.begin ();
private async void _test_removal_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
var name = (Folks.NameDetails) i;
this._added = true;
assert (name.full_name == "bernie h. innocenti");
- this._eds_backend.remove_contact.begin (0);
+ this.eds_backend.remove_contact.begin (0);
}
foreach (Individual i in removed)
using Folks;
using Gee;
-public class SetAvatarTests : Folks.TestCase
+public class SetAvatarTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_individual_avatar);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_avatar ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_avatar_async.begin ();
private async void _test_set_avatar_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("John McClane");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_individual_avatar_async.begin ();
private async void _test_set_individual_avatar_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetBirthdayTests : Folks.TestCase
+public class SetBirthdayTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_birthday);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_birthday ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("John McClane");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_birthday_async.begin ();
private async void _test_set_birthday_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetEmailsTests : Folks.TestCase
+public class SetEmailsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.add_test ("setting emails on e-d-s persona", this.test_set_emails);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_emails ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_emails_async.begin ();
private async void _test_set_emails_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetGenderTests : Folks.TestCase
+public class SetGenderTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _gender_before_update;
this.test_set_gender);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_gender ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._gender_before_update = false;
this._gender_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("jimmy neutron");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_gender_async.begin ();
private async void _test_set_gender_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetIMAddressesTests : Folks.TestCase
+public class SetIMAddressesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_im_addresses);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_im_addresses ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_im_addresses_async.begin ();
private async void _test_set_im_addresses_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetIsFavouriteTests : Folks.TestCase
+public class SetIsFavouriteTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _is_favourite_before_update;
this.test_set_favourite);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_favourite ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._is_favourite_before_update = true;
this._is_favourite_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("juanito from mallorca");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_is_favourite_async.begin ();
private async void _test_set_is_favourite_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetNamesTests : Folks.TestCase
+public class SetNamesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _full_name_found_before_update;
this.test_set_names);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_names ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._nickname_found_before_update = false;
this._nickname_found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
v = Value (typeof (string));
v.set_string ("foo bar");
c1.set ("nickname", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_names_async.begin ();
private async void _test_set_names_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetNotesTests : Folks.TestCase
+public class SetNotesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_notes);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_notes ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_full_name_async.begin ();
private async void _test_set_full_name_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetPhonesTests : Folks.TestCase
+public class SetPhonesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.add_test ("setting phones on e-d-s persona", this.test_set_phones);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_phones ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_phones_async.begin ();
private async void _test_set_phones_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetPostalAddressesTests : Folks.TestCase
+public class SetPostalAddressesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_postal_addresses);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_postal_addresses ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_postal_addresses_async.begin ();
private async void _test_set_postal_addresses_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetPropertiesRaceTests : Folks.TestCase
+public class SetPropertiesRaceTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_postal_addresses);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_postal_addresses ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_postal_addresses_async.begin ();
private async void _test_set_postal_addresses_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetRolesTests : Folks.TestCase
+public class SetRolesTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_roles);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_roles ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("The Guard");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_roles_async.begin ();
private async void _test_set_roles_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetStructuredNameTests : Folks.TestCase
+public class SetStructuredNameTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_structured_name);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_structured_name ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_structured_name_async.begin ();
private async void _test_set_structured_name_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class SetUrlsTests : Folks.TestCase
+public class SetUrlsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.test_set_urls);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_set_urls ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_url_home = false;
this._found_url_blog = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("Albus Percival Wulfric Brian Dumbledore");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_set_urls_async.begin ();
private async void _test_set_urls_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
using Folks;
using Gee;
-public class StoreRemovedTests : Folks.TestCase
+public class StoreRemovedTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
this.add_test ("single store", this.test_single_store);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
public void test_single_store ()
{
this._main_loop = new GLib.MainLoop (null, false);
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
/* Create a contact in the address book. */
var c1 = new Gee.HashMap<string, Value?> ();
v.set_string ("brian@example.com");
c1.set (Edsf.Persona.email_fields[0], (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
/* Schedule the test to start with the main loop. */
this._test_single_store_part1_async.begin ();
private async void _test_single_store_part1_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
/* Tear down the backend. This should remove all individuals. We check
* for this above. */
- this._eds_backend.tear_down ();
+ this.eds_backend.tear_down ();
+ this.eds_backend = null;
}
}
using Folks;
using Gee;
-public class UpdatingContactsTests : Folks.TestCase
+public class UpdatingContactsTests : EdsTest.TestCase
{
- private EdsTest.Backend _eds_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _found_before_update;
this.add_test ("updating contact", this.test_updates);
}
- public override void set_up ()
- {
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.set_up ();
-
- /* We configure eds as the primary store */
- var config_val = "eds:%s".printf (this._eds_backend.address_book_uid);
- Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- }
-
void test_updates ()
{
Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
this._found_before_update = false;
this._found_after_update = false;
- this._eds_backend.reset ();
+ this.eds_backend.reset ();
v = Value (typeof (string));
v.set_string ("bernie h. innocenti");
c1.set ("full_name", (owned) v);
- this._eds_backend.add_contact (c1);
+ this.eds_backend.add_contact (c1);
this._test_updates_async.begin ();
private async void _test_updates_async ()
{
- yield this._eds_backend.commit_contacts_to_addressbook ();
+ yield this.eds_backend.commit_contacts_to_addressbook ();
var store = BackendStore.dup ();
yield store.prepare ();
v = Value (typeof (string));
v.set_string ("bernie innocenti");
updated_data.set("full_name", (owned) v);
- yield this._eds_backend.update_contact (0, updated_data);
+ yield this.eds_backend.update_contact (0, updated_data);
}
private void _notify_full_name_cb (Object individual_obj, ParamSpec ps)
-I$(top_srcdir)/folks \
-I$(top_srcdir)/tests/lib \
-I$(top_srcdir)/tests/lib/key-file \
+ -I$(top_srcdir)/tests/lib/telepathy \
-I$(top_srcdir)/tests/lib/telepathy/contactlist \
-include $(CONFIG_HEADER) \
$(NULL)
LDADD = \
$(top_builddir)/tests/lib/libfolks-test.la \
$(top_builddir)/tests/lib/key-file/libkf-test.la \
+ $(top_builddir)/tests/lib/telepathy/libtpf-test.la \
$(top_builddir)/tests/lib/telepathy/contactlist/libtp-test-contactlist.la \
$(top_builddir)/folks/libfolks.la \
$(GLIB_LIBS) \
--vapidir=$(abs_top_builddir)/tests/lib \
--vapidir=$(abs_top_srcdir)/tests/lib/key-file \
--vapidir=$(abs_top_builddir)/tests/lib/key-file \
+ --vapidir=$(abs_top_srcdir)/tests/lib/telepathy \
+ --vapidir=$(abs_top_builddir)/tests/lib/telepathy \
--vapidir=$(abs_top_srcdir)/tests/lib/telepathy/contactlist/ \
--vapidir=$(abs_top_builddir)/tests/lib/telepathy/contactlist/ \
--pkg gobject-2.0 \
--pkg folks \
--pkg folks-test \
--pkg kf-test \
+ --pkg tpf-test \
--pkg tp-test-contactlist \
-g \
$(NULL)
this.test_generic_afd_handling);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_param_replacement ()
{
string param_name = "metasyntactic-variables";
using Folks;
using TpTests;
-public class AggregationTests : Folks.TestCase
+public class AggregationTests : TpfTest.MixedTestCase
{
- private KfTest.Backend _kf_backend;
- private TpTests.Backend _tp_backend;
private HashSet<string> _default_personas;
private int _test_timeout = 3;
{
base ("Aggregation");
- this._kf_backend = new KfTest.Backend ();
- this._tp_backend = new TpTests.Backend ();
-
/* Create a set of the individuals we expect to see */
this._default_personas = new HashSet<string> ();
this._test_timeout = 10;
}
- public override void set_up ()
+ public override void set_up_tp ()
{
- this._tp_backend.set_up ();
+ /* don't create accounts - we do that per-test */
+ ((!) this.tp_backend).set_up ();
}
- public override void tear_down ()
+ public override void set_up_kf ()
{
- this._tp_backend.tear_down ();
+ /* don't set up - we do it per-test */
}
/* Test that personas are aggregated if their IIDs match (e.g. with the
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("");
+ var tp_backend = (!) this.tp_backend;
+ ((!) this.kf_backend).set_up ("");
- void* account1_handle = this._tp_backend.add_account ("protocol",
+ void* account1_handle = tp_backend.add_account ("protocol",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("protocol",
+ void* account2_handle = tp_backend.add_account ("protocol",
"me2@example.com", "cm", "account2");
/* IDs of the individuals we expect to see.
assert (expected_individuals_detailed.size == 0);
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("[0]\n" +
+ ((!) this.kf_backend).set_up ("[0]\n" +
"protocol=travis@example.com;olivier@example.com;" +
"guillaume@example.com;sjoerd@example.com\n" +
"[1]\n" +
"protocol=christian@example.com;wim@example.com;" +
"helen@example.com;geraldine@example.com");
- void* account_handle = this._tp_backend.add_account ("protocol",
+ this.account_handle = ((!) this.tp_backend).add_account ("protocol",
"me@example.com", "cm", "account");
/* We expect two non-user individuals (each containing four Telepathy
assert (set_in_use.size == 0);
/* Clean up for the next test */
- this._tp_backend.remove_account (account_handle);
- this._kf_backend.tear_down ();
+ ((!) this.tp_backend).remove_account ((!) this.account_handle);
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("[0]\n" +
+ ((!) this.kf_backend).set_up ("[0]\n" +
"protocol=travis@example.com;olivier@example.com;" +
"guillaume@example.com;sjoerd@example.com\n" +
"protocol2=christian@example.com;wim@example.com;" +
"protocol2=travis@example.com;olivier@example.com;" +
"guillaume@example.com;sjoerd@example.com");
- void* account1_handle = this._tp_backend.add_account ("protocol",
+ var tp_backend = (!) this.tp_backend;
+ void* account1_handle = tp_backend.add_account ("protocol",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("protocol2",
+ void* account2_handle = tp_backend.add_account ("protocol2",
"me@example.com", "cm", "account2");
/* We expect two non-user individuals (each containing four Telepathy
assert (expected_personas2_detailed.size == 0);
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("");
+ ((!) this.kf_backend).set_up ("");
- void* account1_handle = this._tp_backend.add_account ("protocol",
+ var tp_backend = (!) this.tp_backend;
+ void* account1_handle = tp_backend.add_account ("protocol",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("protocol",
+ void* account2_handle = tp_backend.add_account ("protocol",
"me2@example.com", "cm", "account2");
Individual user_individual = null;
aggregator.disconnect (individuals_changed_detailed_id);
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("");
+ ((!) this.kf_backend).set_up ("");
- void* account1_handle = this._tp_backend.add_account ("irc",
+ var tp_backend = (!) this.tp_backend;
+ void* account1_handle = tp_backend.add_account ("irc",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("irc",
+ void* account2_handle = tp_backend.add_account ("irc",
"me2@example.com", "cm", "account2");
/* Set up the aggregator */
aggregator.disconnect (individuals_changed_detailed_id);
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("[0]\n" +
+ ((!) this.kf_backend).set_up ("[0]\n" +
"protocol=travis@example.com;olivier@example.com;" +
"guillaume@example.com;sjoerd@example.com\n" +
"[1]\n" +
"protocol=christian@example.com;wim@example.com;" +
"helen@example.com;geraldine@example.com");
- void* account_handle = this._tp_backend.add_account ("protocol",
+ this.account_handle = ((!) this.tp_backend).add_account ("protocol",
"me@example.com", "cm", "account");
/* Weakly track all the individuals we see, and assert that they're
}
/* Remove all the individuals (hopefully) */
- this._tp_backend.remove_account (account_handle);
- this._kf_backend.tear_down ();
+ ((!) this.tp_backend).remove_account ((!) account_handle);
+ ((!) this.kf_backend).tear_down ();
aggregator_is_finalising = true;
aggregator = null;
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("[0]\n" +
+ ((!) this.kf_backend).set_up ("[0]\n" +
"protocol=travis@example.com\n");
Individual? individual = null;
assert (writeable_persona == persona);
/* Clean up for the next test */
- this._kf_backend.tear_down ();
aggregator = null;
}
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("");
- void* account_handle = this._tp_backend.add_account ("protocol",
+ ((!) this.kf_backend).set_up ("");
+ this.account_handle = ((!) this.tp_backend).add_account ("protocol",
"me@example.com", "cm", "account");
Individual? individual = null;
assert (writeable_persona != persona);
/* Clean up for the next test */
- this._tp_backend.remove_account (account_handle);
- this._kf_backend.tear_down ();
individual = null;
persona = null;
writeable_persona = null;
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("[0]\n" +
+ ((!) this.kf_backend).set_up ("[0]\n" +
"protocol=travis@example.com\n");
Individual? individual = null;
assert (writeable_persona == null);
/* Clean up for the next test */
- this._kf_backend.tear_down ();
aggregator = null;
}
}
public override void set_up ()
{
+ base.set_up ();
this._counter = 0;
this._calls_pending = 0;
this._counter_increment_pending = false;
}
- public override void tear_down ()
- {
- }
-
public void test_many_concurrent_funcs ()
{
_loop = new GLib.MainLoop (null, false);
public override void set_up ()
{
+ base.set_up ();
this._delete_cache_directory ();
this._cache = AvatarCache.dup ();
this._avatar = null;
this._cache = null;
this._delete_cache_directory ();
+ base.tear_down ();
}
protected void _delete_directory (File dir) throws GLib.Error
using Gee;
using Folks;
-public class BackendLoadingTests : Folks.TestCase
+public class BackendLoadingTests : TpfTest.MixedTestCase
{
- private TpTests.Backend _tp_backend;
- private void* _account_handle;
private MainLoop main_loop;
private static const string STORE_FILE_PATH = "folks-test-backend-store.ini";
{
base ("BackendLoading");
- this._tp_backend = new TpTests.Backend ();
-
this.add_test ("load and prep", this.test_load_and_prep);
this.add_test ("disabling", this.test_disabling);
this.add_test ("reloading", this.test_reloading);
public override void set_up ()
{
- this._tp_backend.set_up ();
- this._account_handle = this._tp_backend.add_account ("protocol",
- "me@example.com", "cm", "account");
+ base.set_up ();
/* Use a temporary key file for the BackendStore */
var kf_path = Path.build_filename (Environment.get_tmp_dir (),
FileUtils.remove (Path.build_filename (Environment.get_tmp_dir (),
this.STORE_FILE_PATH, null));
- this._tp_backend.remove_account (this._account_handle);
- this._tp_backend.tear_down ();
+ base.tear_down ();
}
public void test_load_and_prep ()
using Gee;
using Folks;
-public class InitTests : Folks.TestCase
+public class InitTests : TpfTest.MixedTestCase
{
- private KfTest.Backend _kf_backend;
- private TpTests.Backend _tp_backend;
private int _test_timeout = 5;
public InitTests ()
{
base ("Init");
- this._kf_backend = new KfTest.Backend ();
- this._tp_backend = new TpTests.Backend ();
-
/* Set up the tests */
this.add_test ("looped", this.test_looped);
this.add_test ("individual-count", this.test_individual_count);
}
- public override void set_up ()
+ public override void set_up_kf ()
{
- this._tp_backend.set_up ();
+ /* we do this in the individual tests */
}
- public override void tear_down ()
+ public override void set_up_tp ()
{
- this._tp_backend.tear_down ();
+ /* we do the account creation in the individual tests */
+ ((!) this.tp_backend).set_up ();
}
/* Prepare a load of aggregators in a tight loop, without waiting for any of
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up ("");
+ ((!) this.kf_backend).set_up ("");
- void* account1_handle = this._tp_backend.add_account ("protocol",
+ var tp_backend = (!) this.tp_backend;
+ void* account1_handle = tp_backend.add_account ("protocol",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("protocol",
+ void* account2_handle = tp_backend.add_account ("protocol",
"me2@example.com", "cm", "account2");
/* Wreak havoc. */
main_loop.run ();
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
}
/* Prepare an aggregator and wait for quiescence, then count how many
{
var main_loop = new GLib.MainLoop (null, false);
- this._kf_backend.set_up (
+ ((!) this.kf_backend).set_up (
"[0]\n" +
"msn=foo@hotmail.com\n" +
"[1]\n" +
"__alias=Bar McBadgerson\n" +
"jabber=bar@jabber.org\n");
- void* account1_handle = this._tp_backend.add_account ("protocol",
+ var tp_backend = (!) this.tp_backend;
+ void* account1_handle = tp_backend.add_account ("protocol",
"me@example.com", "cm", "account");
- void* account2_handle = this._tp_backend.add_account ("protocol",
+ void* account2_handle = tp_backend.add_account ("protocol",
"me2@example.com", "cm", "account2");
/* Run the test loop. */
main_loop.run ();
/* Clean up for the next test */
- this._tp_backend.remove_account (account2_handle);
- this._tp_backend.remove_account (account1_handle);
-
- this._kf_backend.tear_down ();
+ tp_backend.remove_account (account2_handle);
+ tp_backend.remove_account (account1_handle);
}
private async void _test_individual_count_loop ()
public override void set_up ()
{
+ base.set_up ();
this._delete_cache_directory ();
}
public override void tear_down ()
{
this._delete_cache_directory ();
+ base.tear_down ();
}
protected void _delete_directory (File dir) throws GLib.Error
this.add_test ("MultiMap equality", this.test_multi_map_equality);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_multi_map_equality ()
{
var a_1 = new HashMultiMap<string, string> ();
using Folks;
using KfTest;
-public class IndividualRetrievalTests : Folks.TestCase
+public class IndividualRetrievalTests : KfTest.TestCase
{
- private KfTest.Backend kf_backend;
private int _test_timeout = 3;
public IndividualRetrievalTests ()
{
base ("IndividualRetrieval");
- this.kf_backend = new KfTest.Backend ();
-
this.add_test ("singleton individuals", this.test_singleton_individuals);
this.add_test ("aliases", this.test_aliases);
this._test_timeout = 10;
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_singleton_individuals ()
{
var main_loop = new GLib.MainLoop (null, false);
+# Build . first so that backends' test libraries can link to libfolks-test.la
SUBDIRS = \
+ . \
key-file \
$(NULL)
libfolks_test_la_VALAFLAGS = \
$(ERROR_VALAFLAGS) \
$(AM_VALAFLAGS) \
- --vapidir=$(top_srcdir)/folks \
+ --vapidir=$(abs_top_srcdir)/folks \
+ --vapidir=$(abs_top_builddir)/folks \
--pkg gobject-2.0 \
--pkg gio-2.0 \
--pkg gee-0.8 \
$(NULL)
EXTRA_DIST = \
+ folks-test.deps \
$(MAINTAINERCLEANFILES) \
$(NULL)
--vapidir=$(top_srcdir)/folks \
--vapidir=$(top_srcdir)/backends/eds/lib \
--vapidir=$(top_srcdir)/backends/eds/vapi \
+ --vapidir=$(abs_top_srcdir)/tests/lib \
+ --vapidir=$(abs_top_builddir)/tests/lib \
--vapidir=. \
--pkg gobject-2.0 \
--pkg gio-2.0 \
--pkg libedataserver-1.2 \
--pkg libxml-2.0 \
--pkg folks-eds \
+ --pkg folks-test \
-g \
$(NULL)
libeds_test_la_SOURCES = \
backend.vala \
+ test-case.vala \
$(NULL)
libeds_test_la_CFLAGS = \
-I$(top_srcdir)/folks \
-I$(top_srcdir)/backends/eds/lib \
-I$(top_srcdir)/backends/eds/lib/folks \
+ -I$(top_srcdir)/tests/lib \
$(NULL)
libeds_test_la_LIBADD = \
$(top_builddir)/folks/libfolks.la \
$(top_builddir)/backends/eds/lib/libfolks-eds.la \
+ $(top_builddir)/tests/lib/libfolks-test.la \
$(EBOOK_LIBS) \
$(EDATASERVER_LIBS) \
$(GLIB_LIBS) \
--- /dev/null
+/* test-case.vala
+ *
+ * Copyright © 2011 Collabora Ltd.
+ * Copyright © 2013 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
+ */
+
+public class EdsTest.TestCase : Folks.TestCase
+{
+ public EdsTest.Backend eds_backend;
+
+ public TestCase (string name)
+ {
+ base (name);
+ }
+
+ public override void set_up ()
+ {
+ base.set_up ();
+ this.create_backend ();
+ this.configure_primary_store ();
+ }
+
+ public virtual void create_backend ()
+ {
+ this.eds_backend = new EdsTest.Backend ();
+ this.eds_backend.set_up ();
+ }
+
+ public virtual void configure_primary_store ()
+ {
+ /* By default, configure EDS as the primary store. */
+ var config_val = "eds:%s".printf (this.eds_backend.address_book_uid);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", config_val, true);
+ }
+
+ public override void tear_down ()
+ {
+ if (this.eds_backend != null)
+ {
+ ((!) this.eds_backend).tear_down ();
+ this.eds_backend = null;
+ }
+
+ Environment.unset_variable ("FOLKS_PRIMARY_STORE");
+
+ base.tear_down ();
+ }
+}
--- /dev/null
+glib-2.0
+gobject-2.0
+gio-2.0
+gee-0.8
+folks
$(ERROR_VALAFLAGS) \
--library=kf-test \
--header=kf-test.h \
- --vapidir=. \
+ --vapidir=$(abs_srcdir) \
+ --vapidir=$(abs_builddir) \
+ --vapidir=$(abs_top_srcdir)/folks \
+ --vapidir=$(abs_top_builddir)/folks \
+ --vapidir=$(abs_top_srcdir)/tests/lib \
+ --vapidir=$(abs_top_builddir)/tests/lib \
+ --pkg folks-test \
-g \
$(NULL)
libkf_test_la_SOURCES = \
backend.vala \
+ test-case.vala \
$(NULL)
libkf_test_la_CFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/tests/lib \
$(GLIB_CFLAGS) \
+ $(GEE_CFLAGS) \
$(NULL)
libkf_test_la_LIBADD = \
+ $(top_builddir)/tests/lib/libfolks-test.la \
$(GLIB_LIBS) \
+ $(GEE_LIBS) \
$(NULL)
MAINTAINERCLEANFILES = \
$(NULL)
EXTRA_DIST = \
+ kf-test.deps \
kf-test.vapi \
kf-test.h \
$(NULL)
--- /dev/null
+glib-2.0
+gobject-2.0
+gio-2.0
+gee-0.8
+folks
--- /dev/null
+/* test-case.vala
+ *
+ * Copyright © 2013 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
+ */
+
+public class KfTest.TestCase : Folks.TestCase
+{
+ public KfTest.Backend kf_backend;
+
+ public TestCase (string name)
+ {
+ base (name);
+
+ this.kf_backend = new KfTest.Backend ();
+ }
+}
--header=libsocialweb-test.h \
--vapidir=$(top_srcdir)/folks \
--vapidir=$(top_srcdir)/backends/libsocialweb/lib \
+ --vapidir=$(abs_top_srcdir)/tests/lib \
+ --vapidir=$(abs_top_builddir)/tests/lib \
--vapidir=. \
--pkg gobject-2.0 \
--pkg gio-2.0 \
--pkg folks \
--pkg libsocialweb-client \
--pkg folks-libsocialweb \
+ --pkg folks-test \
-g \
$(NULL)
libsocialweb_test_la_SOURCES = \
backend.vala \
+ test-case.vala \
$(NULL)
libsocialweb_test_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(GEE_CFLAGS) \
+ -I$(top_srcdir) \
-I$(top_srcdir)/backends/libsocialweb/lib \
+ -I$(top_srcdir)/tests/lib \
$(NULL)
libsocialweb_test_la_LIBADD = \
$(GEE_LIBS) \
$(top_builddir)/folks/libfolks.la \
$(top_builddir)/backends/libsocialweb/lib/libfolks-libsocialweb.la \
+ $(top_builddir)/tests/lib/libfolks-test.la \
$(NULL)
MAINTAINERCLEANFILES = \
--- /dev/null
+/* test-case.vala
+ *
+ * Copyright © 2011 Collabora Ltd.
+ * Copyright © 2013 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Alban Crequy <alban.crequy@collabora.co.uk>
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
+ */
+
+public class LibsocialwebTest.TestCase : Folks.TestCase
+{
+ public LibsocialwebTest.Backend? lsw_backend = null;
+
+ public TestCase (string name)
+ {
+ base (name);
+
+ this.lsw_backend = new LibsocialwebTest.Backend ();
+ }
+
+ public override void set_up ()
+ {
+ base.set_up ();
+
+ if (this.lsw_backend != null)
+ {
+ var lsw_backend = (!) this.lsw_backend;
+
+ var main_loop = new GLib.MainLoop (null, false);
+
+ this.lsw_backend.ready.connect (() =>
+ {
+ main_loop.quit ();
+ });
+ uint timer_id = Timeout.add_seconds (5, () =>
+ {
+ assert_not_reached ();
+ });
+
+ lsw_backend.set_up ();
+ main_loop.run ();
+ Source.remove (timer_id);
+ }
+ }
+
+ public override void tear_down ()
+ {
+ if (this.lsw_backend != null)
+ {
+ ((!) this.lsw_backend).tear_down ();
+ }
+
+ base.tear_down ();
+ }
+}
contactlist \
$(NULL)
+AM_VALAFLAGS += \
+ $(ERROR_VALAFLAGS) \
+ --library=tpf-test \
+ --header=tpf-test.h \
+ --vapidir=$(abs_srcdir) \
+ --vapidir=$(abs_builddir) \
+ --vapidir=$(abs_srcdir)/contactlist \
+ --vapidir=$(abs_builddir)/contactlist \
+ --vapidir=$(abs_top_srcdir)/folks \
+ --vapidir=$(abs_top_builddir)/folks \
+ --vapidir=$(abs_top_srcdir)/tests/lib \
+ --vapidir=$(abs_top_builddir)/tests/lib \
+ --vapidir=$(abs_top_srcdir)/tests/lib/key-file \
+ --vapidir=$(abs_top_builddir)/tests/lib/key-file \
+ --pkg folks-test \
+ --pkg kf-test \
+ --pkg tp-test-contactlist \
+ -g \
+ $(NULL)
+
+noinst_LTLIBRARIES = libtpf-test.la
+
+libtpf_test_la_SOURCES = \
+ test-case.vala \
+ $(NULL)
+
+libtpf_test_la_CFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/tests/lib \
+ -I$(top_srcdir)/tests/lib/key-file \
+ -I$(srcdir)/contactlist \
+ $(GLIB_CFLAGS) \
+ $(GEE_CFLAGS) \
+ $(TP_GLIB_CFLAGS) \
+ $(NULL)
+
+libtpf_test_la_LIBADD = \
+ $(top_builddir)/tests/lib/libfolks-test.la \
+ $(top_builddir)/tests/lib/key-file/libkf-test.la \
+ contactlist/libtp-test-contactlist.la \
+ $(GLIB_LIBS) \
+ $(GEE_LIBS) \
+ $(TP_GLIB_LIBS) \
+ $(NULL)
+
+MAINTAINERCLEANFILES = \
+ tpf-test.vapi \
+ tpf-test.h \
+ $(NULL)
+
+EXTRA_DIST = \
+ tpf-test.deps \
+ tpf-test.vapi \
+ tpf-test.h \
+ $(NULL)
+
+BUILT_SOURCES = \
+ libtpf_test_la_vala.stamp \
+ $(NULL)
+
+GITIGNOREFILES = \
+ $(libtpf_test_la_SOURCES:.vala=.c) \
+ libtpf_test_la_vala.stamp \
+ $(NULL)
+
-include $(top_srcdir)/git.mk
TpTestsBackendPrivate *priv = self->priv;
GError *error = NULL;
+ if (priv->daemon == NULL)
+ {
+ /* already torn down */
+ return;
+ }
+
/* Make sure all dbus trafic with AM is done */
tp_tests_proxy_run_until_dbus_queue_processed (priv->client_am);
g_clear_object (&priv->client_am);
--- /dev/null
+/* test-case.vala
+ *
+ * Copyright © 2011 Collabora Ltd.
+ * Copyright © 2013 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Travis Reitter <travis.reitter@collabora.co.uk>
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
+ */
+
+public class TpfTest.TestCase : Folks.TestCase
+{
+ public KfTest.Backend? kf_backend = null;
+ public TpTests.Backend? tp_backend = null;
+ public void *account_handle = null;
+
+ public virtual bool use_keyfile_too
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public TestCase (string name)
+ {
+ base (name);
+
+ this.create_kf_backend ();
+ this.create_tp_backend ();
+ }
+
+ public virtual void create_kf_backend ()
+ {
+ if (use_keyfile_too)
+ this.kf_backend = new KfTest.Backend ();
+ }
+
+ public virtual void create_tp_backend ()
+ {
+ this.tp_backend = new TpTests.Backend ();
+ }
+
+ public override void set_up ()
+ {
+ base.set_up ();
+ this.set_up_tp ();
+ this.set_up_kf ();
+ }
+
+ public virtual void set_up_tp ()
+ {
+ if (this.tp_backend != null)
+ {
+ var tp_backend = (!) this.tp_backend;
+
+ tp_backend.set_up ();
+ this.account_handle = tp_backend.add_account ("protocol",
+ "me@example.com", "cm", "account");
+ }
+ }
+
+ public virtual void set_up_kf ()
+ {
+ if (this.kf_backend != null)
+ ((!) this.kf_backend).set_up ("");
+ }
+
+ public override void tear_down ()
+ {
+ if (this.tp_backend != null)
+ {
+ var tp_backend = (!) this.tp_backend;
+
+ if (this.account_handle != null)
+ {
+ tp_backend.remove_account (account_handle);
+ this.account_handle = null;
+ }
+
+ tp_backend.tear_down ();
+ }
+
+ if (this.kf_backend != null)
+ {
+ ((!) this.kf_backend).tear_down ();
+ }
+
+ base.tear_down ();
+ }
+}
+
+public class TpfTest.MixedTestCase : TpfTest.TestCase
+{
+ public override bool use_keyfile_too
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public MixedTestCase (string name)
+ {
+ base (name);
+ }
+}
--- /dev/null
+glib-2.0
+gobject-2.0
+gio-2.0
+gee-0.8
+folks
+telepathy-glib
+tp-test-contactlist
/* testcase.vala
*
* Copyright (C) 2009 Julien Peeters
+ * Copyright (C) 2013 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* Author:
* Julien Peeters <contact@julienpeeters.fr>
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
*
* Copied from libgee/tests/testcase.vala.
*/
adaptor.name, adaptor.set_up, adaptor.run, adaptor.tear_down));
}
+ /* Set up for one test. If you have more than one test case, this will
+ * be called once per test. */
public virtual void set_up ()
{
}
+ /* Clean up after one test. If you have more than one test case, this will
+ * be called once per test. It should undo set_up (). */
public virtual void tear_down ()
{
}
+ /* Clean up after all tests. If you have more than one test case, this
+ * will be called once, the last time only. It should undo the
+ * constructor, and must be idempotent (i.e. OK to call more than once). */
+ public virtual void final_tear_down ()
+ {
+ }
+
+ ~TestCase ()
+ {
+ this.final_tear_down ();
+ }
+
public GLib.TestSuite get_suite ()
{
return this._suite;
--header=tracker-test.h \
--vapidir=$(top_srcdir)/folks \
--vapidir=$(top_srcdir)/backends/tracker/lib \
+ --vapidir=$(abs_top_srcdir)/tests/lib \
+ --vapidir=$(abs_top_builddir)/tests/lib \
--vapidir=. \
--pkg gobject-2.0 \
--pkg gio-2.0 \
--pkg folks \
--pkg tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
--pkg folks-tracker \
+ --pkg folks-test \
-g \
$(NULL)
libtracker_test_la_SOURCES = \
backend.vala \
+ test-case.vala \
$(NULL)
libtracker_test_la_CFLAGS = \
-I$(top_srcdir)/folks \
-I$(top_srcdir)/backends/tracker/lib \
-I$(top_srcdir)/backends/tracker/lib/folks \
+ -I$(top_srcdir)/tests/lib \
$(NULL)
libtracker_test_la_LIBADD = \
$(TRACKER_SPARQL_LIBS) \
$(top_builddir)/folks/libfolks.la \
$(top_builddir)/backends/tracker/lib/libfolks-tracker.la \
+ $(top_builddir)/tests/lib/libfolks-test.la \
$(NULL)
# XXX: automake's Vala support should make these unnecessary
--- /dev/null
+/* test-case.vala
+ *
+ * Copyright © 2013 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Simon McVittie <simon.mcvittie@collabora.co.uk>
+ */
+
+public class TrackerTest.TestCase : Folks.TestCase
+{
+ public TrackerTest.Backend? tracker_backend = null;
+
+ public TestCase (string name)
+ {
+ base (name);
+
+ this.tracker_backend = new TrackerTest.Backend ();
+ }
+
+ public override void tear_down ()
+ {
+ if (this.tracker_backend != null)
+ {
+ ((!) this.tracker_backend).tear_down ();
+ }
+
+ base.tear_down ();
+ }
+}
using Gee;
using GLib;
-public class AggregationTests : Folks.TestCase
+public class AggregationTests : LibsocialwebTest.TestCase
{
- private LibsocialwebTest.Backend _lsw_backend;
private static const string STORE_FILE_PATH =
"folks-test-libsocialweb-aggregation-store.ini";
private static const string KF_RELATIONSHIPS_FILE_PATH =
{
base ("Aggregation");
- this._lsw_backend = new LibsocialwebTest.Backend ();
-
this.add_test ("libsocialweb aggregation", this.test_aggregation_libsocialweb);
}
Environment.set_variable ("FOLKS_BACKEND_STORE_KEY_FILE_PATH",
kf_path, true);
- }
- public override void tear_down ()
- {
+ /* Chain up to set up the LSW backend */
+ base.set_up ();
}
public void test_aggregation_libsocialweb ()
{
var main_loop = new GLib.MainLoop (null, false);
-
- this._lsw_backend.ready.connect(() =>
- {
- main_loop.quit ();
- });
- uint timer_id = Timeout.add_seconds (5, () =>
- {
- assert_not_reached ();
- });
- this._lsw_backend.set_up ();
- main_loop.run ();
- Source.remove (timer_id);
-
- var mysocialnetwork1 = this._lsw_backend.add_service ("mysocialnetwork1");
- var mysocialnetwork2 = this._lsw_backend.add_service ("mysocialnetwork2");
+ var lsw_backend = (!) this.lsw_backend;
+ var mysocialnetwork1 = lsw_backend.add_service ("mysocialnetwork1");
+ var mysocialnetwork2 = lsw_backend.add_service ("mysocialnetwork2");
/* Populate mysocialnetwork1 */
mysocialnetwork1.OpenViewCalled.connect((query, p, path) =>
});
aggregator.prepare.begin ();
- timer_id = Timeout.add_seconds (5, () =>
+ uint timer_id = Timeout.add_seconds (5, () =>
{
assert_not_reached ();
});
});
main_loop.run ();
Source.remove (timer_id);
-
- this._lsw_backend.tear_down ();
}
}
using GLib;
using SocialWebClient;
-public class DummyLswTests : Folks.TestCase
+public class DummyLswTests : LibsocialwebTest.TestCase
{
- private LibsocialwebTest.Backend _lsw_backend;
-
public DummyLswTests ()
{
base ("DummyLsw");
- this._lsw_backend = new LibsocialwebTest.Backend ();
-
this.add_test ("dummy libsocialweb", this.test_dummy_libsocialweb);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_dummy_libsocialweb ()
{
var main_loop = new GLib.MainLoop (null, false);
- this._lsw_backend.ready.connect(() =>
- {
- main_loop.quit ();
- });
- uint timer_id = Timeout.add_seconds (5, () =>
- {
- assert_not_reached ();
- });
- this._lsw_backend.set_up ();
- main_loop.run ();
- Source.remove (timer_id);
-
- var mysocialnetwork = this._lsw_backend.add_service ("mysocialnetwork");
+ var lsw_backend = (!) this.lsw_backend;
+ var mysocialnetwork = lsw_backend.add_service ("mysocialnetwork");
var p = new GLib.HashTable<string,string> (null, null);
try
assert_not_reached ();
}
-
- timer_id = Timeout.add_seconds (5, () =>
+ uint timer_id = Timeout.add_seconds (5, () =>
{
assert_not_reached ();
});
main_loop.run ();
Source.remove (timer_id);
aggregator.disconnect (handler_id);
-
- this._lsw_backend.tear_down ();
}
}
-I$(top_srcdir)/backends/telepathy/lib \
-I$(top_srcdir)/backends/telepathy/lib/folks \
-I$(top_srcdir)/tests/lib \
+ -I$(top_srcdir)/tests/lib/key-file \
+ -I$(top_srcdir)/tests/lib/telepathy \
-I$(top_srcdir)/tests/lib/telepathy/contactlist \
-include $(CONFIG_HEADER) \
$(NULL)
LDADD = \
$(top_builddir)/tests/lib/libfolks-test.la \
+ $(top_builddir)/tests/lib/key-file/libkf-test.la \
+ $(top_builddir)/tests/lib/telepathy/libtpf-test.la \
$(top_builddir)/tests/lib/telepathy/contactlist/libtp-test-contactlist.la \
$(top_builddir)/backends/telepathy/lib/libfolks-telepathy.la \
$(top_builddir)/folks/libfolks.la \
$(ERROR_VALAFLAGS) \
--vapidir=$(abs_top_srcdir)/tests/lib/telepathy/contactlist/ \
--vapidir=$(abs_top_builddir)/tests/lib/telepathy/contactlist/ \
+ --vapidir=$(abs_top_srcdir)/tests/lib/telepathy \
+ --vapidir=$(abs_top_builddir)/tests/lib/telepathy \
+ --vapidir=$(abs_top_srcdir)/tests/lib/key-file \
+ --vapidir=$(abs_top_builddir)/tests/lib/key-file \
--vapidir=$(abs_top_srcdir)/tests/lib/ \
--vapidir=$(abs_top_builddir)/tests/lib/ \
--vapidir=$(abs_srcdir) \
--pkg folks \
--pkg folks-telepathy \
--pkg folks-test \
+ --pkg kf-test \
+ --pkg tpf-test \
--pkg tp-test-contactlist \
-g \
$(NULL)
using Folks;
using Gee;
-public class IndividualPropertiesTests : Folks.TestCase
+public class IndividualPropertiesTests : TpfTest.TestCase
{
- private TpTests.Backend tp_backend;
- private void* _account_handle;
private int _test_timeout = 3;
private HashSet<string> _changes_pending;
{
base ("IndividualProperties");
- this.tp_backend = new TpTests.Backend ();
-
this.add_test ("individual properties",
this.test_individual_properties);
this.add_test ("individual properties:change alias through tp backend",
public override void set_up ()
{
- this.tp_backend.set_up ();
- this._account_handle = this.tp_backend.add_account ("protocol",
- "me@example.com", "cm", "account");
- this._changes_pending = new HashSet<string> ();
- }
+ base.set_up ();
- public override void tear_down ()
- {
- this.tp_backend.remove_account (this._account_handle);
- this.tp_backend.tear_down ();
+ this._changes_pending = new HashSet<string> ();
}
public void test_individual_properties ()
/* set the alias through Telepathy and wait for it to hit our
* alias notification callback above */
var handle = (Handle) ((Tpf.Persona) persona).contact.handle;
- var conn = this.tp_backend.get_connection_for_handle (this._account_handle);
+ var conn = this.tp_backend.get_connection_for_handle (this.account_handle);
conn.change_aliases ({handle}, {new_alias});
}
using Folks;
using Gee;
-public class IndividualRetrievalTests : Folks.TestCase
+public class IndividualRetrievalTests : TpfTest.TestCase
{
- private TpTests.Backend tp_backend;
- private void* _account_handle;
private HashSet<string> default_individuals;
private int _test_timeout = 3;
{
base ("IndividualRetrieval");
- this.tp_backend = new TpTests.Backend ();
-
/* IDs of the individuals we expect to see.
* These are externally opaque, but internally are SHA-1 hashes of the
* concatenated UIDs of the Personas in the Individual. In these cases,
this._test_timeout = 10;
}
- public override void set_up ()
- {
- this.tp_backend.set_up ();
- this._account_handle = this.tp_backend.add_account ("protocol",
- "me@example.com", "cm", "account");
- }
-
- public override void tear_down ()
- {
- this.tp_backend.remove_account (this._account_handle);
- this.tp_backend.tear_down ();
- }
-
public void test_aggregator ()
{
var main_loop = new GLib.MainLoop (null, false);
using Gee;
using Folks;
-public class InitTests : Folks.TestCase
+public class InitTests : TpfTest.TestCase
{
- private TpTests.Backend _tp_backend;
private int _test_timeout = 5;
public InitTests ()
{
base ("Init");
- this._tp_backend = new TpTests.Backend ();
-
/* Set up the tests */
this.add_test ("quiescence", this.test_quiescence);
}
- public override void set_up ()
- {
- this._tp_backend.set_up ();
- }
-
- public override void tear_down ()
- {
- this._tp_backend.tear_down ();
- }
-
/* Prepare an aggregator and wait for quiescence, then quit. Error if reaching
* quiescence takes too long. */
public void test_quiescence ()
{
var main_loop = new GLib.MainLoop (null, false);
- void* account_handle = this._tp_backend.add_account ("protocol",
- "me@example.com", "cm", "account");
-
/* Main test code. */
var aggregator = new IndividualAggregator ();
/* Check results. */
assert (aggregator.is_quiescent == true);
assert (aggregator.individuals.size > 0);
-
- /* Clean up for the next test */
- this._tp_backend.remove_account (account_handle);
}
}
using Folks;
using Gee;
-public class PersonaStoreCapabilitiesTests : Folks.TestCase
+public class PersonaStoreCapabilitiesTests : TpfTest.TestCase
{
- private TpTests.Backend tp_backend;
- private void* _account_handle;
private HashSet<string> _capabilities_received;
private int _test_timeout = 3;
{
base ("PersonaStoreCapabilities");
- this.tp_backend = new TpTests.Backend ();
-
this.add_test ("persona store capabilities",
this.test_persona_store_capabilities);
public override void set_up ()
{
- this._capabilities_received = new HashSet<string> ();
-
- this.tp_backend.set_up ();
- this._account_handle = this.tp_backend.add_account ("protocol",
- "me@example.com", "cm", "account");
- }
+ base.set_up ();
- public override void tear_down ()
- {
- this.tp_backend.remove_account (this._account_handle);
- this.tp_backend.tear_down ();
+ this._capabilities_received = new HashSet<string> ();
}
public void test_persona_store_capabilities ()
using Folks;
using Gee;
-public class AddContactTests : Folks.TestCase
+public class AddContactTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private bool _contact_added;
private IndividualAggregator _aggregator;
private string _persona_fullname;
{
base ("AddContactTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test adding contacts ", this.test_add_contact);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_add_contact ()
{
this._main_loop = new GLib.MainLoop (null, false);
Gee.HashMap<string, string> c1 = new Gee.HashMap<string, string> ();
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ var tracker_backend = (!) this.tracker_backend;
+ tracker_backend.add_contact (c1);
+ tracker_backend.set_up ();
this._test_add_contact_async.begin ();
this._main_loop.run ();
assert (this._contact_added == true);
- this._tracker_backend.tear_down ();
}
private async void _test_add_contact_async ()
using Folks;
using Gee;
-public class AddPersonaTests : Folks.TestCase
+public class AddPersonaTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private string _persona_nickname;
{
base ("AddPersonaTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test adding personas to Tracker ", this.test_add_persona);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_add_persona ()
{
this._main_loop = new GLib.MainLoop (null, false);
{
assert (k);
}
-
- this._tracker_backend.tear_down ();
}
private async void _test_add_persona_async ()
using Folks;
using Gee;
-public class AdditionalNamesUpdatesTests : Folks.TestCase
+public class AdditionalNamesUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_additional_names_found;
private string _updated_additional_names;
{
base ("AdditionalNamesUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("additional names updates",
this.test_additional_names_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_additional_names_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_ADDITIONAL,
this._initial_additional_names);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_additional_names_found = false;
this._updated_additional_names_found = false;
assert (this._initial_additional_names_found == true);
assert (this._updated_additional_names_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_additional_names_updates_async (BackendStore store)
(this._notify_additional_names_cb);
this._individual_id = i.id;
this._initial_additional_names_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_ADDITIONAL,
this._updated_additional_names);
}
using Folks;
using Gee;
-public class AvatarDetailsInterfaceTests : Folks.TestCase
+public class AvatarDetailsInterfaceTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private string _avatar_uri;
private bool _avatars_are_equal;
private GLib.MainLoop _main_loop;
{
base ("AvatarDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test avatar details interface",
this.test_avatar_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_avatar_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #1");
c1.set (Trf.OntologyDefs.NCO_PHOTO, this._avatar_uri);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
test_avatar_details_interface_async.begin ();
this._main_loop.run ();
assert (this._avatars_are_equal);
- this._tracker_backend.tear_down ();
}
private async void test_avatar_details_interface_async ()
using Folks;
using Gee;
-public class AvatarUpdatesTests : Folks.TestCase
+public class AvatarUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_avatar_found;
private string _updated_avatar_uri;
{
base ("AvatarUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("avatar updates", this.test_avatar_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_avatar_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_PHOTO, this._initial_avatar_uri);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_avatar_found = false;
this._updated_avatar_found = false;
assert (this._initial_avatar_found == true);
assert (this._updated_avatar_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void test_avatar_updates_async ()
{
this._initial_avatar_found = true;
- this._tracker_backend.remove_triplet (this._contact_urn,
+ ((!) this.tracker_backend).remove_triplet (this._contact_urn,
Trf.OntologyDefs.NCO_PHOTO, this._photo_urn);
string photo_urn_2 = "<" + this._updated_avatar_uri;
photo_urn_2 += ">";
- this._tracker_backend.insert_triplet (photo_urn_2,
+ ((!) this.tracker_backend).insert_triplet (photo_urn_2,
"a", "nfo:Image, nie:DataObject",
Trf.OntologyDefs.NIE_URL,
this._updated_avatar_uri);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(this._contact_urn,
Trf.OntologyDefs.NCO_PHOTO, photo_urn_2);
using Folks;
using Gee;
-public class BirthdayDetailsInterfaceTests : Folks.TestCase
+public class BirthdayDetailsInterfaceTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private bool _found_birthday;
private DateTime _dobj;
private GLib.MainLoop _main_loop;
{
base ("BirthdayDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("test birthday details interface",
this.test_birthay_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_birthay_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname);
c1.set (Trf.OntologyDefs.NCO_BIRTHDAY, birthday);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
this._found_birthday = false;
this._main_loop.run ();
assert (this._found_birthday == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_birthay_details_interface ()
using Folks;
using Gee;
-public class BirthdayUpdatesTests : Folks.TestCase
+public class BirthdayUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _initial_birthday;
private string _updated_birthday;
{
base ("BirthdayUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("birthday updates", this.test_birthday_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_birthday_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_BIRTHDAY, this._initial_birthday);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_birthday_found = false;
this._updated_birthday_found = false;
assert (this._initial_birthday_found == true);
assert (this._updated_birthday_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void test_birthday_updates_async ()
{
this._individual_id = i.id;
this._initial_birthday_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_BIRTHDAY, this._updated_birthday);
}
}
{
this._individual_id = i.id;
this._initial_birthday_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_BIRTHDAY, this._updated_birthday);
}
else if (i.birthday.compare (this._updated_bday_obj) == 0)
using Folks;
using Gee;
-public class DefaultContactTests : Folks.TestCase
+public class DefaultContactTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private bool _found_default_user;
private bool _found_not_user;
private bool _found_unknown_user;
{
base ("DefaultContactTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test default contact", this.test_default_contact);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_default_contact ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._fullname_persona = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname_persona);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_default_user = false;
this._found_not_user = false;
assert (this._found_default_user == true);
assert (this._found_not_user == true);
assert (this._found_unknown_user == false);
-
- this._tracker_backend.tear_down ();
}
private async void _test_default_contact_async ()
using Folks;
using Gee;
-public class DuplicatedEmailsTests : Folks.TestCase
+public class DuplicatedEmailsTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "persona #1";
private string _persona_fullname_2 = "persona #2";
{
base ("DuplicatedEmailsTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test adding 2 personas with the same email address ",
this.test_duplicated_emails);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_duplicated_emails ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class DuplicatedPhonesTests : Folks.TestCase
+public class DuplicatedPhonesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "persona #1";
private string _persona_fullname_2 = "persona #2";
{
base ("DuplicatedPhonesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test adding 2 personas with the same phone number ",
this.test_duplicated_phones);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_duplicated_phones ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class EmailDetailsInterfaceTests : Folks.TestCase
+public class EmailDetailsInterfaceTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
private int _num_emails;
{
base ("EmailDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test email details interface",
this.test_email_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_email_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #1");
c1.set (Trf.OntologyDefs.NCO_EMAIL_PROP,
"test1@example.org,test2@example.org");
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._num_emails = 0;
this._found_email_1 = false;
assert (this._num_emails == 2);
assert (this._found_email_1 == true);
assert (this._found_email_2 == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_email_details_interface_async ()
using Folks;
using Gee;
-public class EmailsUpdatesTests : Folks.TestCase
+public class EmailsUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private string _individual_id;
{
base ("EmailsUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("emails updates", this.test_emails_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_emails_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn_1);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_1);
c1.set (Trf.OntologyDefs.NCO_EMAIL_PROP, this._email_1);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._individual_id = "";
this._initial_email_found = false;
assert (initial_email_found_again == false);
assert (this._updated_email_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_emails_updates_async ()
this._initial_email_found = true;
var urn_email_1 = "<" + this._email_1 + ">";
- this._tracker_backend.remove_triplet (this._contact_urn_1,
+ ((!) this.tracker_backend).remove_triplet (
+ this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, urn_email_1);
var urn_email_2 = "<email:" + this._email_2 + ">";
- this._tracker_backend.insert_triplet (urn_email_2,
+ ((!) this.tracker_backend).insert_triplet (urn_email_2,
"a", Trf.OntologyDefs.NCO_EMAIL,
Trf.OntologyDefs.NCO_EMAIL_PROP,
this._email_2);
var affl_2 = "<" + this._email_2 + ">";
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(affl_2,
"a", Trf.OntologyDefs.NCO_AFFILIATION);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(affl_2,
Trf.OntologyDefs.NCO_HAS_EMAIL, urn_email_2);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, affl_2);
}
using Folks;
using Gee;
-public class FamilyNameUpdatesTests : Folks.TestCase
+public class FamilyNameUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private bool _initial_family_name_found;
{
base ("FamilyNameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("family name updates", this.test_family_name_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_family_name_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_FAMILY, this._initial_family_name);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_family_name_found = false;
this._updated_family_name_found = false;
assert (this._initial_family_name_found == true);
assert (this._updated_family_name_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_family_name_updates_async ()
{
this._individual_id = i.id;
this._initial_family_name_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_FAMILY, this._updated_family_name);
}
}
using Folks;
using Gee;
-public class FavouriteDetailsInterfaceTests : Folks.TestCase
+public class FavouriteDetailsInterfaceTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private GLib.MainLoop _main_loop;
private string _fullname_p1;
private string _fullname_p2;
{
base ("FavouriteDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test favourite details interface",
this.test_favourite_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_favourite_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname_p1);
c1.set (Trf.OntologyDefs.NAO_TAG, "");
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
c2.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname_p2);
c2.set (Trf.OntologyDefs.NAO_TAG, "");
- this._tracker_backend.add_contact (c2);
+ ((!) this.tracker_backend).add_contact (c2);
c3.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname_p3);
- this._tracker_backend.add_contact (c3);
+ ((!) this.tracker_backend).add_contact (c3);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_p1 = false;
this._found_p2 = false;
assert (this._found_p1 == true);
assert (this._found_p2 == true);
assert (this._found_p3 == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_favourite_details_interface_async ()
using Folks;
using Gee;
-public class FavouriteUpdatesTests : Folks.TestCase
+public class FavouriteUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _is_favourite_1;
private string _individual_id_1;
{
base ("FavouriteUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("favourite update", this.test_favourite_update);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_favourite_update ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn_1);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_1);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
c2.set (TrackerTest.Backend.URN, this._contact_urn_2);
c2.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_2);
c2.set (Trf.OntologyDefs.NAO_TAG, "");
- this._tracker_backend.add_contact (c2);
+ ((!) this.tracker_backend).add_contact (c2);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._is_favourite_1 = false;
this._individual_id_1 = "";
assert (this._is_favourite_1 == true);
assert (this._is_favourite_2 == false);
-
- this._tracker_backend.tear_down ();
}
private async void _test_favourite_update_async ()
i.notify["is-favourite"].connect
(this._notify_favourite_cb);
this._individual_id_1 = i.id;
- this._tracker_backend.update_favourite (this._contact_urn_1,
+ ((!) this.tracker_backend).update_favourite (this._contact_urn_1,
true);
}
else if (i.full_name == this._initial_fullname_2)
// HACK: we need to make sure the INSERT event was delivered
Timeout.add_seconds (1, () =>
{
- this._tracker_backend.update_favourite
+ ((!) this.tracker_backend).update_favourite
(this._contact_urn_2, false);
return false;
});
using Folks;
using Gee;
-public class FullnameUpdatesTests : Folks.TestCase
+public class FullnameUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_name_found;
private bool _deleted_name_found;
{
base ("FullnameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("fullname updates", this.test_fullname_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_fullname_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_name_found = false;
this._updated_name_found = false;
assert (this._initial_name_found == true);
assert (this._updated_name_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_fullname_updates_async ()
i.notify["full-name"].connect (this._notify_full_name_cb);
this._individual_id = i.id;
this._initial_name_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_FULLNAME, this._updated_fullname);
}
}
using Folks;
using Gee;
-public class GenderDetailsInterfaceTests : Folks.TestCase
+public class GenderDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private bool _found_gender;
private string _gender;
private string _fullname;
{
base ("GenderDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("test gender details interface",
this.test_gender_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_gender_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname);
c1.set (Trf.OntologyDefs.NCO_GENDER, this._gender);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
this._found_gender = false;
this._main_loop.run ();
assert (this._found_gender == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_gender_details_interface_async ()
using Folks;
using Gee;
-public class GivenNameUpdatesTests : Folks.TestCase
+public class GivenNameUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_given_name_found;
private string _updated_given_name;
{
base ("GivenNameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("given name updates", this.test_given_name_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_given_name_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_GIVEN, this._initial_given_name);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_given_name_found = false;
this._updated_given_name_found = false;
assert (this._initial_given_name_found == true);
assert (this._updated_given_name_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_given_name_updates_async ()
{
this._individual_id = i.id;
this._initial_given_name_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_GIVEN, this._updated_given_name);
}
}
using Folks;
using Gee;
-public class ImDetailsInterfaceTests : Folks.TestCase
+public class ImDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private int _num_addrs;
private bool _found_addr_1;
{
base ("ImDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test im details interface",
this.test_im_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_im_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname);
c1.set (Trf.OntologyDefs.NCO_IMADDRESS,
"jabber#test1@example.org,aim#test2@example.org");
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._num_addrs = 0;
this._found_addr_1 = false;
assert (this._num_addrs == 2);
assert (this._found_addr_1 == true);
assert (this._found_addr_2 == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_im_details_interface_async ()
using Folks;
using Gee;
-public class IMAddressesUpdatesTests : Folks.TestCase
+public class IMAddressesUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private string _initial_fullname_1;
{
base ("IMAddressesUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("im addresses updates", this.test_imaddresses_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_imaddresses_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn_1);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_1);
c1.set (Trf.OntologyDefs.NCO_IMADDRESS, this._imaddress_proto_1);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
this._individual_id = "";
this._initial_imaddress_found = false;
assert (this._initial_imaddress_found == true);
assert (this._updated_imaddr_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_imaddresses_updates_async ()
private void _do_im_addr_update ()
{
var urn_affil_1 = "<" + this._imaddress_1 + "myaffiliation>";
- this._tracker_backend.remove_triplet (this._contact_urn_1,
+ ((!) this.tracker_backend).remove_triplet (this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, urn_affil_1);
var urn_imaddr_2 = "<" + this._imaddress_2 + ">";
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(urn_imaddr_2,
"a", Trf.OntologyDefs.NCO_IMADDRESS,
Trf.OntologyDefs.NCO_IMPROTOCOL, this._proto_2,
var urn_affil_2 = "<" + this._imaddress_2;
urn_affil_2 += "myaffiliation>";
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(urn_affil_2,
"a", Trf.OntologyDefs.NCO_AFFILIATION);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(urn_affil_2,
Trf.OntologyDefs.NCO_HAS_IMADDRESS, urn_imaddr_2);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, urn_affil_2);
}
using Folks;
using Gee;
-public class IndividualRetrievalTests : Folks.TestCase
+public class IndividualRetrievalTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private Gee.HashMap<string, string> _c1;
private Gee.HashMap<string, string> _c2;
{
base ("IndividualRetrieval");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("singleton individuals", this.test_singleton_individuals);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_singleton_individuals ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._c2 = new Gee.HashMap<string, string> ();
this._c1.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #1");
- this._tracker_backend.add_contact (this._c1);
+ ((!) this.tracker_backend).add_contact (this._c1);
this._c2.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #2");
- this._tracker_backend.add_contact (this._c2);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (this._c2);
+ ((!) this.tracker_backend).set_up ();
this._test_singleton_individuals_async.begin ();
assert (this._c1.size == 0);
assert (this._c2.size == 0);
-
- this._tracker_backend.tear_down ();
}
private async void _test_singleton_individuals_async ()
using Folks;
using Gee;
-public class LinkPersonasViaLocalIDsTests : Folks.TestCase
+public class LinkPersonasViaLocalIDsTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1;
private string _persona_fullname_2;
{
base ("LinkPersonasViaLocalIDsTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test linking personas",
this.test_linking_personas_via_local_ids);
}
public override void set_up ()
{
+ base.set_up ();
+
Environment.set_variable ("FOLKS_PRIMARY_STORE", "tracker", true);
/* FIXME: this set_up method takes care both of setting
* the connection with Tracker and adding the contacts
* needed for the tests. We might need to trigger those
* actions at separate points so we should decouple them. */
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
}
public override void tear_down ()
{
- this._tracker_backend.tear_down ();
-
Environment.unset_variable ("FOLKS_PRIMARY_STORE");
+ base.tear_down ();
}
public void test_linking_personas_via_local_ids ()
using Folks;
using Gee;
-public class LinkPersonasTests : Folks.TestCase
+public class LinkPersonasTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1;
private string _persona_fullname_2;
{
base ("LinkPersonasTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test linking personas", this.test_linking_personas);
}
public override void set_up ()
{
+ base.set_up ();
+
Environment.set_variable ("FOLKS_PRIMARY_STORE", "tracker", true);
/* FIXME: this set_up method takes care both of setting
* the connection with Tracker and adding the contacts
* needed for the tests. We might need to trigger those
* actions at separate points so we should decouple them. */
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
}
public override void tear_down ()
{
- this._tracker_backend.tear_down ();
Environment.unset_variable ("FOLKS_PRIMARY_STORE");
+ base.tear_down ();
}
public void test_linking_personas ()
using Folks;
using Gee;
-public class MatchAllTests : Folks.TestCase
+public class MatchAllTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator = null;
private string _persona_fullname_1 = "Bernie Innocenti";
private string _persona_fullname_2 = "Bernardo H. Innocenti";
{
base ("MatchAllTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match all ",
this.test_match_all);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_match_all ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class MatchEmailAddressesTests : Folks.TestCase
+public class MatchEmailAddressesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "aaa";
private string _persona_fullname_2 = "bbb";
{
base ("MatchEmailAddressesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match with same email addresses ",
this.test_match_email_addresses);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_match_email_addresses ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class MatchIMAddressesTests : Folks.TestCase
+public class MatchIMAddressesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "aaa";
private string _persona_fullname_2 = "bbb";
{
base ("MatchIMAddressesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match by IM addresses ",
this.test_match_im_addresses);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_match_im_addresses ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class MatchKnownEmailsTests : Folks.TestCase
+public class MatchKnownEmailsTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
/* Make sure the names are completely different so
{
base ("MatchKnownEmailsTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match with same email addresses ",
this.test_match_email_addresses);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_match_email_addresses ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class MatchNameTests : Folks.TestCase
+public class MatchNameTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator = null;
private string _persona_fullname_1 = "Bernie Innocenti";
private string _persona_fullname_2 = "Bernardo H. Innocenti";
{
base ("MatchNameTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match by name #1 ",
this.test_match_name_1);
this.add_test ("test potential match by name #2 ",
this.test_match_name_6);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
private void _test_match_name (string full_name1, string full_name2)
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class MatchPhoneNumberTests : Folks.TestCase
+public class MatchPhoneNumberTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "aaa";
private string _persona_fullname_2 = "bbb";
{
base ("MatchPhoneNumberTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test potential match with phone numbers ",
this.test_match_phone_number);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_match_phone_number ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class NameDetailsInterfaceTests : Folks.TestCase
+public class NameDetailsInterfaceTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private GLib.MainLoop _main_loop;
private Gee.HashMap<string, string> _c1;
{
base ("NameDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test name details interface",
this.test_name_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_name_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._c1.set (Trf.OntologyDefs.NCO_ADDITIONAL, "p #1 Additional");
this._c1.set (Trf.OntologyDefs.NCO_PREFIX, "Mr");
this._c1.set (Trf.OntologyDefs.NCO_SUFFIX, "Jr");
- this._tracker_backend.add_contact (this._c1);
+ ((!) this.tracker_backend).add_contact (this._c1);
this._c2.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #2");
- this._tracker_backend.add_contact (this._c2);
+ ((!) this.tracker_backend).add_contact (this._c2);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._test_name_details_interface_async.begin ();
assert (this._c1.size == 0);
assert (this._c2.size == 0);
-
- this._tracker_backend.tear_down ();
}
private async void _test_name_details_interface_async ()
using Folks;
using Gee;
-public class NicknameUpdatesTests : Folks.TestCase
+public class NicknameUpdatesTests : TrackerTest.TestCase
{
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_nickname_found;
private string _updated_nickname;
{
base ("NicknameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("nickname updates", this.test_nickname_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_nickname_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._updated_nickname_found = false;
this._individual_id = "";
this._main_loop.run ();
assert (this._updated_nickname_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_nickname_updates_async ()
this._individual_id = i.id;
var im_addr = "<urn:im-address>";
- this._tracker_backend.insert_triplet (im_addr,
+ ((!) this.tracker_backend).insert_triplet (im_addr,
"a", Trf.OntologyDefs.NCO_IMADDRESS,
Trf.OntologyDefs.NCO_IM_NICKNAME, this._updated_nickname);
var affl = "<urn:im-affl>";
- this._tracker_backend.insert_triplet (affl,
+ ((!) this.tracker_backend).insert_triplet (affl,
"a", Trf.OntologyDefs.NCO_AFFILIATION);
- this._tracker_backend.insert_triplet (affl,
+ ((!) this.tracker_backend).insert_triplet (affl,
Trf.OntologyDefs.NCO_HAS_IMADDRESS, im_addr);
- this._tracker_backend.insert_triplet (this._contact_urn,
+ ((!) this.tracker_backend).insert_triplet (this._contact_urn,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, affl);
}
}
using Folks;
using Gee;
-public class NoteDetailsInterfaceTests : Folks.TestCase
+public class NoteDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private bool _found_note;
private string _note;
private string _fullname = "persona #1";
{
base ("NoteDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("test note details interface",
this.test_note_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_note_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname);
c1.set (Trf.OntologyDefs.NCO_NOTE, this._note);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_note = false;
this._main_loop.run ();
assert (this._found_note == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_note_details_interface_async ()
using Folks;
using Gee;
-public class PhoneDetailsInterfaceTests : Folks.TestCase
+public class PhoneDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private int _num_phones = 0;
private bool _found_phone_1 = false;
private bool _found_phone_2 = false;
{
base ("PhoneDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test phone details interface",
this.test_phone_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_phone_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #1");
c1.set (Trf.OntologyDefs.NCO_PHONE_PROP, "12345,54321");
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._num_phones = 0;
this._found_phone_1 = false;
assert (this._num_phones == 2);
assert (this._found_phone_1 == true);
assert (this._found_phone_2 == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_phone_details_interface_async ()
using Folks;
using Gee;
-public class PhonesUpdatesTests : Folks.TestCase
+public class PhonesUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _initial_fullname_1;
private string _contact_urn_1;
{
base ("PhonesUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("phones updates", this.test_phones_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_phones_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn_1);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_1);
c1.set (Trf.OntologyDefs.NCO_PHONE_PROP, this._phone_1);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._individual_id = "";
this._initial_phone_found = false;
assert (this._initial_phone_found == true);
assert (this._initial_phone_found_again == false);
assert (this._updated_phone_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_phones_updates_async ()
private void _update_phone ()
{
var urn_phone_1 = "<" + this._phone_1 + ">";
- this._tracker_backend.remove_triplet (this._contact_urn_1,
+ ((!) this.tracker_backend).remove_triplet (this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, urn_phone_1);
var urn_phone_2 = "<phone:" + this._phone_2 + ">";
- this._tracker_backend.insert_triplet (urn_phone_2,
+ ((!) this.tracker_backend).insert_triplet (urn_phone_2,
"a", Trf.OntologyDefs.NCO_PHONE,
Trf.OntologyDefs.NCO_PHONE_PROP,
this._phone_2);
var affl_2 = "<" + this._phone_2 + ">";
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(affl_2,
"a", Trf.OntologyDefs.NCO_AFFILIATION);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(affl_2,
Trf.OntologyDefs.NCO_HAS_PHONE, urn_phone_2);
- this._tracker_backend.insert_triplet
+ ((!) this.tracker_backend).insert_triplet
(this._contact_urn_1,
Trf.OntologyDefs.NCO_HAS_AFFILIATION, affl_2);
}
using Folks;
using Gee;
-public class PostalAddressDetailsInterfaceTests : Folks.TestCase
+public class PostalAddressDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private string _pobox = "12345";
private string _district = "example district";
private string _county = "example country";
{
base ("PostalAddressDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test postal address details interface",
this.test_postal_address_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_postal_address_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
postal_info += this._region;
c1.set (Trf.OntologyDefs.NCO_POSTAL_ADDRESS, postal_info);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
this._found_postal_address = false;
this._main_loop.run ();
assert (this._found_postal_address == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_postal_address_details_interface_async ()
using Folks;
using Gee;
-public class PrefixNameUpdatesTests : Folks.TestCase
+public class PrefixNameUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_prefix_name_found;
private bool _initial_prefix_name_found;
{
base ("PrefixNameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("prefix name updates", this.test_prefix_name_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_prefix_name_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_PREFIX, this._initial_prefix_name);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_prefix_name_found = false;
this._updated_prefix_name_found = false;
assert (this._initial_prefix_name_found == true);
assert (this._updated_prefix_name_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_prefix_name_updates_async ()
(this._notify_prefix_name_cb);
this._individual_id = i.id;
this._initial_prefix_name_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_PREFIX, this._updated_prefix_name);
}
}
using Folks;
using Gee;
-public class RemoveContactTests : Folks.TestCase
+public class RemoveContactTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _contact_added;
private bool _contact_removed;
{
base ("RemoveContactTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test removing contacts ", this.test_remove_contact);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_remove_contact ()
{
this._main_loop = new GLib.MainLoop (null, false);
Gee.HashMap<string, string> c1 = new Gee.HashMap<string, string> ();
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).add_contact (c1);
+ ((!) this.tracker_backend).set_up ();
this._contact_added = false;
this._contact_removed = false;
assert (this._contact_added == true);
assert (this._contact_removed == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_remove_contact_async ()
foreach (var persona in i.personas)
{
var contact_id = persona.iid.split (":")[1];
- this._tracker_backend.remove_contact (contact_id);
+ ((!) this.tracker_backend).remove_contact (contact_id);
}
}
}
using Folks;
using Gee;
-public class RemovePersonaTests : Folks.TestCase
+public class RemovePersonaTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _persona_removed;
{
base ("RemovePersonaTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test adding personas to Tracker ", this.test_remove_persona);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_remove_persona ()
{
this._main_loop = new GLib.MainLoop (null, false);
assert (this._persona_removed == true);
assert (this._individual_removed == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_remove_persona_async ()
using Folks;
using Gee;
-public class RoleDetailsInterfaceTests : Folks.TestCase
+public class RoleDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private bool _found_role;
private string _fullname;
private string _affiliaton;
{
base ("RoleDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("test role details interface",
this.test_role_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_role_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._fullname);
c1.set (Trf.OntologyDefs.NCO_HAS_AFFILIATION, this._affiliaton);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_role = false;
this._main_loop.run ();
assert (this._found_role == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_role_details_interface_async ()
using Folks;
using Gee;
-public class SetAvatarTests : Folks.TestCase
+public class SetAvatarTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private LoadableIcon _avatar;
{
base ("SetAvatarTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting avatar ", this.test_set_avatar);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_avatar ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._avatar = new FileIcon (File.new_for_path (_avatar_path));
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._avatar_found = false;
this._main_loop.run ();
assert (this._avatar_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_avatar_async ()
using Folks;
using Gee;
-public class SetBirthdayTests : Folks.TestCase
+public class SetBirthdayTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _bday_found;
{
base ("SetBirthdayTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting bithday ",
this.test_set_bday);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_bday ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
this._birthday = "2001-10-26T20:32:52Z";
TimeVal t = TimeVal ();
t.from_iso8601 (this._birthday);
this._bday = new DateTime.from_timeval_utc (t);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._bday_found = false;
this._main_loop.run ();
assert (this._bday_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_bday_async ()
using Folks;
using Gee;
-public class SetDuplicateEmailTests : Folks.TestCase
+public class SetDuplicateEmailTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname_1 = "persona #1";
private string _email_1 = "some-address@example.org";
{
base ("SetDuplicateEmailTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test re-setting an existing e-mail address",
this.test_set_duplicate_email);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- this._tracker_backend.tear_down ();
- }
-
public void test_set_duplicate_email ()
{
this._main_loop = new GLib.MainLoop (null, false);
using Folks;
using Gee;
-public class SetEmailsTests : Folks.TestCase
+public class SetEmailsTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private string _email_1;
{
base ("SetEmailsTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting emails ", this.test_set_emails);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_emails ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._email_2 = "email-2@example.org";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._email_1_found = false;
this._email_2_found = false;
assert (this._email_1_found);
assert (this._email_2_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_emails_async ()
using Folks;
using Gee;
-public class SetFavouriteTests : Folks.TestCase
+public class SetFavouriteTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _initial_fullname_1 = "persona #1";
private string _initial_fullname_2 = "persona #2";
{
base ("SetFavouriteTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting favourite ", this.test_set_alias);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_alias ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._initial_fullname_2 = "persona #2";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_1);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
c2.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname_2);
c2.set (Trf.OntologyDefs.NAO_TAG, "");
- this._tracker_backend.add_contact (c2);
+ ((!) this.tracker_backend).add_contact (c2);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._c1_initially_not_favourite = false;
this._c1_finally_favourite = false;
assert (this._c1_finally_favourite);
assert (this._c2_initially_favourite);
assert (this._c2_finally_not_favourite);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_alias_async ()
using Folks;
using Gee;
-public class SetFullNameTests : Folks.TestCase
+public class SetFullNameTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _found_changed_full_name ;
{
base ("SetFullNameTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting structured name ",
this.test_set_full_name);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_full_name ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._modified_fullname = "modified - persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_changed_full_name = false;
this._main_loop.run ();
assert (this._found_changed_full_name);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_full_name_async ()
using Folks;
using Gee;
-public class SetGenderTests : Folks.TestCase
+public class SetGenderTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _gender_found;
{
base ("SetGenderTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting gender ",
this.test_set_gender);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_gender ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._gender_found = false;
this._main_loop.run ();
assert (this._gender_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_gender_async ()
using Folks;
using Gee;
-public class SetIMAddressesTests : Folks.TestCase
+public class SetIMAddressesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private GLib.List<string> _addresses =
{
base ("SetIMAddressesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting im_addresses ", this.test_set_im_addresses);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_im_addresses ()
{
this._initial_individual_found = false;
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
this._addresses.prepend ("one@example.org");
this._addresses.prepend ("two@example.org");
this._addresses.prepend ("three@example.org");
this._addresses.prepend ("four@example.org");
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._test_set_im_addresses_async.begin ();
assert (this._initial_individual_found);
assert (this._addresses.length () == 0);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_im_addresses_async ()
using Folks;
using Gee;
-public class SetNicknameTests : Folks.TestCase
+public class SetNicknameTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private string _initial_nickname;
{
base ("SetNicknameTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting nickname ", this.test_set_nickname);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_nickname ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
c1.set (Trf.OntologyDefs.NCO_NICKNAME, this._initial_nickname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_nickname_found = false;
this._modified_nickname_found = false;
assert (this._initial_nickname_found == true);
assert (this._modified_nickname_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_nickname_async ()
using Folks;
using Gee;
-public class SetNotesTests : Folks.TestCase
+public class SetNotesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _note_found;
{
base ("SetNotesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting notes ",
this.test_set_notes);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_notes ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
this._note = new NoteFieldDetails ("some note");
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._note_found = false;
this._main_loop.run ();
assert (this._note_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_notes_async ()
using Folks;
using Gee;
-public class SetNullAvatarTests : Folks.TestCase
+public class SetNullAvatarTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _null_avatar_set;
{
base ("SetNullAvatarTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting null avatar ", this.test_set_null_avatar);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_null_avatar ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._null_avatar_set = false;
this._main_loop.run ();
assert (this._null_avatar_set);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_null_avatar_async ()
using Folks;
using Gee;
-public class SetPhonesTests : Folks.TestCase
+public class SetPhonesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private string _phone_1;
{
base ("SetPhonesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting phones ", this.test_set_phones);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_phones ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._phone_2 = "54321";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._phone_1_found = false;
this._phone_2_found = false;
assert (this._phone_1_found);
assert (this._phone_2_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_phones_async ()
using Folks;
using Gee;
-public class SetPostalAddressesTests : Folks.TestCase
+public class SetPostalAddressesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _postal_address_found;
{
base ("SetPostalAddressesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting postal addresses ",
this.test_set_postal_addresses);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_postal_addresses ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
var pa = new PostalAddress (null, null, null, null, null,
null, null, null, null);
pa.region = "some region";
this._postal_address_fd = new PostalAddressFieldDetails (pa);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._postal_address_found = false;
this._main_loop.run ();
assert (this._postal_address_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_postal_addresses_async ()
using Folks;
using Gee;
-public class SetRolesTests : Folks.TestCase
+public class SetRolesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _role_found;
{
base ("SetRolesTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting roles ",
this.test_set_roles);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_roles ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._persona_fullname = "persona #1";
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
var role = new Role ("some title", "some organisation");
role.role = "some role";
this._role_fd = new RoleFieldDetails (role);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._role_found = false;
this._main_loop.run ();
assert (this._role_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_roles_async ()
using Folks;
using Gee;
-public class SetStructuredNameTests : Folks.TestCase
+public class SetStructuredNameTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
private bool _sname_found;
{
base ("SetStructuredNameTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting structured name ",
this.test_set_structured_name);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_structured_name ()
{
this._main_loop = new GLib.MainLoop (null, false);
this._additional_names, this._prefixes, this._suffixes);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._sname_found = false;
this._main_loop.run ();
assert (this._sname_found);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_structured_name_async ()
using Folks;
using Gee;
-public class SetURLsTests : Folks.TestCase
+public class SetURLsTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private string _persona_fullname;
Gee.HashMap<string, string> _urls;
{
base ("SetURLsTests");
- this._tracker_backend = new TrackerTest.Backend ();
-
this.add_test ("test setting urls ", this.test_set_urls);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_set_urls ()
{
this._main_loop = new GLib.MainLoop (null, false);
"http://three.example.org");
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._persona_fullname);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._test_set_urls_async.begin ();
this._main_loop.run ();
assert (this._urls.size == 0);
-
- this._tracker_backend.tear_down ();
}
private async void _test_set_urls_async ()
using Folks;
using Gee;
-public class SuffixNameUpdatesTests : Folks.TestCase
+public class SuffixNameUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_suffix_name_found;
private bool _deleted_suffix_name_found;
{
base ("SuffixNameUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("suffix name updates", this.test_suffix_name_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_suffix_name_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (Trf.OntologyDefs.NCO_SUFFIX, this._initial_suffix_name);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_suffix_name_found = false;
this._updated_suffix_name_found = false;
assert (this._initial_suffix_name_found == true);
assert (this._updated_suffix_name_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_suffix_name_updates_async ()
(this._notify_suffix_name_cb);
this._individual_id = i.id;
this._initial_suffix_name_found = true;
- this._tracker_backend.update_contact (this._contact_urn,
+ ((!) this.tracker_backend).update_contact (this._contact_urn,
Trf.OntologyDefs.NCO_SUFFIX, this._updated_suffix_name);
}
}
using Folks;
using Gee;
-public class UrlDetailsInterfaceTests : Folks.TestCase
+public class UrlDetailsInterfaceTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
private IndividualAggregator _aggregator;
- private TrackerTest.Backend _tracker_backend;
private string _blog_url;
private string _website_url;
private string _urls;
{
base ("UrlDetailsInterfaceTests");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("test url details interface",
this.test_url_details_interface);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_url_details_interface ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, "persona #1");
c1.set (TrackerTest.Backend.URLS, this._urls);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._found_blog = false;
this._found_website = false;
assert (this._found_blog == true);
assert (this._found_website == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_url_details_interface_async ()
using Folks;
using Gee;
-public class WebsiteUpdatesTests : Folks.TestCase
+public class WebsiteUpdatesTests : TrackerTest.TestCase
{
private GLib.MainLoop _main_loop;
- private TrackerTest.Backend _tracker_backend;
private IndividualAggregator _aggregator;
private bool _updated_website_found;
private bool _deleted_website_found;
{
base ("WebsiteUpdates");
- this._tracker_backend = new TrackerTest.Backend ();
- this._tracker_backend.debug = false;
+ ((!) this.tracker_backend).debug = false;
this.add_test ("websites updates", this.test_website_updates);
}
- public override void set_up ()
- {
- }
-
- public override void tear_down ()
- {
- }
-
public void test_website_updates ()
{
this._main_loop = new GLib.MainLoop (null, false);
c1.set (TrackerTest.Backend.URN, this._contact_urn);
c1.set (Trf.OntologyDefs.NCO_FULLNAME, this._initial_fullname);
c1.set (TrackerTest.Backend.URLS, this._initial_website);
- this._tracker_backend.add_contact (c1);
+ ((!) this.tracker_backend).add_contact (c1);
- this._tracker_backend.set_up ();
+ ((!) this.tracker_backend).set_up ();
this._initial_website_found = false;
this._updated_website_found = false;
assert (this._initial_website_found == true);
assert (this._updated_website_found == true);
-
- this._tracker_backend.tear_down ();
}
private async void _test_website_updates_async ()
{
this._initial_website_found = true;
string affl = "<affl:website>";
- this._tracker_backend.insert_triplet (affl,
+ ((!) this.tracker_backend).insert_triplet (affl,
"a", Trf.OntologyDefs.NCO_AFFILIATION,
Trf.OntologyDefs.NCO_WEBSITE, this._updated_website);
- this._tracker_backend.insert_triplet (this._contact_urn,
+ ((!) this.tracker_backend).insert_triplet (
+ this._contact_urn,
Trf.OntologyDefs.NCO_HAS_AFFILIATION,
affl);
}