Exemple #1
0
        public void enqueue(Ice.BatchRequest request, int count, int size)
        {
            test(request.getOperation().Equals("opByteSOneway") || request.getOperation().Equals("ice_ping"));
            test(request.getProxy().ice_isBatchOneway());

            if(count > 0)
            {
                test(_lastRequestSize + _size == size);
            }
            _count = count;
            _size = size;

            if(_size + request.getSize() > 25000)
            {
                request.getProxy().begin_ice_flushBatchRequests();
                _size = 18; // header
            }

            if(_enabled)
            {
                _lastRequestSize = request.getSize();
                ++_count;
                request.enqueue();
            }
        }
Exemple #2
0
        public void opString(Ice.AsyncResult result)
        {
            string cmp = testString;
            if(_useCookie)
            {
                Cookie cookie = (Cookie)result.AsyncState;
                cmp = cookie.getString();
            }

            byte[] outEncaps;
            if(result.getProxy().end_ice_invoke(out outEncaps, result))
            {
                Ice.InputStream inS = new Ice.InputStream(_communicator, outEncaps);
                inS.startEncapsulation();
                string s = inS.readString();
                test(s.Equals(cmp));
                s = inS.readString();
                test(s.Equals(cmp));
                inS.endEncapsulation();
                callback.called();
            }
            else
            {
                test(false);
            }
        }
Exemple #3
0
 public void opLByteSI(Ice.AsyncResult result)
 {
     List<byte> i = (List<byte>)result.AsyncState;
     List<byte> o;
     List<byte> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opLByteS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #4
0
 public void opAByteSI(Ice.AsyncResult result)
 {
     byte[] i = (byte[])result.AsyncState;
     byte[] o;
     byte[] r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opAByteS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #5
0
 public void opNRI(Ice.AsyncResult result)
 {
     Dictionary<string, string> i = (Dictionary<string, string>)result.AsyncState;
     Dictionary<string, string> o;
     Dictionary<string, string> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opNR(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #6
0
 public void opNDVI(Ice.AsyncResult result)
 {
     Dictionary<string, Dictionary<int, int>> i = (Dictionary<string, Dictionary<int, int>>)result.AsyncState;
     Dictionary<string, Dictionary<int, int>> o;
     Dictionary<string, Dictionary<int, int>> r = 
         MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opNDV(out o, result);
     foreach(string key in i.Keys)
     {
         test(Ice.CollectionComparer.Equals(i[key], o[key]));
         test(Ice.CollectionComparer.Equals(i[key], r[key]));
     }
     callback.called();
 }
Exemple #7
0
 public void opQCVPrxSI(Ice.AsyncResult result)
 {
     Queue<CVPrx> i = (Queue<CVPrx>)result.AsyncState;
     Queue<CVPrx> o;
     Queue<CVPrx> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opQCVPrxS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #8
0
 connection(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     test(result.getProxy().end_ice_getConnection(result) != null);
     called();
 }
Exemple #9
0
 public void opLCVSI(Ice.AsyncResult result)
 {
     List<CV> i = (List<CV>)result.AsyncState;
     List<CV> o;
     List<CV> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opLCVS(out o, result);
     IEnumerator<CV> eo = o.GetEnumerator();
     IEnumerator<CV> er = r.GetEnumerator();
     foreach(CV obj in i)
     {
         eo.MoveNext();
         er.MoveNext();
         test(obj.i == ((CV)eo.Current).i);
         test(obj.i == ((CV)er.Current).i);
     }
     callback.called();
 }
Exemple #10
0
 opWithResult(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     test(TestIntfPrxHelper.uncheckedCast(result.getProxy()).end_opWithResult(result) == 15);
     called();
 }
Exemple #11
0
 public void opCObjectSI(Ice.AsyncResult result)
 {
     CObjectS i = (CObjectS)result.AsyncState;
     CObjectS o;
     CObjectS r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opCObjectS(out o, result);
     IEnumerator<Ice.Object> eo = o.GetEnumerator();
     IEnumerator<Ice.Object> er = r.GetEnumerator();
     foreach(CV obj in i)
     {
         eo.MoveNext();
         er.MoveNext();
         test(obj.i == ((CV)eo.Current).i);
         test(obj.i == ((CV)er.Current).i);
     }
     callback.called();
 }
Exemple #12
0
 public void opCustomCVSSI(Ice.AsyncResult result)
 {
     Custom<Custom<CV>> i = (Custom<Custom<CV>>)result.AsyncState;
     Custom<Custom<CV>> o;
     Custom<Custom<CV>> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opCustomCVSS(out o, result);
     IEnumerator<Custom<CV>> eo = (IEnumerator<Custom<CV>>)o.GetEnumerator();
     IEnumerator<Custom<CV>> er = (IEnumerator<Custom<CV>>)r.GetEnumerator();
     foreach(Custom<CV> s in i)
     {
         eo.MoveNext();
         er.MoveNext();
         IEnumerator<CV> io = (IEnumerator<CV>)eo.Current.GetEnumerator();
         IEnumerator<CV> ir = (IEnumerator<CV>)er.Current.GetEnumerator();
         foreach(CV obj in s)
         {
             io.MoveNext();
             ir.MoveNext();
             if(obj == null)
             {
                 test(io.Current == null);
                 test(ir.Current == null);
             }
             else
             {
                 test(obj.i == io.Current.i);
                 test(obj.i == ir.Current.i);
             }
         }
     }
     callback.called();
 }
Exemple #13
0
 public void opONDVI(Ice.AsyncResult result)
 {
     ONDV i = (ONDV)result.AsyncState;
     ONDV o;
     ONDV r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opONDV(out o, result);
     foreach(string key in i.Keys)
     {
         foreach(string s in i[key].Keys)
         {
             test(Ice.CollectionComparer.Equals(i[key][s], o[key][s]));
             test(Ice.CollectionComparer.Equals(i[key][s], r[key][s]));
         }
     }
     callback.called();
 }
Exemple #14
0
 public void opCCRSI(Ice.AsyncResult result)
 {
     CCRS i = (CCRS)result.AsyncState;
     CCRS o;
     CCRS r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opCCRS(out o, result);
     IEnumerator<CR> eo = (IEnumerator<CR>)o.GetEnumerator();
     IEnumerator<CR> er = (IEnumerator<CR>)r.GetEnumerator();
     foreach(CR obj in i)
     {
         eo.MoveNext();
         er.MoveNext();
         test(obj.v.i == ((CR)eo.Current).v.i);
         test(obj.v.i == ((CR)er.Current).v.i);
     }
     callback.called();
 }
Exemple #15
0
 public void opCEnSI(Ice.AsyncResult result)
 {
     CEnS i = (CEnS)result.AsyncState;
     CEnS o;
     CEnS r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opCEnS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #16
0
 connectionEx(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     try
     {
         result.getProxy().end_ice_getConnection(result);
         test(false);
     }
     catch(Ice.NoEndpointException)
     {
         called();
     }
     catch(Ice.Exception)
     {
         test(false);
     }
 }
Exemple #17
0
 opEx(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     try
     {
         TestIntfPrxHelper.uncheckedCast(result.getProxy()).end_op(result);
         test(false);
     }
     catch(Ice.NoEndpointException)
     {
         called();
     }
     catch(Ice.Exception)
     {
         test(false);
     }
 }
Exemple #18
0
 ping(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     result.getProxy().end_ice_ping(result);
     called();
 }
Exemple #19
0
 isA(Ice.AsyncResult result)
 {
     test(result.AsyncState == _cookie);
     test(result.getProxy().end_ice_isA(result));
     called();
 }
Exemple #20
0
 completedAsync(Ice.AsyncResult r)
 {
     test(r.AsyncState == _cookie);
     try
     {
         if(r.getConnection() != null)
         {
             r.getConnection().end_flushBatchRequests(r);
         }
         else
         {
             r.getProxy().end_ice_flushBatchRequests(r);
         }
         test(false);
     }
     catch(Ice.LocalException)
     {
         called();
     }
 }
Exemple #21
0
 public void opACRSI(Ice.AsyncResult result)
 {
     CR[] i = (CR[])result.AsyncState;
     CR[] o;
     CR[] r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opACRS(out o, result);
     System.Collections.IEnumerator eo = o.GetEnumerator();
     System.Collections.IEnumerator er = r.GetEnumerator();
     foreach(CR obj in i)
     {
         eo.MoveNext();
         er.MoveNext();
         test(obj.v.i == ((CR)eo.Current).v.i);
         test(obj.v.i == ((CR)er.Current).v.i);
     }
     callback.called();
 }
Exemple #22
0
 private void initCompleted(Ice.AsyncResult r)
 {
     Ice.RemoteLoggerPrx remoteLogger = Ice.RemoteLoggerPrxHelper.uncheckedCast(r.getProxy());
     
     try 
     {
         remoteLogger.end_init(r);
         
         if(_traceLevel > 1)
         {
             _logger.trace(_traceCategory, r.getOperation() + " on `" + remoteLogger.ToString() 
                           + "' completed successfully");
         }
     }
     catch(Ice.LocalException ex)
     {
         deadRemoteLogger(remoteLogger, _logger, ex, r.getOperation());
     }      
 }
Exemple #23
0
 public void opSEnSI(Ice.AsyncResult result)
 {
     Stack<En> i = (Stack<En>)result.AsyncState;
     Stack<En> o;
     Stack<En> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opSEnS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #24
0
        public void opException(Ice.AsyncResult result)
        {
            if(_useCookie)
            {
                Cookie cookie = (Cookie)result.AsyncState;
                test(cookie.getString().Equals(testString));
            }

            byte[] outParams;
            if(result.getProxy().end_ice_invoke(out outParams, result))
            {
                test(false);
            }
            else
            {
                Ice.InputStream inS = Ice.Util.createInputStream(_communicator, outParams);
                try
                {
                    inS.throwException();
                }
                catch(Test.MyException)
                {
                    callback.called();
                }
                catch(System.Exception)
                {
                    test(false);
                }
            }
        }
Exemple #25
0
 public void opCustomIntSSI(Ice.AsyncResult result)
 {
     Custom<Custom<int>> i = (Custom<Custom<int>>)result.AsyncState;
     Custom<Custom<int>> o;
     Custom<Custom<int>> r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opCustomIntSS(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #26
0
 public void opSerialSmallCSharpI(Ice.AsyncResult result)
 {
     try
     {
         Serialize.Small o;
         Serialize.Small r = 
             MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opSerialSmallCSharp(out o, result);
         test(o.i == 99);
         test(r.i == 99);
         callback.called();
     }
     catch(Ice.OperationNotExistException)
     {
         // OK, talking to non-C# server.
     }
 }
Exemple #27
0
 public void opODGSSI(Ice.AsyncResult result)
 {
     ODGSS i = (ODGSS)result.AsyncState;
     ODGSS o;
     ODGSS r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opODGSS(out o, result);
     foreach(string key in i.Keys)
     {
         test(Ice.CollectionComparer.Equals(i[key], o[key]));
         test(Ice.CollectionComparer.Equals(i[key], r[key]));
     }
     callback.called();
 }
Exemple #28
0
 public void opSerialLargeCSharpI(Ice.AsyncResult result)
 {
     try
     {
         Serialize.Large o;
         Serialize.Large r = 
             MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opSerialLargeCSharp(out o, result);
         test(o.d1 == 1.0);
         test(o.d2 == 2.0);
         test(o.d3 == 3.0);
         test(o.d4 == 4.0);
         test(o.d5 == 5.0);
         test(o.d6 == 6.0);
         test(o.d7 == 7.0);
         test(o.d8 == 8.0);
         test(o.d9 == 9.0);
         test(o.d10 == 10.0);
         test(r.d1 == 1.0);
         test(r.d2 == 2.0);
         test(r.d3 == 3.0);
         test(r.d4 == 4.0);
         test(r.d5 == 5.0);
         test(r.d6 == 6.0);
         test(r.d7 == 7.0);
         test(r.d8 == 8.0);
         test(r.d9 == 9.0);
         test(r.d10 == 10.0);
         callback.called();
     }
     catch(Ice.OperationNotExistException)
     {
         // OK, talking to non-C# server.
     }
 }
Exemple #29
0
 public void opOVI(Ice.AsyncResult result)
 {
     OV i = (OV)result.AsyncState;
     OV o;
     OV r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opOV(out o, result);
     test(Ice.CollectionComparer.Equals(i, o));
     test(Ice.CollectionComparer.Equals(i, r));
     callback.called();
 }
Exemple #30
0
 public void opSerialStructCSharpI(Ice.AsyncResult result)
 {
     try
     {
         Serialize.Struct o;
         Serialize.Struct r = 
             MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opSerialStructCSharp(out o, result);
         test(o.o == null);
         test(o.o2 != null);
         test(((Serialize.Struct)(o.o2)).o == null);
         test(((Serialize.Struct)(o.o2)).o2 == o.o2);
         test(o.s == null);
         test(o.s2.Equals("Hello"));
         test(r.o == null);
         test(r.o2 != null);
         test(((Serialize.Struct)(r.o2)).o == null);
         test(((Serialize.Struct)(r.o2)).o2 == r.o2);
         test(r.s == null);
         test(r.s2.Equals("Hello"));
         callback.called();
     }
     catch(Ice.OperationNotExistException)
     {
         // OK, talking to non-C# server.
     }
 }