private SupportBeanSimple SendSimpleEvent(String s) { SupportBeanSimple bean = new SupportBeanSimple(s, 0); _epService.EPRuntime.SendEvent(bean); return(bean); }
public void TestNodeMatching() { SupportBeanSimple eventObject = new SupportBeanSimple("DepositEvent_1", 1); EventBean eventBean = SupportEventBeanFactory.CreateObject(eventObject); FilterHandle expr = new SupportFilterHandle(); _testNode.Add(expr); // Check matching without an index node List <FilterHandle> matches = new List <FilterHandle>(); _testNode.MatchEvent(eventBean, matches); Assert.AreEqual(1, matches.Count); Assert.AreEqual(expr, matches[0]); matches.Clear(); // Create, add and populate an index node FilterParamIndexBase index = new FilterParamIndexEquals( MakeLookupable("MyString", eventBean.EventType), ReaderWriterLockManager.CreateDefaultLock()); _testNode.Add(index); index["DepositEvent_1"] = _testEvaluator; // Verify matcher instance stored in index is called _testNode.MatchEvent(eventBean, matches); Assert.IsTrue(_testEvaluator.GetAndResetCountInvoked() == 1); Assert.IsTrue(_testEvaluator.GetLastEvent() == eventBean); Assert.AreEqual(1, matches.Count); Assert.AreEqual(expr, matches[0]); }
public void TestNodeMatching() { var eventObject = new SupportBeanSimple("DepositEvent_1", 1); var eventBean = SupportEventBeanFactory .GetInstance(container) .CreateObject(eventObject); FilterHandle expr = new SupportFilterHandle(); testNode.Add(expr); // Check matching without an index node IList <FilterHandle> matches = new List <FilterHandle>(); testNode.MatchEvent(eventBean, matches, null); Assert.AreEqual(1, matches.Count); Assert.AreEqual(expr, matches[0]); matches.Clear(); // Create, add and populate an index node FilterParamIndexBase index = new FilterParamIndexEquals( MakeLookupable("MyString", eventBean.EventType), new SlimReaderWriterLock()); testNode.Add(index); index.Put("DepositEvent_1", testEvaluator); // Verify matcher instance stored in index is called testNode.MatchEvent(eventBean, matches, null); Assert.IsTrue(testEvaluator.GetAndResetCountInvoked() == 1); Assert.IsTrue(testEvaluator.LastEvent == eventBean); Assert.AreEqual(1, matches.Count); Assert.AreEqual(expr, matches[0]); }
private SupportBeanSimple SendSimpleEvent(EPServiceProvider epService, string s) { var bean = new SupportBeanSimple(s, 0); epService.EPRuntime.SendEvent(bean); return(bean); }
private static SupportBeanSimple SendSimpleEvent( RegressionEnvironment env, string s) { var bean = new SupportBeanSimple(s, 0); env.SendEventBean(bean); return bean; }
private EventBean MakeTypeTwoEvent( string myString, int myInt) { var bean = new SupportBeanSimple(myString, myInt); return(supportEventBeanFactory.CreateObject(bean)); }
private void AssertNoCommonProperties() { SupportBeanSimple eventSimple = SendSimpleEvent("string"); SupportMarketDataBean eventMarket = SendMarketEvent("string"); EventBean theEvent = _listener.LastNewData[0]; IDictionary <String, Object> properties = new Dictionary <String, Object>(); properties["concat"] = "stringstring"; AssertProperties(properties, _listener); Assert.AreSame(eventSimple, theEvent.Get("eventOne")); Assert.AreSame(eventMarket, theEvent.Get("eventTwo")); }
private void AssertNoCommonProperties(EPServiceProvider epService, SupportUpdateListener listener) { SupportBeanSimple eventSimple = SendSimpleEvent(epService, "string"); SupportMarketDataBean eventMarket = SendMarketEvent(epService, "string"); EventBean theEvent = listener.LastNewData[0]; var properties = new Dictionary <string, object>(); properties.Put("concat", "stringstring"); AssertProperties(properties, listener); Assert.AreSame(eventSimple, theEvent.Get("eventOne")); Assert.AreSame(eventMarket, theEvent.Get("eventTwo")); }
public void SetUp() { eventTypeSimple = supportEventTypeFactory.CreateBeanType(typeof(SupportBeanSimple)); eventTypeComplex = supportEventTypeFactory.CreateBeanType(typeof(SupportBeanComplexProps)); eventTypeNested = supportEventTypeFactory.CreateBeanType(typeof(SupportBeanCombinedProps)); objSimple = new SupportBeanSimple("a", 20); objComplex = SupportBeanComplexProps.MakeDefaultBean(); objCombined = SupportBeanCombinedProps.MakeDefaultBean(); eventSimple = new BeanEventBean(objSimple, eventTypeSimple); eventComplex = new BeanEventBean(objComplex, eventTypeComplex); eventNested = new BeanEventBean(objCombined, eventTypeNested); }
public void SetUp() { EPServiceProviderManager.PurgeAllProviders(); _eventTypeSimple = new BeanEventType(null, 0, typeof(SupportBeanSimple), SupportEventAdapterService.Service, null); _eventTypeComplex = new BeanEventType(null, 0, typeof(SupportBeanComplexProps), SupportEventAdapterService.Service, null); _eventTypeNested = new BeanEventType(null, 0, typeof(SupportBeanCombinedProps), SupportEventAdapterService.Service, null); _objSimple = new SupportBeanSimple("a", 20); _objComplex = SupportBeanComplexProps.MakeDefaultBean(); _objCombined = SupportBeanCombinedProps.MakeDefaultBean(); _eventSimple = new BeanEventBean(_objSimple, _eventTypeSimple); _eventComplex = new BeanEventBean(_objComplex, _eventTypeComplex); _eventNested = new BeanEventBean(_objCombined, _eventTypeNested); }
public void SetUp() { _container = SupportContainer.Reset(); EPServiceProviderManager.PurgeAllProviders(); _eventTypeSimple = new BeanEventType(_container, null, 0, typeof(SupportBeanSimple), _container.Resolve <EventAdapterService>(), null); _eventTypeComplex = new BeanEventType(_container, null, 0, typeof(SupportBeanComplexProps), _container.Resolve <EventAdapterService>(), null); _eventTypeNested = new BeanEventType(_container, null, 0, typeof(SupportBeanCombinedProps), _container.Resolve <EventAdapterService>(), null); _objSimple = new SupportBeanSimple("a", 20); _objComplex = SupportBeanComplexProps.MakeDefaultBean(); _objCombined = SupportBeanCombinedProps.MakeDefaultBean(); _eventSimple = new BeanEventBean(_objSimple, _eventTypeSimple); _eventComplex = new BeanEventBean(_objComplex, _eventTypeComplex); _eventNested = new BeanEventBean(_objCombined, _eventTypeNested); }
private void AssertSimple() { SupportBeanSimple theEvent = SendSimpleEvent("string"); Assert.AreEqual("stringstring", _listener.LastNewData[0].Get("concat")); IDictionary <String, Object> properties = new Dictionary <String, Object>(); properties["concat"] = "stringstring"; properties["MyString"] = "string"; properties["MyInt"] = 0; AssertProperties(properties, _listener); Assert.AreEqual(typeof(Pair <object, Map>), _listener.LastNewData[0].EventType.UnderlyingType); Assert.That(_listener.LastNewData[0].Underlying, Is.InstanceOf <Pair <object, Map> >()); var pair = (Pair <object, IDictionary <string, object> >)_listener.LastNewData[0].Underlying; Assert.AreEqual(theEvent, pair.First); Assert.AreEqual("stringstring", pair.Second.Get("concat")); }
private void AssertSimple(EPServiceProvider epService, SupportUpdateListener listener) { SupportBeanSimple theEvent = SendSimpleEvent(epService, "string"); Assert.AreEqual("stringstring", listener.LastNewData[0].Get("concat")); var properties = new Dictionary <string, object>(); properties.Put("concat", "stringstring"); properties.Put("myString", "string"); properties.Put("myInt", 0); AssertProperties(properties, listener); Assert.AreEqual(typeof(Pair <object, Map>), listener.LastNewData[0].EventType.UnderlyingType); Assert.IsTrue(listener.LastNewData[0].Underlying is Pair <object, Map>); var pair = (Pair <object, Map>)listener.LastNewData[0].Underlying; Assert.AreEqual(theEvent, pair.First); Assert.AreEqual("stringstring", ((Map)pair.Second).Get("concat")); }