2 //=============================================================================
6 * This class implements a client used to test the CosConcurrency
9 * @author Torben Worm <tworm@cs.wustl.edu>
11 //=============================================================================
14 #include "ace/Get_Opt.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "orbsvcs/CosConcurrencyControlC.h"
21 #include "orbsvcs/CosNamingC.h"
23 #include "CC_naming_service.h"
24 #include "CC_command.h"
25 #include "CC_command.tab.h"
30 // Stuff to be used by the command file parser
31 int ace_cc_yyparse(void);
34 CC_CommandList
*cmdlist
;
35 extern FILE *ace_cc_yyin
;
36 // end of parser stuff
42 * @brief Defines a class that encapsulates the behaviour of a clien of
43 * the concurrency service.
45 * This class declares an interface to run the test client for
46 * the concurrency service.
51 /// Default constructor.
60 /// Initialize the test with the parameters from the command line.
61 int init (int argc
, ACE_TCHAR
**argv
);
64 /// Function to initialize the naming service.
65 int init_naming_service (void);
67 /// Function to parse the command line arguments.
68 int parse_args (void);
70 /// Function to read the ior from the given file.
71 int read_ior (ACE_TCHAR
*filename
);
73 /// Runs the basic tests (on a single lock set). Returns CC_SUCCESS
74 /// upon success CC_FAIL otherwise.
75 int run_basic_tests (void);
77 /// Runs the extended tests (on more lock sets). Returns CC_SUCCESS
78 /// upon success CC_FAIL otherwise.
79 int run_extended_tests (ACE_TCHAR
*params
);
81 /// Checks the parameters given to the run_extended_tests() function.
82 /// returns -1 if an error is found.
83 int check_extended_test_params(ACE_TCHAR
*params
);
85 /// A pointer to the naming service used for this test.
86 CC_naming_service
*naming_service_
;
88 /// File from which to obtain the IOR.
89 FILE *cc_factory_ior_file_
;
91 /// The factory key for the lock set factory.
92 char *cc_factory_key_
;
94 /// File handle to read the IOR.
97 /// Flag to tell server to shutdown.
100 /// Remember our orb.
103 // CosConcurrencyControl::LockSetFactory_var factory_;
104 // factory pointer for the lock set. @@TAO maybe to be used when naming
105 // service is not used (for simple testing)
107 /// The number of arguments passed on the command line.
110 /// The arguments from the command line.
113 /// Flag to tell the client whether to use the naming service or not
114 /// to find the concurrency control factory.
115 int use_naming_service_
;
117 /// flag to tell which test should be run.
118 int run_basic_tests_
;
120 /// flag to tell which test should be run.
121 int run_extended_tests_
;
123 /// Parameters to the extended tests. The parameters are of the
124 /// following format: <test>:<parm1>:<parm2>...
125 ACE_TCHAR
*extended_tests_params_
;
127 /// Flag to tell whethter to use a script file to run the tests.
128 int use_script_file_
;
130 /// The script file to run
131 ACE_TCHAR
*script_file_
;
133 /// Prints out the options to the program.
134 void print_usage (void);
136 #endif /* !defined (_CC_CLIENT_H_) */