summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-03-04 07:23:24 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-03-04 07:23:24 +0000
commit7587f0f9389d426bac5aa6e621e907b5e306a987 (patch)
treee08bf2df3a2b2bf10ffa6d08f8add433245bf1f7
parent1b02053dd585eac4d9fb57accb712c92cf01f806 (diff)
downloadATCD-7587f0f9389d426bac5aa6e621e907b5e306a987.tar.gz
ChangeLogTag:Sat Mar 03 22:56:20 2001 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a17
-rw-r--r--TAO/tests/AMI_Timeouts/client.cpp44
-rw-r--r--TAO/tests/AMI_Timeouts/server.cpp44
-rw-r--r--TAO/tests/AMI_Timeouts/timeout_client.cpp67
4 files changed, 93 insertions, 79 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 92aa4f4d0d5..cfea0d1403b 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,20 @@
+Sat Mar 03 22:56:20 2001 Ossama Othman <ossama@uci.edu>
+
+ * tests/AMI_Timeouts/client.cpp (main):
+ * tests/AMI_Timeouts/timeout_client.cpp (svc, init):
+ * tests/AMI_Timeouts/server.cpp (main):
+
+ Fixed compile-time problems related to emulated exceptions.
+ ACE_TRY_NEW_ENV declares a CORBA::Environment within a do-while
+ loop scope, so that Environment is not available outside of the
+ loop. However, an ACE_CHECK_RETURN is done outside of the
+ ACE_TRY_NEW_ENV block. Use ACE_DECLARE_NEW_CORBA_ENV instead.
+
+ Added missing ACE_TRY_ENV parameter to the
+ resolve_initial_references() and shutdown() calls.
+
+ Corrected spelling. "Caught," not "Catched!"
+
Sat Mar 3 16:31:31 2001 Darrell Brunsch <brunsch@uci.edu>
* docs/TAO-metrics.html:
diff --git a/TAO/tests/AMI_Timeouts/client.cpp b/TAO/tests/AMI_Timeouts/client.cpp
index c0ef16ecec0..42a13159b78 100644
--- a/TAO/tests/AMI_Timeouts/client.cpp
+++ b/TAO/tests/AMI_Timeouts/client.cpp
@@ -1,20 +1,17 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests/AMI
-//
-// = FILENAME
-// server.cpp
-//
-// = DESCRIPTION
-// A client, which uses the AMI callback model and timeouts.
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file client.cpp
+ *
+ * $Id$
+ *
+ * A client, which uses the AMI callback model and timeouts.
+ *
+ *
+ * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
+ */
+//=============================================================================
+
#include "ace/Get_Opt.h"
#include "ace/Task.h"
@@ -24,7 +21,9 @@
#include "timeout_i.h"
#include "timeout_client.h"
-ACE_RCSID(AMI, client, "$Id$")
+ACE_RCSID (AMI,
+ client,
+ "$Id$")
const char *ior = "file://test.ior";
unsigned int msec = 50;
@@ -65,7 +64,8 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV);
@@ -93,7 +93,9 @@ main (int argc, char *argv[])
// Activate POA to handle the call back.
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA");
+ orb->resolve_initial_references ("RootPOA", ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Unable to initialize the POA.\n"),
@@ -135,7 +137,7 @@ main (int argc, char *argv[])
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Catched exception:");
+ "Caught exception:");
return 1;
}
ACE_ENDTRY;
diff --git a/TAO/tests/AMI_Timeouts/server.cpp b/TAO/tests/AMI_Timeouts/server.cpp
index 9287570606a..7132332a666 100644
--- a/TAO/tests/AMI_Timeouts/server.cpp
+++ b/TAO/tests/AMI_Timeouts/server.cpp
@@ -1,20 +1,17 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests/AMI_Timeouts
-//
-// = FILENAME
-// server.cpp
-//
-// = DESCRIPTION
-// Implementation of the server running the Timeout object.
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file server.cpp
+ *
+ * $Id$
+ *
+ * Implementation of the server running the Timeout object.
+ *
+ *
+ * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
+ */
+//=============================================================================
+
#include "ace/Get_Opt.h"
#include "tao/corba.h"
@@ -22,7 +19,9 @@
#include "timeout_i.h"
#include "timeout_client.h"
-ACE_RCSID(AMI, server, "$Id$")
+ACE_RCSID (AMI,
+ server,
+ "$Id$")
const char *ior_output_file = 0;
@@ -57,14 +56,17 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV);
ACE_TRY_CHECK;
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA");
+ orb->resolve_initial_references ("RootPOA", ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Unable to initialize the POA.\n"),
@@ -136,7 +138,7 @@ main (int argc, char *argv[])
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Catched exception:");
+ "Caught exception:");
return 1;
}
ACE_ENDTRY;
diff --git a/TAO/tests/AMI_Timeouts/timeout_client.cpp b/TAO/tests/AMI_Timeouts/timeout_client.cpp
index 0f62a4f7b44..eae9d4699ff 100644
--- a/TAO/tests/AMI_Timeouts/timeout_client.cpp
+++ b/TAO/tests/AMI_Timeouts/timeout_client.cpp
@@ -1,39 +1,31 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests/AMI_Timeouts
-//
-// = FILENAME
-// timeout_client.cpp
-//
-// = DESCRIPTION
-// Tests for proper handling of timeouts with AMI
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
-
+//=============================================================================
+/**
+ * @file timeout_client.cpp
+ *
+ * $Id$
+ *
+ * Tests for proper handling of timeouts with AMI
+ *
+ *
+ * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
+ */
+//=============================================================================
#include "timeout_client.h"
-
-
TimeoutClient::TimeoutClient (CORBA::ORB_ptr orb,
Timeout_ptr timeoutObject,
AMI_TimeoutHandler_ptr replyHandlerObject,
TimeoutHandler_i *timeoutHandler_i,
unsigned long timeToWait)
: orb_(CORBA::ORB::_duplicate (orb))
-, timeoutObject_(Timeout::_duplicate (timeoutObject))
-, replyHandlerObject_(AMI_TimeoutHandler::_duplicate (replyHandlerObject))
-, timeoutHandler_i_(timeoutHandler_i)
-, local_reply_excep_counter_ (0)
-, INVOKE_SYNCH(false)
-, INVOKE_ASYNCH(true)
-, timeToWait_ (timeToWait)
+ , timeoutObject_(Timeout::_duplicate (timeoutObject))
+ , replyHandlerObject_(AMI_TimeoutHandler::_duplicate (replyHandlerObject))
+ , timeoutHandler_i_(timeoutHandler_i)
+ , local_reply_excep_counter_ (0)
+ , INVOKE_SYNCH(false)
+ , INVOKE_ASYNCH(true)
+ , timeToWait_ (timeToWait)
{
}
@@ -51,7 +43,8 @@ TimeoutClient::svc ()
{
this->init ();
- ACE_TRY_NEW_ENV
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
{
// Tests timeouts for synchronous
@@ -74,12 +67,12 @@ TimeoutClient::svc ()
ACE_OS::sleep (tv);
// shut down local ORB
- orb_->shutdown (false);
-
+ orb_->shutdown (false, ACE_TRY_ENV);
+ ACE_TRY_CHECK;
}
ACE_CATCHANY
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Catched exception:");
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:");
return 1;
}
ACE_ENDTRY;
@@ -95,7 +88,8 @@ TimeoutClient::svc ()
int
TimeoutClient::init ()
{
- ACE_TRY_NEW_ENV
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
{
CORBA::Object_var object =
orb_->resolve_initial_references ("ORBPolicyManager",
@@ -108,7 +102,7 @@ TimeoutClient::init ()
}
ACE_CATCHANY
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Catched exception:");
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:");
return 1;
}
ACE_ENDTRY;
@@ -139,8 +133,7 @@ TimeoutClient::send (bool async,
CORBA::PolicyList policy_list (1);
- CORBA::Environment ACE_TRY_ENV;
-
+ ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY_EX (normal)
{
if (local_timeout != 0)
@@ -153,8 +146,8 @@ TimeoutClient::send (bool async,
policy_list.length (1);
policy_list[0] =
orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
- any_orb,
- ACE_TRY_ENV);
+ any_orb,
+ ACE_TRY_ENV);
ACE_TRY_CHECK_EX (normal);
policy_manager_->set_policy_overrides (policy_list,