public void Run(RegressionEnvironment env)
            {
                var listener = new UnmatchListenerCreateStmt(env);
                env.EventService.UnmatchedListener = listener.Update;

                // no statement, should be unmatched
                SendEvent(env, "E1");
                Assert.AreEqual(1, listener.Received.Count);
                listener.Reset();

                SendEvent(env, "E1");
                Assert.AreEqual(0, listener.Received.Count);

                env.UndeployAll();
            }
예제 #2
0
        public void TestUnmatchedCreateStatement()
        {
            _epService.EPAdministrator.Configuration.AddEventType <SupportBean>();
            UnmatchListenerCreateStmt listener = new UnmatchListenerCreateStmt(_epService);

            _epService.EPRuntime.UnmatchedEvent += listener.Update;

            // no statement, should be unmatched
            SendEvent("E1");
            Assert.AreEqual(1, listener.Received.Count);
            listener.Reset();

            SendEvent("E1");
            Assert.AreEqual(0, listener.Received.Count);
        }
예제 #3
0
        private void RunAssertionUnmatchedCreateStatement(EPServiceProvider epService)
        {
            var listener = new UnmatchListenerCreateStmt(epService);

            epService.EPRuntime.UnmatchedEvent += listener.Update;

            // no statement, should be unmatched
            SendEvent(epService, "E1");
            Assert.AreEqual(1, listener.Received.Count);
            listener.Reset();

            SendEvent(epService, "E1");
            Assert.AreEqual(0, listener.Received.Count);

            epService.EPAdministrator.DestroyAllStatements();
            epService.EPRuntime.RemoveAllUnmatchedEventHandlers();
        }