anchor.diff:  -module(integration_test_client).
  --export([start/0, run/0, stop/0]).
  +-export([start/0, start/2, run/0, stop/0]).
   -import(user_interface, [connect/0, allocate/0, free/1, stats/0, disconnect/0]).
   -import(client, [client/1]).
   -import(node_lib, [start_node/3]).
  
positive.code: %%% Resa Server must have started on another node, to allow monitoring its activity's status.
  %%% If you want to handle monitoring newly connected nodes, that needs another treatment.
  start_client_node() ->
     node_lib:start_node(?client_name, ?client_node, longnames).
  
  connect_client() ->
     case user_interface:connect() of
         {ok, Pid} ->
  	   global:register_name(?client_name, Pid, fun global:notify_all_name/3),
  	   io:format("Client ~p connnected. Pid is ~p~n", [?client_name, Pid]);
         {already_connected, Pid} ->
  	   io:format("Client ~p already connnected. Pid is ~p~n", [?client_name, Pid])
         end.
  
  disconnect_client() ->
      case user_interface:disconnect() of
  
negative.code:     start_client_node(),
      connect_client().
  
  %%% Start more clients nodes
  %%% Usage example:
  %%% 1> ?MODULE:start(clientX, 'clientX@localhost.localdomain')
  
  start(Client_name, Client_node) ->
      start_client_node(Client_name, Client_node),
      connect_client(Client_name).
  
  %%% Precondition:
  %%% server_node of Integration Test has started.
  
  