Exemplo 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);
        }
    }
Exemplo 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);
            }
        }
    }
Exemplo 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);
        };
    }
Exemplo 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);
            }
        }
    }
Exemplo n.º 5
0
 void opExceptionWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
 {
     test(cookie->getString() == testString);
     if(ok)
     {
         test(false);
     }
     else
     {
         Ice::InputStream in(_communicator, outParams);
         in.startEncapsulation();
         try
         {
             in.throwException();
         }
         catch(const Test::MyException&)
         {
             in.endEncapsulation();
             called();
         }
         catch(...)
         {
             test(false);
         }
     }
 }
Exemplo n.º 6
0
 void opStringWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
 {
     if(ok)
     {
         Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
         string s;
         in->read(s);
         test(s == cookie->getString());
         in->read(s);
         test(s == cookie->getString());
         called();
     }
     else
     {
         test(false);
     }
 }
Exemplo n.º 7
0
 void opStringWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
 {
     if(ok)
     {
         Ice::InputStream in(_communicator, outParams);
         in.startEncapsulation();
         string s;
         in.read(s);
         test(s == cookie->getString());
         in.read(s);
         test(s == cookie->getString());
         in.endEncapsulation();
         called();
     }
     else
     {
         test(false);
     }
 }
Exemplo n.º 8
0
 void opExceptionWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
 {
     test(cookie->getString() == testString);
     if(ok)
     {
         test(false);
     }
     else
     {
         Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
         try
         {
             in->throwException();
         }
         catch(const Test::MyException&)
         {
             called();
         }
         catch(...)
         {
             test(false);
         }
     }
 }