Пример #1
0
        public void RunAssertion(String epl, int numLoops, AssertionCallback assertionCallback)
        {
            String[] fields = "mini,maxi".Split(',');

            EPStatement stmt = _epService.EPAdministrator.CreateEPL(epl);

            stmt.Events += _listener.Update;

            // Send range query events
            Log.Info("Querying");
            long delta = PerformanceObserver.TimeMillis(
                delegate
            {
                for (int i = 0; i < numLoops; i++)
                {
                    //if (i % 10 == 0) {
                    //    log.Info("At loop #" + i);
                    //}
                    _epService.EPRuntime.SendEvent(assertionCallback.GetEvent(i));
                    EPAssertionUtil.AssertProps(_listener.AssertOneGetNewAndReset(), fields,
                                                assertionCallback.GetExpectedValue(i));
                }

                Log.Info("Done Querying");
            });

            Log.Info("delta=" + delta);

            Assert.That(delta, Is.LessThan(1500));
            stmt.Dispose();
        }
        public void TryAssertion(EPServiceProvider epService, string epl, int numLoops, AssertionCallback assertionCallback)
        {
            string[] fields = "mini,maxi".Split(',');

            EPStatement stmt     = epService.EPAdministrator.CreateEPL(epl);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            // Send range query events
            Log.Info("Querying");
            long startTime = DateTimeHelper.CurrentTimeMillis;

            for (int i = 0; i < numLoops; i++)
            {
                //if (i % 10 == 0) {
                //    Log.Info("At loop #" + i);
                //}
                epService.EPRuntime.SendEvent(assertionCallback.GetEvent(i));
                EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, assertionCallback.GetExpectedValue(i));
            }
            Log.Info("Done Querying");
            long endTime = DateTimeHelper.CurrentTimeMillis;

            Log.Info("delta=" + (endTime - startTime));

            Assert.IsTrue((endTime - startTime) < 1500);
            stmt.Dispose();
        }
Пример #3
0
        private static void TryAssertion(
            RegressionEnvironment env,
            RegressionPath path,
            AtomicLong milestone,
            string epl,
            int numLoops,
            AssertionCallback assertionCallback)
        {
            var fields = new[] {"mini", "maxi"};
            env.CompileDeploy("@Name('s0')" + epl, path).AddListener("s0").MilestoneInc(milestone);
            // Send range query events
            log.Info("Querying");
            var startTime = PerformanceObserver.MilliTime;
            for (var i = 0; i < numLoops; i++) {
                //if (i % 10 == 0) {
                //    log.info("At loop #" + i);
                //}
                env.SendEventBean(assertionCallback.GetEvent(i));
                EPAssertionUtil.AssertProps(env.Listener("s0").AssertOneGetNewAndReset(), fields, assertionCallback.GetExpectedValue(i));
            }

            log.Info("Done Querying");
            var endTime = PerformanceObserver.MilliTime;
            log.Info("delta=" + (endTime - startTime));
            Assert.IsTrue(endTime - startTime < 1500);
            env.UndeployModuleContaining("s0");
        }