[folks] Fix link-personas-diff-stores unit test. Remove obsolete EDS TestBackend address_uri. Allow choosing



commit bf289030eab2459b9d64afe84ad3304bc61265c9
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Wed Jun 20 12:19:19 2012 -0600

    Fix link-personas-diff-stores unit test.
    Remove obsolete EDS TestBackend address_uri.
    Allow choosing other or test source in set_up method.

 tests/eds/link-personas-diff-stores.vala |    3 +--
 tests/lib/eds/backend.vala               |   13 +++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/tests/eds/link-personas-diff-stores.vala b/tests/eds/link-personas-diff-stores.vala
index 39fde70..bfbecdf 100644
--- a/tests/eds/link-personas-diff-stores.vala
+++ b/tests/eds/link-personas-diff-stores.vala
@@ -47,10 +47,9 @@ public class LinkPersonasDiffStoresTests : Folks.TestCase
     {
       this._eds_backend = new EdsTest.Backend ();
       this._eds_backend_other = new EdsTest.Backend ();
-      this._eds_backend_other.address_book_uri = "local://other";
 
       this._eds_backend.set_up ();
-      this._eds_backend_other.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);
diff --git a/tests/lib/eds/backend.vala b/tests/lib/eds/backend.vala
index 0ddee4e..afeac3e 100644
--- a/tests/lib/eds/backend.vala
+++ b/tests/lib/eds/backend.vala
@@ -32,6 +32,7 @@ errordomain EdsTest.BackendSetupError
 
 public class EdsTest.Backend
 {
+  private string _source_name;
   private string _addressbook_name;
   private E.BookClient _addressbook;
   private GLib.List<string> _e_contacts;
@@ -39,11 +40,6 @@ public class EdsTest.Backend
   E.SourceRegistry _source_registry;
   E.Source _source;
 
-  public string address_book_uri
-    {
-      get; set; default = "local://test";
-    }
-
   public string address_book_uid
     {
       get { return this._addressbook.get_source ().get_uid (); }
@@ -99,15 +95,16 @@ public class EdsTest.Backend
     }
 
   /* Create a temporary addressbook */
-  public void set_up (bool source_is_default = false)
+  public void set_up (bool source_is_default = false, string name = "test")
     {
       try
         {
+          this._source_name = name;
           this._prepare_source (source_is_default);
           this._addressbook = new BookClient (this._source);
           this._addressbook.open_sync (false, null);
           this._addressbook_name =
-            this._source.get_display_name ();
+            this._addressbook.get_source().get_uid ();
           Environment.set_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS",
                                     this._addressbook_name, true);
         }
@@ -133,7 +130,7 @@ public class EdsTest.Backend
           GLib.critical (e.message);
         }
 
-      this._source = this._source_registry.ref_source("test");
+      this._source = this._source_registry.ref_source(this._source_name);
 
       if (is_default)
         set_as_default();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]