Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / POA / Current / Current.cpp
blob66018b024cc8f280626f7792c0aa3e806c1870f9
2 //=============================================================================
3 /**
4 * @file Current.cpp
6 * This program tests if accessing the POA current before the
7 * RootPOA can cause any problems.
9 * @author Irfan Pyarali
11 //=============================================================================
14 #include "tao/ORB.h"
15 #include "tao/PortableServer/PortableServer.h"
17 #include "ace/Log_Msg.h"
19 int
20 ACE_TMAIN(int argc, ACE_TCHAR *argv[])
22 try
24 // Initialize the ORB first.
25 CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
27 CORBA::Object_var object;
29 object = orb->resolve_initial_references ("POACurrent");
31 PortableServer::Current_var current =
32 PortableServer::Current::_narrow (object.in ());
34 object = orb->resolve_initial_references ("RootPOA");
36 PortableServer::POA_var root_poa =
37 PortableServer::POA::_narrow (object.in ());
39 orb->destroy ();
41 ACE_DEBUG ((LM_DEBUG,
42 "%s successful\n",
43 argv[0]));
45 catch (const CORBA::Exception& ex)
47 ex._tao_print_exception ("Exception caught");
48 return -1;
51 return 0;