summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp')
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp55
1 files changed, 48 insertions, 7 deletions
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
index b39323d5890..9ea168ea6e1 100644
--- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
@@ -9,10 +9,12 @@
Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
const char* name,
+ CORBA::Short policy,
unsigned int low,
unsigned int high,
Notify_Test_Client& client)
: name_ (name),
+ discard_policy_ (policy),
low_ (low),
high_ (high),
count_ (0),
@@ -54,7 +56,9 @@ Notify_Sequence_Push_Consumer::_connect (
properties[0].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
properties[0].value <<= (CORBA::Long)5;
properties[1].name = CORBA::string_dup(CosNotification::PacingInterval);
- properties[1].value <<= (TimeBase::TimeT) 2 * 1000 * 10000;
+ properties[1].value <<= (TimeBase::TimeT)2; // 4
+ properties[2].name = CORBA::string_dup(CosNotification::DiscardPolicy);
+ properties[2].value <<= this->discard_policy_;
proxy_->set_qos(properties);
proxy_->connect_sequence_push_consumer (objref.in ()
@@ -70,21 +74,58 @@ Notify_Sequence_Push_Consumer::_connect (
void
Notify_Sequence_Push_Consumer::push_structured_events(
const CosNotification::EventBatch& events
- ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_DEBUG((LM_DEBUG, "{%u}", events.length()));
+ ACE_DEBUG((LM_DEBUG, "-"));
- this->count_ += events.length();
+ CORBA::ULong length = events.length();
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Received %u events:\n", length));
+
+ for(CORBA::ULong e = 0; e < length; e++)
+ {
+ if (events[e].header.variable_header.length () > 0)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s = %s, ",
+ (const char*)events[e].header.variable_header[0].name,
+ Any_String (events[e].header.variable_header[0].value)));
+ }
+ for(CORBA::ULong i = 0; i < 3; i++)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s = %s ",
+ (const char*)events[e].filterable_data[i].name,
+ Any_String (events[e].filterable_data[i].value)));
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"));
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "-------------------------\n"));
+
+ this->count_++;
if (this->count_ > this->high_)
{
this->client_.consumer_done (this);
ACE_ERROR((LM_ERROR,
- ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too "
- "many events received.\n")));
+ ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too ")
+ ACE_TEXT ("many events received.\n")));
}
- else if (this->count_ >= this->low_)
+ else if (this->count_ == this->low_)
{
this->client_.consumer_done (this);
}
+ else
+ {
+ ACE_OS::sleep(1);
+ }
}