Ejemplo n.º 1
0
 public bool Call()
 {
     try
     {
         for (int loop = 0; loop < _numRepeats; loop++)
         {
             var listener = new MyUpdateListener(_engine, _numThread);
             _statement.Events += listener.Update;
             _engine.EPRuntime.SendEvent(new SupportBean());
             _statement.Events -= listener.Update;
             listener.AssertCalled();
         }
     }
     catch (AssertionException ex)
     {
         Log.Error("Assertion error in thread " + Thread.CurrentThread.ManagedThreadId, ex);
         return(false);
     }
     catch (Exception ex)
     {
         Log.Error("Error in thread " + Thread.CurrentThread.ManagedThreadId, ex);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
        public object Call()
        {
            try {
                for (var loop = 0; loop < numRepeats; loop++) {
                    var listener = new MyUpdateListener(env, numThread);
                    statement.AddListener(listener);
                    env.SendEventBean(new SupportBean(), "SupportBean");
                    statement.RemoveListener(listener);
                    listener.AssertCalled();
                }
            }
            catch (AssertionException ex) {
                Console.Error.WriteLine("Assertion error in thread " + Thread.CurrentThread.ManagedThreadId, ex);
                Console.Error.WriteLine(ex.StackTrace);
                log.Error("Assertion error in thread " + Thread.CurrentThread.ManagedThreadId, ex);
                return false;
            }
            catch (Exception ex) {
                Console.Error.WriteLine("Error in thread " + Thread.CurrentThread.ManagedThreadId);
                Console.Error.WriteLine(ex.StackTrace);
                log.Error("Error in thread " + Thread.CurrentThread.ManagedThreadId, ex);
                return false;
            }

            return true;
        }