示例#1
0
文件: AllTests.cpp 项目: ming-hai/ice
    void opString(const Ice::AsyncResultPtr& result)
    {
        string cmp = testString;
        if(_useCookie)
        {
            CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
            cmp = cookie->getString();
        }

        Ice::ByteSeq outParams;
        if(result->getProxy()->end_ice_invoke(outParams, result))
        {
            Ice::InputStream in(_communicator, result->getProxy()->ice_getEncodingVersion(), outParams);
            in.startEncapsulation();
            string s;
            in.read(s);
            test(s == cmp);
            in.read(s);
            test(s == cmp);
            in.endEncapsulation();
            called();
        }
        else
        {
            test(false);
        }
    }
示例#2
0
文件: AllTests.cpp 项目: ming-hai/ice
    void opException(const Ice::AsyncResultPtr& result)
    {
        if(_useCookie)
        {
            CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
            test(cookie->getString() == testString);
        }

        Ice::ByteSeq outParams;
        if(result->getProxy()->end_ice_invoke(outParams, result))
        {
            test(false);
        }
        else
        {
            Ice::InputStream in(_communicator, result->getProxy()->ice_getEncodingVersion(), outParams);
            in.startEncapsulation();
            try
            {
                in.throwException();
            }
            catch(const Test::MyException&)
            {
                in.endEncapsulation();
                called();
            }
            catch(...)
            {
                test(false);
            }
        }
    }
示例#3
0
    void opString(const Ice::AsyncResultPtr& result)
    {
        string cmp = testString;
        if(_useCookie)
        {
            CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
            cmp = cookie->getString();
        }

        Ice::ByteSeq outParams;
        if(result->getProxy()->end_ice_invoke(outParams, result))
        {
            Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
            string s;
            in->read(s);
            test(s == cmp);
            in->read(s);
            test(s == cmp);
            called();
        }
        else
        {
            test(false);
        };
    }
示例#4
0
    void opException(const Ice::AsyncResultPtr& result)
    {
        if(_useCookie)
        {
            CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
            test(cookie->getString() == testString);
        }

        Ice::ByteSeq outParams;
        if(result->getProxy()->end_ice_invoke(outParams, result))
        {
            test(false);
        }
        else
        {
            Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
            try
            {
                in->throwException();
            }
            catch(const Test::MyException&)
            {
                called();
            }
            catch(...)
            {
                test(false);
            }
        }
    }
示例#5
0
	void finished(const Ice::AsyncResultPtr& result)
	{
		DetectorPrx detector = DetectorPrx::uncheckedCast(result->getProxy());

		try
		{
			detector->end_process(result);
			localAndClientMsg(VLogger::DEBUG, NULL, "FinishedCallback: detector finished.\n");
		}
		catch (const Ice::Exception& e)
		{
			localAndClientMsg(VLogger::WARN, NULL, "Exception: %s\n", 
				 e.ice_name().c_str());
		}
		mFinished = true;
	}
示例#6
0
文件: message.cpp 项目: rachwal/RMI
 virtual void completed(const ::Ice::AsyncResultPtr& __result) const
 {
     ::zerocexample::MessageIcePrx __proxy = ::zerocexample::MessageIcePrx::uncheckedCast(__result->getProxy());
     ::std::string __ret;
     try
     {
         __ret = __proxy->end_getContent(__result);
     }
     catch(const ::Ice::Exception& ex)
     {
         Cpp11FnCallbackNC::exception(__result, ex);
         return;
     }
     if(_response != nullptr)
     {
         _response(__ret);
     }
 }