示例#1
0
        public void SetUp()
        {
            _eventService = SupportEventAdapterService.Service;
            EventType underlyingEventTypeSimple   = _eventService.AddBeanType("UnderlyingSimpleBean", typeof(SupportBeanSimple), true, true, true);
            EventType underlyingEventTypeCombined = _eventService.AddBeanType("UnderlyingCombinedBean", typeof(SupportBeanCombinedProps), true, true, true);

            IDictionary <String, Object> typeMap = new Dictionary <String, Object>();

            typeMap["string"] = typeof(string);
            typeMap["int"]    = typeof(int);

            EventTypeMetadata meta = EventTypeMetadata.CreateWrapper("test", true, false, false);

            _eventTypeSimple      = new WrapperEventType(meta, "mytype", 1, underlyingEventTypeSimple, typeMap, _eventService);
            _eventTypeCombined    = new WrapperEventType(meta, "mytype", 1, underlyingEventTypeCombined, typeMap, _eventService);
            _properties           = new Dictionary <String, Object>();
            _properties["string"] = "xx";
            _properties["int"]    = 11;

            EventBean wrappedSimple = _eventService.AdapterForObject(new SupportBeanSimple("EventString", 0));

            _eventBeanSimple = _eventService.AdapterForTypedWrapper(wrappedSimple, _properties, _eventTypeSimple);

            EventBean wrappedCombined = _eventService.AdapterForObject(SupportBeanCombinedProps.MakeDefaultBean());

            _eventBeanCombined = _eventService.AdapterForTypedWrapper(wrappedCombined, _properties, _eventTypeCombined);
        }
示例#2
0
        public void SetUp()
        {
            _underlyingEventTypeOne         = new BeanEventType(null, 1, typeof(SupportBeanSimple), SupportEventAdapterService.Service, null);
            _underlyingEventTypeTwo         = new BeanEventType(null, 1, typeof(SupportBean_A), SupportEventAdapterService.Service, null);
            _properties                     = new Dictionary <String, Object>();
            _properties["additionalString"] = typeof(string);
            _properties["AdditionalInt"]    = typeof(int);
            _eventAdapterService            = SupportEventAdapterService.Service;
            EventTypeMetadata meta = EventTypeMetadata.CreateWrapper("test", true, false, false);

            _eventType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeOne, _properties, _eventAdapterService);
        }
示例#3
0
        public void TestTypeUpdate()
        {
            IDictionary <String, Object> typeOne = new Dictionary <String, Object>();

            typeOne["field1"] = typeof(string);
            MapEventType      underlying = new MapEventType(EventTypeMetadata.CreateAnonymous("noname", ApplicationType.MAP), "noname", 1, _eventAdapterService, typeOne, null, null, null);
            EventTypeMetadata meta       = EventTypeMetadata.CreateWrapper("test", true, false, false);

            _eventType = new WrapperEventType(meta, "mytype", 1, underlying, _properties, _eventAdapterService);

            EPAssertionUtil.AssertEqualsAnyOrder(new[] { "additionalString", "AdditionalInt", "field1" }, _eventType.PropertyNames);
            underlying.AddAdditionalProperties(Collections.SingletonDataMap("field2", typeof(string)), _eventAdapterService);
            EPAssertionUtil.AssertEqualsAnyOrder(new[] { "additionalString", "AdditionalInt", "field1", "field2" }, _eventType.PropertyNames);
            Assert.AreEqual(4, _eventType.PropertyDescriptors.Count);
            Assert.AreEqual(typeof(string), _eventType.GetPropertyDescriptor("field2").PropertyType);
        }
示例#4
0
        public void TestEquals()
        {
            IDictionary <String, Object> otherProperties = new Dictionary <String, Object>(_properties);
            EventTypeMetadata            meta            = EventTypeMetadata.CreateWrapper("test", true, false, false);
            EventTypeSPI otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeOne, otherProperties, _eventAdapterService);

            Assert.IsTrue(_eventType.EqualsCompareType(otherType));
            Assert.IsTrue(otherType.EqualsCompareType(_eventType));

            otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeTwo, otherProperties, _eventAdapterService);
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));

            otherProperties["anotherProperty"] = typeof(int);
            otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeOne, otherProperties, _eventAdapterService);
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));

            otherType = (EventTypeSPI)_underlyingEventTypeOne;
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));
        }