Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / AdminProperties.h
blob38901d4fdc1c2fc8058ae557899e83ac8310ed5c
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file AdminProperties.h
6 * Test for EC Admin QoS properties.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
9 */
10 //=============================================================================
13 #ifndef ADMINPROPERTIES
14 #define ADMINPROPERTIES
16 #include "ace/Task.h"
17 #include "Notify_Test_Client.h"
18 #include "Notify_StructuredPushConsumer.h"
19 #include "Notify_StructuredPushSupplier.h"
21 class AdminProperties;
22 /***************************************************************************/
24 class AdminProperties_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
26 friend class AdminProperties;
27 public:
28 AdminProperties_StructuredPushConsumer (AdminProperties* client);
30 // = StructuredPushSupplier methods
31 virtual void push_structured_event (const CosNotification::StructuredEvent & notification);
33 protected:
34 AdminProperties* client_;
36 ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Long> events_received_;
40 /**
41 * @class AdminProperties_Task
43 * @brief Run a thread to dispatch events.
45 * Use the ACE_Task_Base class.
47 class AdminProperties_Task : public ACE_Task_Base
49 public:
50 /// Constructor.
51 AdminProperties_Task ();
53 /// Init this object.
54 void init (TAO_Notify_Tests_StructuredPushSupplier *supplier, AdminProperties* client);
56 virtual int init (int argc, ACE_TCHAR *argv []);
58 /// The thread entry point.
59 virtual int svc ();
61 private:
62 /// Supplier
63 TAO_Notify_Tests_StructuredPushSupplier *supplier_;
65 /// Client Object.
66 AdminProperties* client_;
69 /***************************************************************************/
71 /**
72 * @class AdminProperties
74 * @brief AdminProperties
76 * Test for Notify EC properties -
77 * max_queue_length
78 * max_consumers
79 * max_suppliers
80 * reject_new_events
82 class AdminProperties : public Notify_Test_Client
84 friend class AdminProperties_StructuredPushConsumer;
85 friend class AdminProperties_Task;
87 public:
88 AdminProperties ();
89 ~AdminProperties ();
91 int parse_args (int argc, ACE_TCHAR *argv[]) ;
93 // Initialization.
95 /// Run the test.
96 void run_test ();
98 private:
99 void create_suppliers ();
100 void create_consumers ();
101 void create_channel(bool reject);
103 /// Test MaxSuppliers and MaxConsumers
104 void test_max_clients ();
106 /// Test MaxQueueLength properties
107 void test_max_queue_length (bool reject);
109 // Data Members
110 /// The one channel that we create using the factory.
111 CosNotifyChannelAdmin::EventChannel_var ec_;
113 /// The consumer admin used by consumers.
114 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
116 /// The supplier admin used by suppliers.
117 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
119 /// Values for Admin Properties supplied by user.
120 CORBA::Long max_queue_length_;
121 CORBA::Long max_consumers_;
122 CORBA::Long max_suppliers_;
123 CORBA::Boolean reject_new_events_;
125 /// Number of consumers to connect to check MaxConsumers property.
126 CORBA::Long consumers_;
128 /// Number of suppliers to connect to check MaxSuppliers property.
129 CORBA::Long suppliers_;
131 /// Number of events to send to the channel.
132 CORBA::Long event_count_;
134 /// Count of consumers successfully connect to the EC.
135 int suppliers_connected_count_;
137 /// Count of consumers successfully connect to the EC.
138 int consumers_connected_count_;
140 // Number of supplier pushes that resulted in an IMP_LIMIT exception
141 int rejections_;
144 #endif /* ADMINPROPERTIES */