start and stop the application correctly
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/79992023 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/79992023 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/79992023 Branch: refs/heads/1994-merge-rcouch Commit: 799920234ceb4db5cec2d07ecd7a0643d2f12e18 Parents: a92ef9a Author: benoitc <[email protected]> Authored: Mon Jan 13 22:30:39 2014 +0100 Committer: Paul J. Davis <[email protected]> Committed: Wed Feb 12 18:16:58 2014 -0600 ---------------------------------------------------------------------- test/02-httpc-pool.t | 8 ++------ test/03-replication-compact.t | 21 ++++++--------------- test/04-replication-large-atts.t | 10 ++-------- test/05-replication-many-leaves.t | 10 +++------- test/06-doc-missing-stubs.t | 9 ++------- test/07-use-checkpoints.t | 9 ++------- 6 files changed, 17 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/02-httpc-pool.t ---------------------------------------------------------------------- diff --git a/test/02-httpc-pool.t b/test/02-httpc-pool.t index 9446c9b..560b6a1 100755 --- a/test/02-httpc-pool.t +++ b/test/02-httpc-pool.t @@ -15,8 +15,6 @@ % the License. main(_) -> - test_util:init_code_path(), - etap:plan(55), case (catch test()) of ok -> @@ -29,15 +27,13 @@ main(_) -> test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - ibrowse:start(), + test_util:start_couch(), test_pool_full(), test_worker_dead_pool_non_full(), test_worker_dead_pool_full(), - couch_server_sup:stop(), + test_util:stop_couch(), ok. http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/03-replication-compact.t ---------------------------------------------------------------------- diff --git a/test/03-replication-compact.t b/test/03-replication-compact.t index d89a539..699f698 100755 --- a/test/03-replication-compact.t +++ b/test/03-replication-compact.t @@ -69,10 +69,8 @@ source_db_name() -> <<"couch_test_rep_db_a">>. target_db_name() -> <<"couch_test_rep_db_b">>. -main(_) -> - test_util:init_code_path(), - - etap:plan(376), +main(_) -> +etap:plan(376), case (catch test()) of ok -> etap:end_tests(); @@ -84,11 +82,7 @@ main(_) -> test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - couch_replicator_sup:start_link(), - - ibrowse:start(), + test_util:start_couch(), Pairs = [ {source_db_name(), target_db_name()}, @@ -119,16 +113,13 @@ test() -> delete_db(SourceDb), delete_db(TargetDb), - couch_server_sup:stop(), - couch_replicator_sup:stop(), - + test_util:stop_couch(), ok = timer:sleep(1000), - couch_server_sup:start_link(test_util:config_files()), - couch_replicator_sup:start_link() + test_util:start_couch() end, Pairs), - couch_server_sup:stop(), + test_util:stop_couch(), ok. http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/04-replication-large-atts.t ---------------------------------------------------------------------- diff --git a/test/04-replication-large-atts.t b/test/04-replication-large-atts.t index 04e7861..c001f3e 100755 --- a/test/04-replication-large-atts.t +++ b/test/04-replication-large-atts.t @@ -51,8 +51,6 @@ target_db_name() -> <<"couch_test_rep_db_b">>. main(_) -> - test_util:init_code_path(), - etap:plan(1192), case (catch test()) of ok -> @@ -65,12 +63,8 @@ main(_) -> test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - couch_replicator_sup:start_link(), + test_util:start_couch(), - application:start(ibrowse), - application:start(crypto), couch_config:set("attachments", "compressible_types", "text/*", false), Pairs = [ @@ -103,7 +97,7 @@ test() -> Pairs), delete_db(SourceDb), - couch_server_sup:stop(), + test_util:stop_couch(), ok. http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/05-replication-many-leaves.t ---------------------------------------------------------------------- diff --git a/test/05-replication-many-leaves.t b/test/05-replication-many-leaves.t index fbb9d95..c4c0007 100755 --- a/test/05-replication-many-leaves.t +++ b/test/05-replication-many-leaves.t @@ -77,12 +77,8 @@ main(_) -> test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - couch_replicator_sup:start_link(), - - ibrowse:start(), - crypto:start(), + test_util:start_couch(), + couch_config:set("replicator", "connection_timeout", "90000", false), Pairs = [ @@ -130,7 +126,7 @@ test() -> end, Pairs), - couch_server_sup:stop(), + test_util:stop_couch(), ok. http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/06-doc-missing-stubs.t ---------------------------------------------------------------------- diff --git a/test/06-doc-missing-stubs.t b/test/06-doc-missing-stubs.t index 5fbb7f3..5db5830 100755 --- a/test/06-doc-missing-stubs.t +++ b/test/06-doc-missing-stubs.t @@ -54,8 +54,6 @@ target_revs_limit() -> 3. main(_) -> - test_util:init_code_path(), - etap:plan(128), case (catch test()) of ok -> @@ -69,10 +67,7 @@ main(_) -> % Test motivated by COUCHDB-1365. test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - couch_replicator_sup:start_link(), - ibrowse:start(), + test_util:start_couch(), Pairs = [ {source_db_name(), target_db_name()}, @@ -113,7 +108,7 @@ test() -> end, Pairs), - couch_server_sup:stop(), + test_util:stop_couch(), ok. http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/79992023/test/07-use-checkpoints.t ---------------------------------------------------------------------- diff --git a/test/07-use-checkpoints.t b/test/07-use-checkpoints.t index 193b17d..9f975e2 100755 --- a/test/07-use-checkpoints.t +++ b/test/07-use-checkpoints.t @@ -79,8 +79,6 @@ target_db_name() -> <<"couch_test_rep_db_b">>. main(_) -> - test_util:init_code_path(), - etap:plan(16), case (catch test()) of ok -> @@ -93,15 +91,12 @@ main(_) -> test() -> - couch_server_sup:start_link(test_util:config_files()), - couch_httpd_sup:start_link(), - couch_replicator_sup:start_link(), - ibrowse:start(), + test_util:start_couch(), test_use_checkpoints(false), test_use_checkpoints(true), - couch_server_sup:stop(), + test_util:stop_couch(), ok.
