Exemple #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);
        }
    }
Exemple #2
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);
        };
    }
Exemple #3
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);
            }
        }
    }
Exemple #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);
            }
        }
    }