Пример #1
0
        private void RunAssertionAddRemoveFilter(FilterService service)
        {
            var eventType    = SupportEventTypeFactory.CreateBeanType(typeof(SupportBean));
            var spec         = SupportFilterSpecBuilder.Build(eventType, new Object[] { "TheString", FilterOperator.EQUAL, "HELLO" });
            var filterValues = spec.GetValueSet(null, null, null);

            var callables = new Func <bool> [5];

            for (int ii = 0; ii < callables.Length; ii++)
            {
                callables[ii] =
                    () =>
                {
                    var handle = new SupportFilterHandle();
                    for (int jj = 0; jj < 10000; jj++)
                    {
                        var entry = service.Add(filterValues, handle);
                        service.Remove(handle, entry);
                    }
                    return(true);
                };
            }

            Object[] result = TryMT(callables);
            EPAssertionUtil.AssertAllBooleanTrue(result);
        }
Пример #2
0
        public void TestAddBeanTypeClass()
        {
            var types = new HashSet <EventType>();

            var callables = new Callable[2];

            for (var i = 0; i < callables.Length; i++)
            {
                callables[i] = () =>
                {
                    var type = _service.AddBeanType("a", typeof(SupportMarketDataBean), true, true, true);
                    types.Add(type);

                    type = _service.AddBeanType("b", typeof(SupportMarketDataBean), true, true, true);
                    types.Add(type);
                    return(true);
                };
            }

            var result = TryMT(callables);

            EPAssertionUtil.AssertAllBooleanTrue(result);
            Assert.AreEqual(1, types.Count);
        }