couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [1/5] config commit: updated refs/heads/master to b281825
Date Wed, 04 Feb 2015 15:49:36 GMT
Repository: couchdb-config
Updated Branches:
  refs/heads/master 8e8ac7006 -> b2818252e


Remove tests for dropped register functionality

COUCHDB-2561


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

Branch: refs/heads/master
Commit: e19b7d5c02b70e14138c9fe1e21f2650100d0a21
Parents: 8e8ac70
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Thu Jan 29 12:52:29 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Thu Jan 29 12:52:29 2015 -0800

----------------------------------------------------------------------
 test/config_tests.erl | 144 ---------------------------------------------
 1 file changed, 144 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-config/blob/e19b7d5c/test/config_tests.erl
----------------------------------------------------------------------
diff --git a/test/config_tests.erl b/test/config_tests.erl
index 256ba99..636cb05 100644
--- a/test/config_tests.erl
+++ b/test/config_tests.erl
@@ -50,32 +50,6 @@ setup(Chain) ->
 setup_empty() ->
     setup([]).
 
-setup_register() ->
-    ConfigPid = setup(),
-    SentinelFunc = fun() ->
-        % Ping/Pong to make sure we wait for this
-        % process to die
-        receive
-            {ping, From} ->
-                From ! pong
-        end
-    end,
-    SentinelPid = spawn(SentinelFunc),
-    {ConfigPid, SentinelPid}.
-
-teardown({ConfigPid, SentinelPid}) ->
-    teardown(ConfigPid),
-    case process_info(SentinelPid) of
-        undefined -> ok;
-        _ ->
-            SentinelPid ! {ping, self()},
-            receive
-                pong ->
-                    ok
-            after 100 ->
-                throw({timeout_error, registered_pid})
-            end
-    end;
 teardown(Pid) ->
     config:stop(),
     [ok = application:stop(App) || App <- ?DEPS],
@@ -99,7 +73,6 @@ config_test_() ->
             %% config_del_tests(),
             config_override_tests()
             %% config_persistent_changes_tests(),
-            %% config_register_tests(),
             %% config_no_files_tests()
         ]
     }.
@@ -188,21 +161,6 @@ config_persistent_changes_tests() ->
         }
     }.
 
-config_register_tests() ->
-    {
-        "Config changes subscriber",
-        {
-            foreach,
-            fun setup_register/0, fun teardown/1,
-            [
-                fun should_handle_port_changes/1,
-                fun should_pass_persistent_flag/1,
-                fun should_not_trigger_handler_on_other_options_changes/1,
-                fun should_not_trigger_handler_after_related_process_death/1
-            ]
-        }
-    }.
-
 config_no_files_tests() ->
     {
         "Test config with no files",
@@ -347,108 +305,6 @@ should_ensure_that_written_to_last_config_in_chain(_, _) ->
                      config:get("httpd", "bind_address"))
     end).
 
-should_handle_port_changes({_, SentinelPid}) ->
-    ?_assert(begin
-        MainProc = self(),
-        Port = "8080",
-
-        config:register(
-            fun("httpd", "port", Value) ->
-                % config catches every error raised from handler
-                % so it's not possible to just assert on wrong value.
-                % We have to return the result as message
-                MainProc ! (Value =:= Port)
-            end,
-            SentinelPid
-        ),
-        ok = config:set("httpd", "port", Port, false),
-
-        receive
-            R ->
-                R
-        after ?TIMEOUT ->
-             erlang:error({assertion_failed,
-                           [{module, ?MODULE},
-                            {line, ?LINE},
-                            {reason, "Timeout"}]})
-        end
-    end).
-
-should_pass_persistent_flag({_, SentinelPid}) ->
-    ?_assert(begin
-        MainProc = self(),
-
-        config:register(
-            fun("httpd", "port", _, Persist) ->
-                % config catches every error raised from handler
-                % so it's not possible to just assert on wrong value.
-                % We have to return the result as message
-                MainProc ! Persist
-            end,
-            SentinelPid
-        ),
-        ok = config:set("httpd", "port", "8080", false),
-
-        receive
-            false ->
-                true
-        after ?SHORT_TIMEOUT ->
-            false
-        end
-    end).
-
-should_not_trigger_handler_on_other_options_changes({_, SentinelPid}) ->
-    ?_assert(begin
-        MainProc = self(),
-
-        config:register(
-            fun("httpd", "port", _) ->
-                MainProc ! ok
-            end,
-            SentinelPid
-        ),
-        ok = config:set("httpd", "bind_address", "0.0.0.0", false),
-
-        receive
-            ok ->
-                false
-        after ?SHORT_TIMEOUT ->
-            true
-        end
-    end).
-
-should_not_trigger_handler_after_related_process_death({_, SentinelPid}) ->
-    ?_assert(begin
-        MainProc = self(),
-
-        config:register(
-            fun("httpd", "port", _) ->
-                MainProc ! ok
-            end,
-            SentinelPid
-        ),
-
-        SentinelPid ! {ping, MainProc},
-        receive
-            pong ->
-                ok
-        after ?SHORT_TIMEOUT ->
-             erlang:error({assertion_failed,
-                           [{module, ?MODULE},
-                            {line, ?LINE},
-                            {reason, "Timeout"}]})
-        end,
-
-        ok = config:set("httpd", "port", "12345", false),
-
-        receive
-            ok ->
-                false
-        after ?SHORT_TIMEOUT ->
-            true
-        end
-    end).
-
 should_ensure_that_no_ini_files_loaded() ->
     ?_assertEqual(0, length(config:all())).
 


Mime
View raw message