2 //=============================================================================
4 * @file AdminProperties.h
6 * Test for EC Admin QoS properties.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
10 //=============================================================================
13 #ifndef ADMINPROPERTIES
14 #define ADMINPROPERTIES
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
;
28 AdminProperties_StructuredPushConsumer (AdminProperties
* client
);
30 // = StructuredPushSupplier methods
31 virtual void push_structured_event (const CosNotification::StructuredEvent
& notification
35 AdminProperties
* client_
;
37 ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, CORBA::Long
> events_received_
;
42 * @class AdminProperties_Task
44 * @brief Run a thread to dispatch events.
46 * Use the ACE_Task_Base class.
48 class AdminProperties_Task
: public ACE_Task_Base
53 AdminProperties_Task (void);
56 void init (TAO_Notify_Tests_StructuredPushSupplier
*supplier
, AdminProperties
* client
);
58 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
60 /// The thread entry point.
61 virtual int svc (void);
65 TAO_Notify_Tests_StructuredPushSupplier
*supplier_
;
68 AdminProperties
* client_
;
71 /***************************************************************************/
74 * @class AdminProperties
76 * @brief AdminProperties
78 * Test for Notify EC properties -
84 class AdminProperties
: public Notify_Test_Client
87 friend class AdminProperties_StructuredPushConsumer
;
88 friend class AdminProperties_Task
;
91 AdminProperties (void);
92 ~AdminProperties (void);
94 int parse_args (int argc
, ACE_TCHAR
*argv
[]) ;
102 void create_suppliers (void);
103 void create_consumers (void);
104 void create_channel(bool reject
);
106 /// Test MaxSuppliers and MaxConsumers
107 void test_max_clients (void);
109 /// Test MaxQueueLength properties
110 void test_max_queue_length (bool reject
);
113 /// The one channel that we create using the factory.
114 CosNotifyChannelAdmin::EventChannel_var ec_
;
116 /// The consumer admin used by consumers.
117 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_
;
119 /// The supplier admin used by suppliers.
120 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_
;
122 /// Values for Admin Properties supplied by user.
123 CORBA::Long max_queue_length_
;
124 CORBA::Long max_consumers_
;
125 CORBA::Long max_suppliers_
;
126 CORBA::Boolean reject_new_events_
;
128 /// Number of consumers to connect to check MaxConsumers property.
129 CORBA::Long consumers_
;
131 /// Number of suppliers to connect to check MaxSuppliers property.
132 CORBA::Long suppliers_
;
134 /// Number of events to send to the channel.
135 CORBA::Long event_count_
;
137 /// Count of consumers successfully connect to the EC.
138 int suppliers_connected_count_
;
140 /// Count of consumers successfully connect to the EC.
141 int consumers_connected_count_
;
143 // Number of supplier pushes that resulted in an IMP_LIMIT exception
147 #endif /* ADMINPROPERTIES */