diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
commit | f17aa1c26ea86d00ec1cf57cbccdaea829ba0220 (patch) | |
tree | 8aaf3418082d4c3b107e2f01eedf0d55095c7ec7 /TAO/tests/Connection_Failure/client.cpp | |
parent | c5795bf619c5cd394920f8a03d475b60df8d8516 (diff) | |
download | ATCD-f17aa1c26ea86d00ec1cf57cbccdaea829ba0220.tar.gz |
ChangeLogTag: Mon Jul 07 18:00:38 2003 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/tests/Connection_Failure/client.cpp')
-rw-r--r-- | TAO/tests/Connection_Failure/client.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/TAO/tests/Connection_Failure/client.cpp b/TAO/tests/Connection_Failure/client.cpp new file mode 100644 index 00000000000..1ed7cbc25bc --- /dev/null +++ b/TAO/tests/Connection_Failure/client.cpp @@ -0,0 +1,45 @@ +// $Id$ + +#include "testC.h" + +ACE_RCSID(Connection_Failure, client, "$Id$") + +const char *ior = + "corbaloc:iiop:192.3.47/10007/RandomObject"; + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::Object_var tmp = + orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // First connection happens here.. + test::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Should not reach here. + ACE_ERROR_RETURN ((LM_ERROR, + "_narrow() succeeded to non-existent object when it should not have...\n"), + -1); + } + ACE_CATCH (CORBA::TRANSIENT, transient_exception) + { + // This exception is correct. + ACE_DEBUG ((LM_DEBUG, + "_narrow() to non-existent object failed correctly. Test succeeded.\n")); + return 0; + } + ACE_ENDTRY; + + // Should not reach here. + ACE_ERROR_RETURN ((LM_ERROR, + "This test should not reach this code...\n"), + -1); +} |