anchor.diff:      application:set_env(vmq_plugin, plugin_dir, ".."),
       application:start(vmq_plugin),
       %% no plugin is yet registered
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(sample_hook, [])),
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(sample_hook, [1])),
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(sample_hook, [1, 2])),
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(sample_hook, [1, 2, 3])),
  -
  +    call_no_hooks(),
   
       %% ENABLE PLUGIN
       ?assertEqual(ok, vmq_plugin_mgr:enable_plugin(vmq_plugin, "..")),
       ?assert(lists:keyfind(vmq_plugin, 1, application:which_applications()) /= false),
   
  -    %% ONLY HOOK Tests
  -    ?assertEqual([], vmq_plugin:only(sample_hook, [])),
  -    ?assertEqual([1], vmq_plugin:only(sample_hook, [1])),
  -    ?assertEqual([1, 2], vmq_plugin:only(sample_hook, [1, 2])),
  -    ?assertEqual([1, 2, 3], vmq_plugin:only(sample_hook, [1, 2, 3])),
  -
  -    %% call hook with wrong arity
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(sample_hook, [1, 2, 3, 4])),
  -    %% call unknown hook
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:only(unknown_hook, [])),
  -
  -    %% ALL HOOK Tests
  -    ?assertEqual([[]], vmq_plugin:all(sample_hook, [])),
  -
  -    %% call hook with wrong arity
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:all(sample_hook, [1, 2, 3, 4])),
  -    %% call unknown hook
  -    ?assertEqual({error, no_matching_hook_found},
  -                 vmq_plugin:all(unknown_hook, [])),
  -
  -    ?assertEqual([10,10,10], vmq_plugin:all(sample_all_hook, [10])),
  -
  -
  -    %% ALL_TILL_OK Hook Tests
  -    ?assertEqual(ok, vmq_plugin:all_till_ok(sample_all_till_ok_hook, [10])),
  +    call_hooks(),
   
       io:format(user, "info all ~p~n", [vmq_plugin:info(all)]),
       io:format(user, "info only ~p~n", [vmq_plugin:info(only)]),
  
positive.code: 
  check_plugins([], CheckedHooks) -> {ok, CheckedHooks}.
  
  start_plugins([{App, _}|Rest]) ->
      start_plugin(App),
      start_plugins(Rest);
  
negative.code:     io:format(user, "info all ~p~n", [vmq_plugin:info(all)]),
      io:format(user, "info only ~p~n", [vmq_plugin:info(only)]),
      %% no plugin is registered
      call_no_hooks().
  
  vmq_module_plugin_test() ->
      application:start(vmq_plugin),
      call_no_hooks(),
      vmq_plugin_mgr:enable_module_plugin(?MODULE, sample_hook, 0),
      vmq_plugin_mgr:enable_module_plugin(?MODULE, sample_hook, 1),
      vmq_plugin_mgr:enable_module_plugin(?MODULE, sample_hook, 2),
      vmq_plugin_mgr:enable_module_plugin(?MODULE, sample_hook, 3),
      vmq_plugin_mgr:enable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_a, 1),
      vmq_plugin_mgr:enable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_b, 1),
      vmq_plugin_mgr:enable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_c, 1),
      %% ordering matters, we don't want other_sample_hook_x to be called
      vmq_plugin_mgr:enable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_x, 1),
      vmq_plugin_mgr:enable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_f, 1),
      vmq_plugin_mgr:enable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_e, 1),
      vmq_plugin_mgr:enable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_d, 1),
      call_hooks(),
  
      % disable hooks
      vmq_plugin_mgr:disable_module_plugin(?MODULE, sample_hook, 0),
      vmq_plugin_mgr:disable_module_plugin(?MODULE, sample_hook, 1),
      vmq_plugin_mgr:disable_module_plugin(?MODULE, sample_hook, 2),
      vmq_plugin_mgr:disable_module_plugin(?MODULE, sample_hook, 3),
      vmq_plugin_mgr:disable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_a, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_b, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_hook, ?MODULE, other_sample_hook_c, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_x, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_f, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_e, 1),
      vmq_plugin_mgr:disable_module_plugin(sample_all_till_ok_hook, ?MODULE, other_sample_hook_d, 1),
      call_no_hooks().
  
  
  call_no_hooks() ->
      ?assertEqual({error, no_matching_hook_found},
                   vmq_plugin:only(sample_hook, [])),
      ?assertEqual({error, no_matching_hook_found},
  