anchor.diff:       cannot_enable_duplicate_module_plugin,
        cannot_enable_duplicate_app_plugin,
        module_plugin_mod_does_not_exist,
  -     module_plugin_function_does_not_exist].
  +     module_plugin_function_does_not_exist,
  +     app_plugin_mod_does_not_exist,
  +     app_plugin_function_does_not_exist].
   
   init_per_suite(Config) ->
       application:ensure_all_started(lager),
  
positive.code:     %% but it does not get written to the config file again.
      {plugins, [{module, ?MODULE, [{hooks, [{hookname, sample_hook_function, 0}]}]}]} = read_config(Config).
  
  
  cannot_enable_duplicate_app_plugin(Config) ->
      ok = write_config(Config ,empty_plugin_config()),
      {ok, _} = application:ensure_all_started(vmq_plugin),
      ok = vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]),
      {error,already_enabled} = vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]).
  
  module_plugin_function_does_not_exist(Config) ->
      ok = write_config(Config ,empty_plugin_config()),
  
negative.code:     {error,{no_matching_fun_in_module,vmq_plugin_SUITE,nonexistent_fun,0}} =
          vmq_plugin_mgr:enable_module_plugin(hookname, ?MODULE, nonexistent_fun, 0).
  
  app_plugin_mod_does_not_exist(Config) ->
      ok = write_config(Config, empty_plugin_config()),
      {ok, _} = application:ensure_all_started(vmq_plugin),
      Hooks = [{nonexistent_mod,sample_hook,0}],
      application:set_env(vmq_plugin, vmq_plugin_hooks, Hooks),
      {error, {unknown_module,nonexistent_mod}} =
          vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]).
  
  app_plugin_function_does_not_exist(Config) ->
      ok = write_config(Config, empty_plugin_config()),
      {ok, _} = application:ensure_all_started(vmq_plugin),
      Hooks = [{?MODULE,nonexistent_fun,0}],
      application:set_env(vmq_plugin, vmq_plugin_hooks, Hooks),
      {error, {no_matching_fun_in_module,vmq_plugin_SUITE,nonexistent_fun,0}} =
          vmq_plugin_mgr:enable_plugin(vmq_plugin, [code:lib_dir(vmq_plugin)]).
  
  sample_hook_function() ->
      ok.
  