本文整理汇总了C++中test::Hello_var::ping方法的典型用法代码示例。如果您正苦于以下问题:C++ Hello_var::ping方法的具体用法?C++ Hello_var::ping怎么用?C++ Hello_var::ping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test::Hello_var
的用法示例。
在下文中一共展示了Hello_var::ping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
CORBA::Boolean result = 0;
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 );
Test::Hello_var hello =
Test::Hello::_narrow(tmp.in () );
if (CORBA::is_nil (hello.in ()))
{
ACE_ERROR_RETURN ((LM_DEBUG,
"Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
ior),
1);
}
// Check this isn't generating transients for any other reason
hello->ping ();
try
{
hello->throw_location_forward ();
ACE_DEBUG ((LM_ERROR, "REGRESSION - Test has failed !!!\n"));
result = 1;
}
catch (CORBA::TRANSIENT my_ex)
{
ACE_UNUSED_ARG (my_ex);
ACE_DEBUG ((LM_DEBUG, "Client catches a TRANSIENT, as expected. No problem !\n"));
}
hello->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception (
"Test failed (Not regression) because unexpected exception caught:");
return 1;
}
if (result)
{
ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
}
else
{
ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
}
return result;
}
示例2: catch
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
CORBA::Boolean result = 0;
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
// First perform the test with an IOR
CORBA::Object_var tmp =
orb->string_to_object(ior);
Test::Hello_var hello =
Test::Hello::_narrow(tmp.in ());
if (CORBA::is_nil (hello.in ()))
{
ACE_ERROR_RETURN ((LM_DEBUG,
"Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
ior),
1);
}
// Check this isn't generating exceptions for any other reason
hello->ping ();
if (hello->has_ft_request_service_context ())
{
ACE_DEBUG ((LM_ERROR, "ERROR - REGRESSION - Request made on a plain IOR has a FT_REQUEST service context.\n" ));
result = 1;
}
else
{
ACE_DEBUG ((LM_DEBUG, "Request made on a plain IOR has no FT_REQUEST service context. This is OK.\n" ));
}
// Now repeat the test (for the converse result) with an IOGR
tmp =
orb->string_to_object(iogr);
hello =
Test::Hello::_narrow(tmp.in ());
if (CORBA::is_nil (hello.in ()))
{
ACE_ERROR_RETURN ((LM_DEBUG,
"Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
iogr),
1);
}
// Check this isn't generating transients for any other reason
hello->ping ();
if (! hello->has_ft_request_service_context ())
{
ACE_DEBUG ((LM_ERROR, "ERROR - REGRESSION - Request made on an IOGR has no FT_REQUEST service context.\n" ));
result = 1;
}
else
{
ACE_DEBUG ((LM_DEBUG, "Request made on an IOGR has a FT_REQUEST service context. This is OK.\n" ));
}
hello->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception (
"Test failed (Not regression) because unexpected exception caught:");
return 1;
}
if (result)
{
ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
}
else
{
ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
}
return result;
}