コード例 #1
0
ファイル: bug_3198_regression.cpp プロジェクト: asdlei00/ACE
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
    try
    {
        CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

        if (parse_args (argc, argv) != 0)
            return 1;

        CORBA::Object_var obj = orb->string_to_object (ior);
        CORBA::PolicyList_var policies;
        CORBA::Boolean result = obj->_validate_connection (policies.out());
        if (result)
        {
            ACE_ERROR_RETURN ((LM_ERROR,
                               " (%P|%t) got true from _validate_connection\n"),
                              1);
        }
    }
    catch (const CORBA::TRANSIENT&)
    {
        ACE_DEBUG ((LM_DEBUG, "Caught transient as expected\n"));
    }
    catch (const CORBA::Exception& ex)
    {
        ex._tao_print_exception ("Exception caught:");
        return 1;
    }
    return 0;
}
コード例 #2
0
ファイル: client.cpp プロジェクト: asdlei00/ACE
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
  try
    {
      CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

      if (parse_args (argc, argv) != 0)
        return 1;

      CORBA::Object_var tmp = orb->string_to_object (ior);

      // No remote calls, first request flag is on.
      if (!first_request_flag (tmp.in ()))
        {
          ACE_ERROR ((LM_ERROR,
                      "Test FAILED at the beginning (why?)\n"));
        }

      // This call must issue LocateRequest message.
      CORBA::PolicyList_var pl;
      tmp->_validate_connection (pl.out ());

      // There was a LocateRequest call, first request flag
      // must be still on.
      if (!first_request_flag (tmp.in ()))
        {
          ACE_ERROR ((LM_ERROR,
                      "Test FAILED after LocateRequest (bug#3676 is not fixed)!!\n"));
        }

      Test::Hello_var hello = Test::Hello::_narrow (tmp.in ());

      if (CORBA::is_nil (hello.in ()))
        {
          ACE_ERROR_RETURN ((LM_DEBUG,
                             "Nil Test::Hello reference <%s>\n",
                             ior),
                            1);
        }

      CORBA::String_var the_string = hello->get_string ();

      // Either _narrow or get_string issued a remote call,
      // first request flag is off.
      if (first_request_flag (tmp.in ()))
        {
          ACE_ERROR ((LM_ERROR,
                      "Test FAILED after normal request (why?)\n"));
        }

      hello->shutdown ();

      orb->destroy ();
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Exception caught:");
      return 1;
    }

  return 0;
}