Ejemplo n.º 1
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::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);
        }
    }
Ejemplo n.º 2
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::InputStream in(_communicator, result->getProxy()->ice_getEncodingVersion(), outParams);
            in.startEncapsulation();
            try
            {
                in.throwException();
            }
            catch(const Test::MyException&)
            {
                in.endEncapsulation();
                called();
            }
            catch(...)
            {
                test(false);
            }
        }
    }
Ejemplo n.º 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);
        };
    }
Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 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;
	}
Ejemplo n.º 6
0
 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);
     }
 }