You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2014/08/28 01:42:27 UTC

[12/14] couch-replicator commit: updated refs/heads/1963-eunit-bigcouch to 7e6e105

Switch to using test_util:{start,stop}_couch


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/43250764
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/43250764
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/43250764

Branch: refs/heads/1963-eunit-bigcouch
Commit: 43250764d87596a5c263c5f615725d7696c7e871
Parents: 39a6496
Author: Russell Branca <ch...@apache.org>
Authored: Wed Aug 27 16:40:51 2014 -0700
Committer: Russell Branca <ch...@apache.org>
Committed: Wed Aug 27 16:40:51 2014 -0700

----------------------------------------------------------------------
 test/couch_replicator_compact_tests.erl         | 13 ++-----------
 test/couch_replicator_httpc_pool_tests.erl      | 16 +---------------
 test/couch_replicator_large_atts_tests.erl      | 13 ++-----------
 test/couch_replicator_many_leaves_tests.erl     | 13 ++-----------
 test/couch_replicator_missing_stubs_tests.erl   | 13 ++-----------
 test/couch_replicator_use_checkpoints_tests.erl | 13 ++-----------
 6 files changed, 11 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_compact_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_compact_tests.erl b/test/couch_replicator_compact_tests.erl
index 407695e..09140ed 100644
--- a/test/couch_replicator_compact_tests.erl
+++ b/test/couch_replicator_compact_tests.erl
@@ -34,7 +34,7 @@ setup(local) ->
 setup(remote) ->
     {remote, setup()};
 setup({A, B}) ->
-    {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
+    ok = test_util:start_couch(),
     Source = setup(A),
     Target = setup(B),
     {Source, Target}.
@@ -49,16 +49,7 @@ teardown(_, {Source, Target}) ->
     teardown(Source),
     teardown(Target),
 
-    Pid = whereis(couch_server_sup),
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT_STOP ->
-        throw({timeout, server_stop})
-    end.
-
+    ok = test_util:stop_couch().
 
 compact_test_() ->
     Pairs = [{local, local}, {local, remote},

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_httpc_pool_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_httpc_pool_tests.erl b/test/couch_replicator_httpc_pool_tests.erl
index b65d174..d067f94 100644
--- a/test/couch_replicator_httpc_pool_tests.erl
+++ b/test/couch_replicator_httpc_pool_tests.erl
@@ -18,20 +18,6 @@
 -define(TIMEOUT, 1000).
 
 
-start() ->
-    {ok, Pid} = couch_server_sup:start_link(?CONFIG_CHAIN),
-    Pid.
-
-stop(Pid) ->
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT ->
-        throw({timeout, server_stop})
-    end.
-
 setup() ->
     spawn_pool().
 
@@ -44,7 +30,7 @@ httpc_pool_test_() ->
         "httpc pool tests",
         {
             setup,
-            fun start/0, fun stop/1,
+            fun test_util:start_couch/0, fun test_util:stop_couch/1,
             {
                 foreach,
                 fun setup/0, fun teardown/1,

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_large_atts_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_large_atts_tests.erl b/test/couch_replicator_large_atts_tests.erl
index b821a18..71293d8 100644
--- a/test/couch_replicator_large_atts_tests.erl
+++ b/test/couch_replicator_large_atts_tests.erl
@@ -33,8 +33,8 @@ setup(local) ->
 setup(remote) ->
     {remote, setup()};
 setup({A, B}) ->
-    {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
     couch_config:set("attachments", "compressible_types", "text/*", false),
+    ok = test_util:start_couch(),
     Source = setup(A),
     Target = setup(B),
     {Source, Target}.
@@ -49,16 +49,7 @@ teardown(_, {Source, Target}) ->
     teardown(Source),
     teardown(Target),
 
-    Pid = whereis(couch_server_sup),
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT_STOP ->
-        throw({timeout, server_stop})
-    end.
-
+    ok = test_util:stop_couch().
 
 large_atts_test_() ->
     Pairs = [{local, local}, {local, remote},

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_many_leaves_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_many_leaves_tests.erl b/test/couch_replicator_many_leaves_tests.erl
index 0a75da7..cf56440 100644
--- a/test/couch_replicator_many_leaves_tests.erl
+++ b/test/couch_replicator_many_leaves_tests.erl
@@ -38,7 +38,7 @@ setup(local) ->
 setup(remote) ->
     {remote, setup()};
 setup({A, B}) ->
-    {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
+    ok = test_util:start_couch(),
     Source = setup(A),
     Target = setup(B),
     {Source, Target}.
@@ -53,16 +53,7 @@ teardown(_, {Source, Target}) ->
     teardown(Source),
     teardown(Target),
 
-    Pid = whereis(couch_server_sup),
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT_STOP ->
-        throw({timeout, server_stop})
-    end.
-
+    ok = test_util:stop_couch().
 
 docs_with_many_leaves_test_() ->
     Pairs = [{local, local}, {local, remote},

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_missing_stubs_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_missing_stubs_tests.erl b/test/couch_replicator_missing_stubs_tests.erl
index 713ab01..df8685e 100644
--- a/test/couch_replicator_missing_stubs_tests.erl
+++ b/test/couch_replicator_missing_stubs_tests.erl
@@ -31,7 +31,7 @@ setup(local) ->
 setup(remote) ->
     {remote, setup()};
 setup({A, B}) ->
-    {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
+    ok = test_util:start_couch(),
     Source = setup(A),
     Target = setup(B),
     {Source, Target}.
@@ -46,16 +46,7 @@ teardown(_, {Source, Target}) ->
     teardown(Source),
     teardown(Target),
 
-    Pid = whereis(couch_server_sup),
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT_STOP ->
-        throw({timeout, server_stop})
-    end.
-
+    ok = test_util:stop_couch().
 
 missing_stubs_test_() ->
     Pairs = [{local, local}, {local, remote},

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/43250764/test/couch_replicator_use_checkpoints_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_use_checkpoints_tests.erl b/test/couch_replicator_use_checkpoints_tests.erl
index 69ac661..edb8ec1 100644
--- a/test/couch_replicator_use_checkpoints_tests.erl
+++ b/test/couch_replicator_use_checkpoints_tests.erl
@@ -52,7 +52,7 @@ setup(local) ->
 setup(remote) ->
     {remote, setup()};
 setup({_, Fun, {A, B}}) ->
-    {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
+    ok = test_util:start_couch(),
     {ok, Listener} = couch_replicator_notifier:start_link(Fun),
     Source = setup(A),
     Target = setup(B),
@@ -69,16 +69,7 @@ teardown(_, {Source, Target, Listener}) ->
     teardown(Target),
 
     couch_replicator_notifier:stop(Listener),
-    Pid = whereis(couch_server_sup),
-    erlang:monitor(process, Pid),
-    couch_server_sup:stop(),
-    receive
-        {'DOWN', _, _, Pid, _} ->
-            ok
-    after ?TIMEOUT_STOP ->
-        throw({timeout, server_stop})
-    end.
-
+    ok = test_util:stop_couch().
 
 use_checkpoints_test_() ->
     {