diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
commit | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (patch) | |
tree | 197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tests/Connection_Failure/client.cpp | |
parent | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (diff) | |
download | ATCD-3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c.tar.gz |
Repo restructuring
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..c9759652961 --- /dev/null +++ b/TAO/tests/Connection_Failure/client.cpp @@ -0,0 +1,45 @@ +// $Id$ + +#include "testC.h" +#include "tao/SystemException.h" + +#include "ace/Log_Msg.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; + } + 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, + "_narrow() succeeded to non-existent object when it should not have...\n"), + -1); +} |