summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/FT_App/FT_UnitTests.h
blob: 3a425db79217327dbd7eaabcc21d7fca8f786c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// -*- C++ -*-
//
// $Id$
#ifndef FT_UNIT_TESTS_H_
#define FT_UNIT_TESTS_H_
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/FT_ReplicationManagerC.h"

/**
 * Fault Tolerant CORBA unit tests
 */
class  FT_UnitTests
{
  //////////////////////
  // non-CORBA interface
public:
  /**
   * Default constructor.
   */
  FT_UnitTests (CORBA::ORB_var orb);

  /**
   * Virtual destructor.
   */
  virtual ~FT_UnitTests ();

  /**
   * Parse command line arguments.
   */
  int parse_args (int argc, char * argv[]);

  /**
   * initialize for the tests
   */
  int init ();

  /**
   * Run a unit test
   * @param the test-number of the test to run.
   * @return 0 if test ran successfully, any other 
   *         value is a failure.
   */
  int run_test (int test_number);

  /**
   * Runs all unit tests.
   * @returns 0 if all tests were sucessful, otherwise 
   *          returns the number of failed tests.
   */
  int run_all_tests ();

  /**
   * Returns the number of tests.
   */
  int test_count ();

  /**
   * Returns a description of the given test number
   */
  const char * test_desc (int test_number);

  /////////////////
  // The Tests
private:
  int test_001 (int run_test, CORBA::String_var & desc);
  int test_002 (int run_test, CORBA::String_var & desc);
  int test_003 (int run_test, CORBA::String_var & desc);
  int test_004 (int run_test, CORBA::String_var & desc);
  int test_005 (int run_test, CORBA::String_var & desc);
  int test_006 (int run_test, CORBA::String_var & desc);
  int test_007 (int run_test, CORBA::String_var & desc);
  int test_008 (int run_test, CORBA::String_var & desc);
  int test_009 (int run_test, CORBA::String_var & desc);
  int test_010 (int run_test, CORBA::String_var & desc);
  int test_011 (int run_test, CORBA::String_var & desc);

  /////////////////
  // Implementation
private:
  int readIORFile(const char * fileName, CORBA::String_var & ior);

  ///////////////
  // Data Members
private:

  // The orb
  CORBA::ORB_var orb_;

  // IOR of the replication manager.
  FT::ReplicationManager_var rm_;

  // an iogr for use in the unit tests
  CORBA::Object_var test_iogr_;

  // A list of FactoryInfos ofr the unit tests
  FT::FactoryInfos factories_;
};


#endif /* FT_UNIT_TESTS_H_  */