Revert "add unit test for bgo#705289"
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 5 Aug 2013 09:21:15 +0000 (11:21 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 5 Aug 2013 11:26:53 +0000 (13:26 +0200)
It doesn't make sense any more as multiple aggregators are not supported any
more.

This reverts commit 1b7e8d83bb7488aac7bcf2d59df3a7b35f316ae2.

tests/eds/Makefile.am
tests/eds/double-aggregator.vala [deleted file]

index 1c45cb6..08f9275 100644 (file)
@@ -69,7 +69,6 @@ TESTS = \
        set-phones \
        set-postal-addresses \
        link-personas \
-       double-aggregator \
        set-notes \
        add-contacts-stress-test \
        set-gender \
@@ -248,10 +247,6 @@ helper_prepare_aggregator_SOURCES = \
        helper-prepare-aggregator.vala \
        $(NULL)
 
-double_aggregator_SOURCES = \
-       double-aggregator.vala \
-       $(NULL)
-
 CLEANFILES = \
        *.pid \
        *.address \
diff --git a/tests/eds/double-aggregator.vala b/tests/eds/double-aggregator.vala
deleted file mode 100644 (file)
index ec57346..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * 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 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, see <http://www.gnu.org/licenses/>.
- *
- * Authors: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
- *
- */
-
-using EdsTest;
-using Folks;
-using Gee;
-
-public class DoubleAggregatorTests : EdsTest.TestCase
-{
-  private IndividualAggregator _aggregator;
-  private IndividualAggregator _aggregator2;
-  private GLib.MainLoop _main_loop;
-  private int _test_num = -1;
-
-  public DoubleAggregatorTests ()
-    {
-      base ("DoubleAggregator");
-
-      this.add_test ("unlink double aggregator", this.test_unlink);
-      this.add_test ("remove double aggregator", this.test_remove);
-    }
-
-  public override void set_up ()
-    {
-      base.set_up ();
-
-      this._main_loop = new GLib.MainLoop (null, false);
-      this._aggregator = new IndividualAggregator ();
-    }
-
-  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 = new EdsTest.Backend ();
-      this.eds_backend.set_up (false, @"test$_test_num");
-    }
-
-  public override void tear_down ()
-    {
-      this._aggregator = null;
-      this._aggregator2 = null;
-      this._main_loop = null;
-
-      base.tear_down ();
-    }
-
-  void test_unlink ()
-    {
-      this._prepare_test ();
-
-      this._unlink_individuals.begin ((o, r) =>
-        {
-          this._unlink_individuals.end (r);
-        });
-      TestUtils.loop_run_with_timeout (this._main_loop);
-    }
-
-  void test_remove ()
-    {
-      this._prepare_test ();
-
-      this._remove_individual.begin ((o, r) =>
-        {
-          this._remove_individual.end (r);
-        });
-      TestUtils.loop_run_with_timeout (this._main_loop);
-    }
-
-  void _prepare_test ()
-    {
-      // ADD 2 EDS contacts
-      Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();
-      var v = Value (typeof (string));
-      v.set_string ("Badger");
-      c1.set ("full_name", (owned) v);
-      this.eds_backend.add_contact (c1);
-
-      Gee.HashMap<string, Value?> c2 = new Gee.HashMap<string, Value?> ();
-      v = Value (typeof (string));
-      v.set_string ("Mushroom");
-      c2.set ("full_name", (owned) v);
-      this.eds_backend.add_contact (c2);
-
-      this._do_test_async.begin ();
-      TestUtils.loop_run_with_timeout (this._main_loop);
-    }
-
-  private async void _prepare_aggregator (IndividualAggregator aggregator)
-    {
-      try
-         {
-           yield aggregator.prepare ();
-         }
-       catch (GLib.Error e)
-         {
-           GLib.error ("Error when calling prepare: %s\n", e.message);
-         }
-    }
-
-  private async void _do_test_async ()
-    {
-      yield this.eds_backend.commit_contacts_to_addressbook ();
-
-      this._aggregator.notify["is-quiescent"].connect (this._link_individuals);
-      yield this._prepare_aggregator (this._aggregator);
-    }
-
-  private async void _link_individuals ()
-    {
-      /* Link both individuals */
-      assert (this._aggregator.individuals.size == 2);
-
-      var personas = new HashSet<Persona> ();
-
-      foreach (var individual in this._aggregator.individuals.values)
-        foreach (var persona in individual.personas)
-          personas.add (persona);
-
-      try
-        {
-          yield this._aggregator.link_personas (personas);
-        }
-      catch (GLib.Error e)
-        {
-          GLib.error ("link_personas: %s\n", e.message);
-        }
-
-      /* Individuals have been linked together */
-      assert (this._aggregator.individuals.size == 1);
-
-      this._aggregator2 = new IndividualAggregator ();
-      this._aggregator2.notify["is-quiescent"].connect (this._aggregator2_is_quiescent);
-      yield this._prepare_aggregator (this._aggregator2);
-    }
-
-  private void _aggregator2_is_quiescent ()
-    {
-      this._main_loop.quit ();
-    }
-
-  private async void _unlink_individuals ()
-    {
-      assert (this._aggregator.individuals.size == 1);
-
-      var individuals = this._aggregator.individuals.values.to_array ();
-
-      try
-        {
-          yield this._aggregator.unlink_individual (individuals[0]);
-        }
-      catch (GLib.Error e)
-        {
-          GLib.error ("unlink_individual: %s\n", e.message);
-        }
-
-      this._main_loop.quit ();
-    }
-
-  private async void _remove_individual ()
-    {
-      assert (this._aggregator.individuals.size == 1);
-
-      var individuals = this._aggregator.individuals.values.to_array ();
-
-      try
-        {
-          yield this._aggregator.remove_individual (individuals[0]);
-        }
-      catch (GLib.Error e)
-        {
-          GLib.error ("remove_individual: %s\n", e.message);
-        }
-
-      this._main_loop.quit ();
-    }
-}
-
-public int main (string[] args)
-{
-  Test.init (ref args);
-
-  var tests = new DoubleAggregatorTests ();
-  tests.register ();
-  Test.run ();
-  tests.final_tear_down ();
-
-  return 0;
-}