summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2006-08-22 15:12:53 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2006-08-22 15:12:53 +0000
commit6fd79a4b769fbf7c86d498604dd17812b5bacea0 (patch)
tree2b55cac218d5658253e007a03e497d7d7d549e1e
parent471112eba99430b456adb4623f7df917c5464a15 (diff)
downloadATCD-6fd79a4b769fbf7c86d498604dd17812b5bacea0.tar.gz
ChangeLog tag: Tue Aug 22 14:57:18 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog11
-rw-r--r--TAO/tests/Oneway_Timeouts/client.cpp54
2 files changed, 57 insertions, 8 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 0dfade41e5d..26383e56f1d 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,14 @@
+Tue Aug 22 14:57:18 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tests/Oneway_Timeouts/client.cpp:
+ Added a test case for transient exceptions. The TAO-specific
+ connection timout causes a connection attempt to give up, which
+ in turn causes the invocation endpoint selector to try
+ connecting to a new endpoint. If no more endpoints are available
+ for connecting, a transient exception is raised. Thus the ORB
+ code is working correctly, but the test was not handing the
+ transient exception as it should.
+
Tue Aug 22 11:27:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/orbsvcs/Trader/Constraint_Interpreter.cpp:
diff --git a/TAO/tests/Oneway_Timeouts/client.cpp b/TAO/tests/Oneway_Timeouts/client.cpp
index 8ccdfdea103..86aac9d4dd4 100644
--- a/TAO/tests/Oneway_Timeouts/client.cpp
+++ b/TAO/tests/Oneway_Timeouts/client.cpp
@@ -180,7 +180,7 @@ namespace
}
else
{
- cerr << "Error: Unknown argument \""
+ cerr << "Error: Unknown argument \""
<< args.get_current () << "\"" << endl;
print_usage ();
return false;
@@ -200,7 +200,7 @@ namespace
POA_var root = POA::_narrow (obj.in ());
ACE_ASSERT (! is_nil (root.in ()));
POAManager_var man = root->the_POAManager ();
- poa = root->create_POA ("X", man.in (), pols);
+ poa = root->create_POA ("X", man.in (), pols);
return poa._retn ();
}
@@ -420,7 +420,7 @@ int main (int ac, char *av[])
}
- // Let the server know we're finished.
+ // Let the server know we're finished.
tester->test2 (-1);
orb->shutdown (1);
@@ -437,14 +437,52 @@ int main (int ac, char *av[])
return 0;
}
+ catch (CORBA::TRANSIENT &ex)
+ {
+ if (force_timeout)
+ {
+ ACE_Time_Value after = ACE_High_Res_Timer::gettimeofday_hr ();
+ long ms = (after - before).msec ();
+ if ( (use_twoway || !use_sync_scope)
+ && request_timeout > 0
+ && request_timeout < connect_timeout)
+ {
+ connect_timeout = request_timeout;
+ }
+ else if (use_sync_scope && !use_sleep)
+ {
+ if (ms > TIME_THRESHOLD)
+ {
+ cerr << "Error: Buffered request took " << ms << endl;
+ return 1;
+ }
+
+ ms = num_requests_sent * request_interval;
+ }
+
+ if (std::abs (static_cast<int>(ms - connect_timeout))
+ > TIME_THRESHOLD)
+ {
+ cerr << "Error: Timeout expected in " << connect_timeout
+ << "ms, but took " << ms << "ms" << endl;
+ return 1;
+ }
+
+ return 0;
+ }
+ else
+ {
+ cerr << "Error: Unexpected transient\n" << ex << endl;
+ }
+ }
catch (CORBA::TIMEOUT &ex)
{
if (force_timeout)
{
ACE_Time_Value after = ACE_High_Res_Timer::gettimeofday_hr ();
long ms = (after - before).msec ();
- if ( (use_twoway || !use_sync_scope)
- && request_timeout > 0
+ if ( (use_twoway || !use_sync_scope)
+ && request_timeout > 0
&& request_timeout < connect_timeout)
{
connect_timeout = request_timeout;
@@ -479,9 +517,9 @@ int main (int ac, char *av[])
catch (Exception &ex)
{
cerr << "client: " << ex << endl;
- cerr << "\nLast operation took "
- << (ACE_High_Res_Timer::gettimeofday_hr () - before).msec ()
- << "ms"
+ cerr << "\nLast operation took "
+ << (ACE_High_Res_Timer::gettimeofday_hr () - before).msec ()
+ << "ms"
<< endl;
}