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(); }
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); }
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(); }