当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectPrxPtr::ice_ids方法代码示例

本文整理汇总了C++中ObjectPrxPtr::ice_ids方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::ice_ids方法的具体用法?C++ ObjectPrxPtr::ice_ids怎么用?C++ ObjectPrxPtr::ice_ids使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectPrxPtr的用法示例。


在下文中一共展示了ObjectPrxPtr::ice_ids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getTestEndpoint

TestIntfPrxPtr
allTests(const CommunicatorPtr& communicator)
{
    const string endp = getTestEndpoint(communicator, 0);
    cout << "testing stringToProxy... " << flush;
    ObjectPrxPtr base = communicator->stringToProxy("asm:" + endp);
    test(base);
    cout << "ok" << endl;

    cout << "testing checked cast... " << flush;
    TestIntfPrxPtr obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    test(obj);
#ifdef ICE_CPP11_MAPPING
    test(Ice::targetEquals(obj, base));
#else
    test(obj == base);
#endif
    cout << "ok" << endl;

    cout << "testing ice_ids... " << flush;
    try
    {
        ObjectPrxPtr o = communicator->stringToProxy("category/locate:" + endp);
        o->ice_ids();
        test(false);
    }
    catch(const UnknownUserException& ex)
    {
        test(ex.unknown == "::Test::TestIntfUserException");
    }
    catch(...)
    {
        test(false);
    }

    try
    {
        ObjectPrxPtr o = communicator->stringToProxy("category/finished:" + endp);
        o->ice_ids();
        test(false);
    }
    catch(const UnknownUserException& ex)
    {
        test(ex.unknown == "::Test::TestIntfUserException");
    }
    catch(...)
    {
        test(false);
    }
    cout << "ok" << endl;

    cout << "testing servant locator..." << flush;
    base = communicator->stringToProxy("category/locate:" + endp);
    obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    try
    {
        ICE_CHECKED_CAST(TestIntfPrx,
                         communicator->stringToProxy("category/unknown:" + getTestEndpoint(communicator, 0)));
    }
    catch(const ObjectNotExistException&)
    {
    }
    cout << "ok" << endl;

    cout << "testing default servant locator..." << flush;
    base = communicator->stringToProxy("anothercategory/locate:" + endp);
    obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    base = communicator->stringToProxy("locate:" + endp);
    obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    try
    {
        ICE_CHECKED_CAST(TestIntfPrx,
                         communicator->stringToProxy("anothercategory/unknown:" + getTestEndpoint(communicator, 0)));
    }
    catch(const ObjectNotExistException&)
    {
    }
    try
    {
        ICE_CHECKED_CAST(TestIntfPrx, communicator->stringToProxy("unknown:" + endp));
    }
    catch(const Ice::ObjectNotExistException&)
    {
    }
    cout << "ok" << endl;

    cout << "testing locate exceptions... " << flush;
    base = communicator->stringToProxy("category/locate:" + endp);
    obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    testExceptions(obj);
    cout << "ok" << endl;

    cout << "testing finished exceptions... " << flush;
    base = communicator->stringToProxy("category/finished:" + endp);
    obj = ICE_CHECKED_CAST(TestIntfPrx, base);
    testExceptions(obj);

    //
    // Only call these for category/finished.
    //
//.........这里部分代码省略.........
开发者ID:chenbk85,项目名称:ice,代码行数:101,代码来源:AllTests.cpp


注:本文中的ObjectPrxPtr::ice_ids方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。