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
);
34 AdminProperties
* client_
;
36 ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, CORBA::Long
> events_received_
;
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
51 AdminProperties_Task ();
54 void init (TAO_Notify_Tests_StructuredPushSupplier
*supplier
, AdminProperties
* client
);
56 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
58 /// The thread entry point.
63 TAO_Notify_Tests_StructuredPushSupplier
*supplier_
;
66 AdminProperties
* client_
;
69 /***************************************************************************/
72 * @class AdminProperties
74 * @brief AdminProperties
76 * Test for Notify EC properties -
82 class AdminProperties
: public Notify_Test_Client
84 friend class AdminProperties_StructuredPushConsumer
;
85 friend class AdminProperties_Task
;
91 int parse_args (int argc
, ACE_TCHAR
*argv
[]) ;
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
);
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
144 #endif /* ADMINPROPERTIES */