diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-07 15:31:17 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-07 15:31:17 +0000 |
commit | b27349a13dd6510eecce7f13cc072a4fc2aea1a9 (patch) | |
tree | e7a44ccd2be75afe80984a31f82d79072e3c72bf /TAO/orbsvcs/tests/FaultTolerance | |
parent | f1847b643c51fb1f52d5b55d6f54ecbd5efa2996 (diff) | |
download | ATCD-b27349a13dd6510eecce7f13cc072a4fc2aea1a9.tar.gz |
Wed Nov 7 15:30:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/orbsvcs/tests/FaultTolerance')
-rw-r--r-- | TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp | 67 |
1 files changed, 27 insertions, 40 deletions
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp index 48923bcee78..768372bf632 100644 --- a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp +++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp @@ -35,15 +35,12 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) try { // Retrieve the ORB. - CORBA::ORB_var orb_ = CORBA::ORB_init (argc, - argv, - 0); + CORBA::ORB_var orb_ = CORBA::ORB_init (argc, argv); // ********************************************************************** // Get an object reference for the ORBs IORManipulation object! CORBA::Object_var IORM = - orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, - 0); + orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, 0); TAO_IOP::TAO_IOR_Manipulation_var iorm = TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ()); @@ -51,11 +48,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) // Create a few fictitious IORs CORBA::Object_var name1 = - orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz" - ); + orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz"); CORBA::Object_var name2 = - orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz" - ); + orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz"); // ********************************************************************** // Create IOR list for use with merge_iors. @@ -65,8 +60,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) iors [1] = name2; // ********************************************************************** - CORBA::Object_var merged = - iorm->merge_iors (iors); + CORBA::Object_var merged = iorm->merge_iors (iors); // Check for set and get primaries // Make a dummy property set @@ -77,36 +71,37 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) iorm->set_primary (&prop, name2.in (), merged.in ()); if (retval != 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\tThe primary has been set\n"))); - else { ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\tThe primary has been set\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tError in setting primary\n"))); return -1; } // Check whether a primary has been set - retval = iorm->is_primary_set (&prop, - merged.in ()); + retval = iorm->is_primary_set (&prop, merged.in ()); if (retval) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\tis_primary_set () returned true\n"))); - else { ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\tis_primary_set () returned true\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tis_primary_set () returned false\n"))); - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tSo Exiting\n"))); return -1; } // Get the primary - CORBA::Object_var prim = - iorm->get_primary (&prop, - merged.in ()); + CORBA::Object_var prim = iorm->get_primary (&prop, merged.in ()); // Check whether we got back the right primary if (prim->_is_equivalent (name2.in ())) @@ -116,9 +111,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } else { - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tWe have a problem in getting the right primary\n"))); - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tSo exiting\n"))); return -1; } @@ -135,47 +130,39 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ft_tag_component.group_domain_id = id; // Object group id - ft_tag_component.object_group_id = - (CORBA::ULongLong) 10; + ft_tag_component.object_group_id = (CORBA::ULongLong) 10; // Version - ft_tag_component.object_group_ref_version = - (CORBA::ULong) 5; + ft_tag_component.object_group_ref_version = (CORBA::ULong) 5; // Set the property - retval = iorm->set_property (&prop, - merged.in ()); + retval = iorm->set_property (&prop, merged.in ()); /// Extract the property FT::TagFTGroupTaggedComponent ftc; TAO_FT_IOGR_Property tmp_prop; - retval = - tmp_prop.get_tagged_component (merged.in (), - ftc); + retval = tmp_prop.get_tagged_component (merged.in (), ftc); ACE_DEBUG ((LM_DEBUG, "(%P|%t) Testing for tagged component \n")); - if ((ftc.object_group_ref_version != 5) && (ftc.object_group_id != 10)) ACE_ERROR ((LM_ERROR, "%P|%t) Not working right \n")); - - - if (retval) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\tWe have set the property\n"))); + + orb_->destroy (); } catch (const TAO_IOP::NotFound& userex) { userex._tao_print_exception ( - ACE_TEXT ( - "Unexpected NotFound Exception!\n")); + ACE_TEXT ("Unexpected NotFound Exception!\n")); return -1; } catch (const TAO_IOP::Duplicate& userex) |