Exemplo n.º 1
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _propertyTypes = new Dictionary <String, Object>();
            _propertyTypes.Put("myInt", typeof(int?));
            _propertyTypes.Put("myDouble", typeof(double?));
            _propertyTypes.Put("myString", typeof(String));

            _eventTypeName = "mapEvent";
            var configuration = new Configuration(_container);

            configuration.AddEventType(_eventTypeName, _propertyTypes);
            configuration.AddEventType("myNonMapEvent", typeof(Type).FullName);

            _epService = EPServiceProviderManager.GetProvider(_container, "CSVProvider", configuration);
            _epService.Initialize();
            EPAdministrator administrator = _epService.EPAdministrator;

            String      statementText = "select * from mapEvent#length(5)";
            EPStatement statement     = administrator.CreateEPL(statementText);

            _listener         = new SupportUpdateListener();
            statement.Events += _listener.Update;

            // Turn off external clocking
            _epService.EPRuntime.SendEvent(new TimerControlEvent(TimerControlEvent.ClockTypeEnum.CLOCK_EXTERNAL));

            // Set the clock to 0
            _currentTime = 0;
            SendTimeEvent(0);

            _propertyOrderNoTimestamps = new[] { "myInt", "myDouble", "myString" };
            _propertyOrderTimestamps   = new[] { "timestamp", "myInt", "myDouble", "myString" };
        }
Exemplo n.º 2
0
 public void SetUp()
 {
     _container             = SupportContainer.Reset();
     _likeNodeNormal        = SupportExprNodeFactory.MakeLikeNode(false, null);
     _likeNodeNot           = SupportExprNodeFactory.MakeLikeNode(true, null);
     _likeNodeNormalEscaped = SupportExprNodeFactory.MakeLikeNode(false, "!");
 }
Exemplo n.º 3
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            SupportLegacyBean testEvent = new SupportLegacyBean("a");

            _unitTestBean = SupportEventBeanFactory.CreateObject(testEvent);
        }
Exemplo n.º 4
0
        public void TestRollover()
        {
            _container = SupportContainer.Reset();
            _service   = new VariableServiceImpl(
                _container,
                VariableServiceImpl.ROLLOVER_READER_BOUNDARY - 100,
                10000,
                new SchedulingServiceImpl(
                    new TimeSourceServiceImpl(), _container.Resolve <ILockManager>()),
                _container.Resolve <EventAdapterService>(),
                null);

            String[] variables = "a,b,c,d".Split(',');

            var readers = new VariableReader[variables.Length];

            for (int i = 0; i < variables.Length; i++)
            {
                _service.CreateNewVariable <long>(null, variables[i], false, 100L, _engineImportService);
                _service.AllocateVariableState(variables[i], EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, null, false);
                readers[i] = _service.GetReader(variables[i], EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID);
            }

            for (int i = 0; i < 1000; i++)
            {
                for (int j = 0; j < variables.Length; j++)
                {
                    _service.Write(readers[j].VariableMetaData.VariableNumber, EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, 100L + i);
                    _service.Commit();
                }
                ReadCompare(variables, 100L + i);
            }
        }
Exemplo n.º 5
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _propertyTypes = new Dictionary<String, Object>();
            _propertyTypes.Put("MyInt", typeof(int?));
            _propertyTypes.Put("MyDouble", typeof(double?));
            _propertyTypes.Put("MyString", typeof(String));

            _eventTypeName = "mapEvent";
            var configuration = new Configuration(_container);
            configuration.Runtime.Threading.IsInternalTimerEnabled = false;
            configuration.Common.AddEventType(_eventTypeName, _propertyTypes);
            configuration.Common.AddEventType("myNonMapEvent", typeof(Type).FullName);

            _runtime = EPRuntimeProvider.GetRuntime("CSVProvider", configuration);
            _runtime.Initialize();

            var statementText = "select * from mapEvent#length(5)";
            var statement = CompileDeploy(_runtime, statementText).Statements[0];

            _listener = new SupportUpdateListener();
            statement.Events += _listener.Update;

            // Set the clock to 0
            _currentTime = 0;
            SendTimeEvent(0);

            _propertyOrderNoTimestamps = new[] {"MyInt", "MyDouble", "MyString"};
            _propertyOrderTimestamps = new[] {"timestamp", "MyInt", "MyDouble", "MyString"};
        }
Exemplo n.º 6
0
        public void SetUp()
        {
            _container      = SupportContainer.Reset();
            _typesPerStream = new EventType[]
            {
                _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S0).FullName, typeof(SupportBean_S0),
                                                                       true, true, true),
                _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S1).FullName, typeof(SupportBean_S1),
                                                                       true, true, true),
                _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S2).FullName, typeof(SupportBean_S2),
                                                                       true, true, true),
                _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S3).FullName, typeof(SupportBean_S3),
                                                                       true, true, true),
                _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S4).FullName, typeof(SupportBean_S4),
                                                                       true, true, true)
            };

            _queryGraph = new QueryGraph(5, null, false);
            _queryGraph.AddStrictEquals(0, "P00", Make(0, "P00"), 1, "P10", Make(1, "P10"));
            _queryGraph.AddStrictEquals(0, "P01", Make(0, "P01"), 2, "P20", Make(2, "P20"));
            _queryGraph.AddStrictEquals(4, "P40", Make(4, "P40"), 3, "P30", Make(3, "P30"));
            _queryGraph.AddStrictEquals(4, "P41", Make(4, "P41"), 3, "P31", Make(3, "P31"));
            _queryGraph.AddStrictEquals(4, "P42", Make(4, "P42"), 2, "P21", Make(2, "P21"));

            _dependencyGraph = new DependencyGraph(5, false);
        }
Exemplo n.º 7
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _eventService = _container.Resolve <EventAdapterService>();
            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);
        }
Exemplo n.º 8
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _arrayNodes    = new ExprArrayNode[4];
            _arrayNodes[0] = new ExprArrayNode();

            // no coercion array
            _arrayNodes[1] = new ExprArrayNode();
            _arrayNodes[1].AddChildNode(new SupportExprNode(2));
            _arrayNodes[1].AddChildNode(new SupportExprNode(3));

            // coercion
            _arrayNodes[2] = new ExprArrayNode();
            _arrayNodes[2].AddChildNode(new SupportExprNode(1.5D));
            _arrayNodes[2].AddChildNode(new SupportExprNode(1));

            // mixed types
            _arrayNodes[3] = new ExprArrayNode();
            _arrayNodes[3].AddChildNode(new SupportExprNode("a"));
            _arrayNodes[3].AddChildNode(new SupportExprNode(1));

            for (int i = 0; i < _arrayNodes.Length; i++)
            {
                _arrayNodes[i].Validate(SupportExprValidationContextFactory.MakeEmpty(_container));
            }
        }
Exemplo n.º 9
0
        public void SetUp()
        {
            _container   = SupportContainer.Reset();
            _lockFactory = new FilterServiceGranularLockFactoryReentrant(
                _container.Resolve <IReaderWriterLockManager>());

            var testBean = new SupportBean();

            testBean.IntPrimitive    = 50;
            testBean.DoublePrimitive = 0.5;
            testBean.TheString       = "jack";
            testBean.LongPrimitive   = 10;
            testBean.ShortPrimitive  = (short)20;

            _eventBean = SupportEventBeanFactory.CreateObject(testBean);
            _eventType = _eventBean.EventType;

            _matches = new List <FilterHandle>();

            // Allocate a couple of callbacks
            _testFilterCallback = new SupportFilterHandle[20];
            for (var i = 0; i < _testFilterCallback.Length; i++)
            {
                _testFilterCallback[i] = new SupportFilterHandle();
            }
        }
Exemplo n.º 10
0
        public void SetUp()
        {
            _container            = SupportContainer.Reset();
            _agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext(_container);

            var selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(
                "abc", new StatementEventTypeRefImpl(_container.RWLockManager()));
            var factory = new SelectExprProcessorHelper(
                Collections.GetEmptyList <int>(),
                SupportSelectExprFactory.MakeSelectListFromIdent("TheString", "s0"),
                Collections.GetEmptyList <SelectExprStreamDesc>(),
                null, null, false,
                new SupportStreamTypeSvc1Stream(),
                _container.Resolve <EventAdapterService>(), null,
                selectExprEventTypeRegistry,
                _agentInstanceContext.StatementContext.EngineImportService,
                1, "stmtname", null,
                new Configuration(_container), null,
                new TableServiceImpl(_container),
                null);
            var selectProcessor = factory.GetEvaluator();

            _supportAggregationService = new SupportAggregationService();

            var groupKeyNodes = new ExprEvaluator[2];

            groupKeyNodes[0] = SupportExprNodeFactory.MakeIdentNode("IntPrimitive", "s0").ExprEvaluator;
            groupKeyNodes[1] = SupportExprNodeFactory.MakeIdentNode("IntBoxed", "s0").ExprEvaluator;

            var prototype = new ResultSetProcessorRowPerGroupFactory(selectProcessor, null, groupKeyNodes, null, true, false, null, false, false, false, false, null, false, 1, null);

            _processor = (ResultSetProcessorRowPerGroup)prototype.Instantiate(null, _supportAggregationService, _agentInstanceContext);
        }
Exemplo n.º 11
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var schema = new Dictionary <String, Object>();

            schema["STDDEV"] = typeof(double?);
            _parentEventType = SupportEventTypeFactory.CreateMapType(schema);

            var addProps = new Dictionary <String, Object>();

            addProps["Symbol"] = typeof(string);

            var mergeEventType = _container.Resolve <EventAdapterService>().CreateAnonymousWrapperType(
                "test", _parentEventType, addProps);

            // Set up length window view and a test child view
            _myView = new AddPropertyValueOptionalView(
                SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext(_container),
                new String[] { "Symbol" }, "IBM", mergeEventType);

            _parentView = new SupportMapView(schema);
            _parentView.AddView(_myView);

            _childView = new SupportSchemaNeutralView();
            _myView.AddView(_childView);
        }
Exemplo n.º 12
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _service = new SchedulingServiceImpl(
                new TimeSourceServiceImpl(), _container.Resolve <ILockManager>());
            _mgmtService = new SchedulingMgmtServiceImpl();

            // 2-by-2 table of buckets and slots
            var buckets = new ScheduleBucket[3];

            _slots = new long[buckets.Length][];
            for (int i = 0; i < buckets.Length; i++)
            {
                buckets[i] = _mgmtService.AllocateBucket();
                _slots[i]  = new long[2];
                for (int j = 0; j < _slots[i].Length; j++)
                {
                    _slots[i][j] = buckets[i].AllocateSlot();
                }
            }

            _callbacks = new SupportScheduleCallback[5];
            for (int i = 0; i < _callbacks.Length; i++)
            {
                _callbacks[i] = new SupportScheduleCallback();
            }
        }
Exemplo n.º 13
0
 public void SetUp()
 {
     _container          = SupportContainer.Reset();
     _factory            = new GroupByViewFactory();
     _viewFactoryContext = new ViewFactoryContext(
         SupportStatementContextFactory.MakeContext(_container), 1, null, null, false, -1, false);
 }
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            var selectList                  = SupportSelectExprFactory.MakeNoAggregateSelectList();
            var eventAdapterService         = _container.Resolve <EventAdapterService>();
            var vaeService                  = new SupportValueAddEventService();
            var selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(
                "abc", new StatementEventTypeRefImpl(_container.RWLockManager()));
            var engineImportService = SupportEngineImportServiceFactory.Make(_container);

            _methodOne = new SelectExprProcessorHelper(
                Collections.GetEmptyList <int>(), selectList, Collections.GetEmptyList <SelectExprStreamDesc>(),
                null, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService,
                selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null,
                new Configuration(_container), null,
                new TableServiceImpl(_container), null);

            var insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, "Hello");

            insertIntoDesc.Add("a");
            insertIntoDesc.Add("b");

            _methodTwo = new SelectExprProcessorHelper(
                Collections.GetEmptyList <int>(), selectList, Collections.GetEmptyList <SelectExprStreamDesc>(),
                insertIntoDesc, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService,
                selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null,
                new Configuration(_container), null,
                new TableServiceImpl(_container), null);
        }
Exemplo n.º 15
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var schemaUrl  = _container.ResourceManager().ResolveResourceURL("regression/simpleSchema.xsd");
            var configNoNS = new ConfigurationEventTypeXMLDOM();

            configNoNS.IsXPathPropertyExpr = true;
            configNoNS.SchemaResource      = schemaUrl.ToString();
            configNoNS.RootElementName     = "simpleEvent";
            configNoNS.AddXPathProperty("customProp", "count(/ss:simpleEvent/ss:nested3/ss:nested4)", XPathResultType.Number);
            configNoNS.AddNamespacePrefix("ss", "samples:schemas:simpleSchema");
            var model = XSDSchemaMapper.LoadAndMap(
                schemaUrl.ToString(), null, SupportEngineImportServiceFactory.Make(_container),
                _container.ResourceManager());
            var eventTypeNoNS = new SchemaXMLEventType(
                null, 1, configNoNS, model, _container.Resolve <EventAdapterService>(), _container.LockManager());

            var noNSDoc = new XmlDocument();

            using (var stream = _container.ResourceManager().GetResourceAsStream("regression/simpleWithSchema.xml"))
            {
                noNSDoc.Load(stream);
            }

            _eventSchemaOne = new XMLEventBean(noNSDoc.DocumentElement, eventTypeNoNS);
        }
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            const string sql = "select myvarchar from mytesttable where mynumeric = ? order by mybigint asc";

            var databaseConnectionFactory = SupportDatabaseService.MakeService().GetConnectionFactory("mydb");
            var connectionCache           = new ConnectionNoCacheImpl(databaseConnectionFactory, sql, null);

            var resultProperties = new Dictionary <String, Object>();

            resultProperties["myvarchar"] = typeof(string);
            var resultEventType = _container.Resolve <EventAdapterService>().CreateAnonymousMapType("test", resultProperties, true);

            IDictionary <String, DBOutputTypeDesc> propertiesOut = new Dictionary <String, DBOutputTypeDesc>();

            propertiesOut["myvarchar"] = new DBOutputTypeDesc("TIME", typeof(string), null);

            _dbPollExecStrategy = new PollExecStrategyDBQuery(
                _container.Resolve <EventAdapterService>(),
                resultEventType,
                connectionCache,
                sql,
                propertiesOut,
                null,
                null);
        }
Exemplo n.º 17
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            MetricReportingPath.IsMetricsEnabled = false;

            _listenerOne = new SupportUpdateListener();
            _listenerTwo = new SupportUpdateListener();
    
            var listenerSet = new EPStatementListenerSet();
            listenerSet.Events.Add(_listenerOne.Update);
            listenerSet.Events.Add(_listenerTwo.Update);
    
            _dispatchService = new DispatchServiceImpl(
                _container.ThreadLocalManager());

            _statementResultService = new StatementResultServiceImpl(
                "name", null, null,
                new ThreadingServiceImpl(new ConfigurationEngineDefaults.ThreadingConfig()),
                _container.ThreadLocalManager());
            _statementResultService.SetUpdateListeners(listenerSet, false);
            _statementResultService.SetSelectClause(
                new Type[1], new String[1], false, 
                new ExprEvaluator[1], new SupportExprEvaluatorContext(_container, null));
            _statementResultService.SetContext(new SupportEPStatementSPI(), null, false, false, false, false, null);

            _updateDispatchView = new UpdateDispatchViewBlockingWait(
                _statementResultService, _dispatchService, 1000, _container.ThreadLocalManager());
        }
Exemplo n.º 18
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            IDictionary <String, Object> propertyTypes = new LinkedHashMap <String, Object>();

            propertyTypes.Put("myInt", typeof(int));
            propertyTypes.Put("myDouble", typeof(double?));
            propertyTypes.Put("myString", typeof(String));

            _eventTypeName = "mapEvent";
            var configuration = new Configuration(_container);

            configuration.Runtime.Threading.IsInternalTimerEnabled = false;
            configuration.Common.AddEventType(_eventTypeName, propertyTypes);

            _runtime = EPRuntimeProvider.GetRuntime("Adapter", configuration);
            _runtime.Initialize();

            var statementText = "select * from mapEvent#length(5)";
            var statement     = CompileUtil.CompileDeploy(_runtime, statementText).Statements[0];

            _listener         = new SupportUpdateListener();
            statement.Events += _listener.Update;

            // Set the clock to 0
            _currentTime = 0;
            SendTimeEvent(0);

            _coordinator = new AdapterCoordinatorImpl(_runtime, true);

            _propertyOrderNoTimestamp = new[] { "myInt", "myDouble", "myString" };
            var propertyOrderTimestamp = new[] { "timestamp", "myInt", "myDouble", "myString" };

            // A CSVPlayer for a file with timestamps, not looping
            _timestampsNotLooping = new CSVInputAdapterSpec(new AdapterInputSource(_container, "regression/timestampOne.csv"), _eventTypeName);
            _timestampsNotLooping.IsUsingEngineThread = true;
            _timestampsNotLooping.PropertyOrder       = propertyOrderTimestamp;
            _timestampsNotLooping.TimestampColumn     = "timestamp";

            // A CSVAdapter for a file with timestamps, looping
            _timestampsLooping                     = new CSVInputAdapterSpec(new AdapterInputSource(_container, "regression/timestampTwo.csv"), _eventTypeName);
            _timestampsLooping.IsLooping           = true;
            _timestampsLooping.IsUsingEngineThread = true;
            _timestampsLooping.PropertyOrder       = propertyOrderTimestamp;
            _timestampsLooping.TimestampColumn     = "timestamp";

            // A CSVAdapter that sends 10 events per sec, not looping
            _noTimestampsNotLooping = new CSVInputAdapterSpec(new AdapterInputSource(_container, "regression/noTimestampOne.csv"), _eventTypeName);
            _noTimestampsNotLooping.EventsPerSec        = 10;
            _noTimestampsNotLooping.PropertyOrder       = _propertyOrderNoTimestamp;
            _noTimestampsNotLooping.IsUsingEngineThread = true;

            // A CSVAdapter that sends 5 events per sec, looping
            _noTimestampsLooping = new CSVInputAdapterSpec(new AdapterInputSource(_container, "regression/noTimestampTwo.csv"), _eventTypeName);
            _noTimestampsLooping.EventsPerSec        = 5;
            _noTimestampsLooping.IsLooping           = true;
            _noTimestampsLooping.PropertyOrder       = _propertyOrderNoTimestamp;
            _noTimestampsLooping.IsUsingEngineThread = true;
        }
Exemplo n.º 19
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _coalesceNodes = new ExprCoalesceNode[5];

            _coalesceNodes[0] = new ExprCoalesceNode();
            _coalesceNodes[0].AddChildNode(new SupportExprNode(null, typeof(long)));
            _coalesceNodes[0].AddChildNode(new SupportExprNode(null, typeof(int)));
            _coalesceNodes[0].AddChildNode(new SupportExprNode(4, typeof(byte)));

            _coalesceNodes[1] = new ExprCoalesceNode();
            _coalesceNodes[1].AddChildNode(new SupportExprNode(null, typeof(string)));
            _coalesceNodes[1].AddChildNode(new SupportExprNode("a", typeof(string)));

            _coalesceNodes[2] = new ExprCoalesceNode();
            _coalesceNodes[2].AddChildNode(new SupportExprNode(null, typeof(Boolean)));
            _coalesceNodes[2].AddChildNode(new SupportExprNode(true, typeof(bool)));

            _coalesceNodes[3] = new ExprCoalesceNode();
            _coalesceNodes[3].AddChildNode(new SupportExprNode(null, typeof(char)));
            _coalesceNodes[3].AddChildNode(new SupportExprNode(null, typeof(char)));
            _coalesceNodes[3].AddChildNode(new SupportExprNode(null, typeof(char)));
            _coalesceNodes[3].AddChildNode(new SupportExprNode('b', typeof(char)));

            _coalesceNodes[4] = new ExprCoalesceNode();
            _coalesceNodes[4].AddChildNode(new SupportExprNode(5, typeof(float)));
            _coalesceNodes[4].AddChildNode(new SupportExprNode(null, typeof(double?)));
        }
Exemplo n.º 20
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            var rLock = _container.LockManager().CreateLock(GetType());

            _list = new VersionedValueList <String>("abc", 2, "a", 1000, 10000, rLock, 10, true);
        }
Exemplo n.º 21
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var configs = new Dictionary <String, ConfigurationDBRef>();

            var config = new ConfigurationDBRef();

            config.SetDatabaseDriver(SupportDatabaseService.DbDriverFactoryNative);
            configs["name1"] = config;

            config = new ConfigurationDBRef();
            config.SetDatabaseDriver(SupportDatabaseService.DbDriverFactoryNative, new Properties());
            //config.SetDataSourceConnection("context", new Properties());
            config.LRUCache  = 10000;
            configs["name2"] = config;

            config = new ConfigurationDBRef();
            config.SetDatabaseDriver(SupportDatabaseService.DbDriverFactoryNative, new Properties());
            config.SetExpiryTimeCache(1, 3);
            configs["name3"] = config;

            SchedulingService schedulingService = new SchedulingServiceImpl(
                new TimeSourceServiceImpl(), _container.Resolve <ILockManager>());

            _databaseServiceImpl = new DatabaseConfigServiceImpl(
                configs, schedulingService, new ScheduleBucket(1),
                SupportEngineImportServiceFactory.Make(_container));
        }
Exemplo n.º 22
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _service   = new EventAdapterServiceImpl(
         _container,
         new EventTypeIdGeneratorImpl(), 5, null,
         SupportEngineImportServiceFactory.Make(_container));
 }
Exemplo n.º 23
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var registry = new PluggableObjectRegistryImpl(new[] { ViewEnumHelper.BuiltinViews });

            _service = new ViewResolutionServiceImpl(registry, null, null);
        }
Exemplo n.º 24
0
 public void before()
 {
     container = new SupportContainer();
     registry  = new ContainerRegistry();
     registry.SetParentFinder(new SupportParentFinder());
     viewManager = new ViewManager(registry);
     ViewNotifier.SetRegistry(registry);
 }
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _bean = SupportBeanComplexProps.MakeDefaultBean();
     _theEvent = SupportEventBeanFactory.CreateObject(_bean);
     var method = typeof(SupportBeanComplexProps).GetMethod("GetIndexed", new Type[] {typeof(int)});
     _getter = new KeyedMethodPropertyGetter(method, 1, _container.Resolve<EventAdapterService>());
 }
Exemplo n.º 26
0
 public void SetUp()
 {
     _container         = SupportContainer.Reset();
     _bean              = SupportBeanComplexProps.MakeDefaultBean();
     _event             = SupportEventBeanFactory.CreateObject(_bean);
     _getter            = MakeGetter(0);
     _getterOutOfBounds = MakeGetter(int.MaxValue);
 }
Exemplo n.º 27
0
        public static Configuration GetConfiguration()
        {
            var container = SupportContainer.Reset();

            Configuration config;
            string configFactoryClass = Environment.GetEnvironmentVariable(TEST_CONFIG_FACTORY_CLASS);
            if (configFactoryClass != null)
            {
                try
                {
                    var clazz = TypeHelper.ResolveType(configFactoryClass);
                    var instance = TypeHelper.Instantiate(clazz);
                    var m = clazz.GetMethod("GetConfigurationEsperRegression");
                    var result = m.Invoke(instance, new object[] { });
                    config = (Configuration) result;
                    config.Container = container;
                }
                catch (Exception e)
                {
                    throw new EPRuntimeException("Error using configuration factory class '" + configFactoryClass + "'", e);
                }
            }
            else
            {
                config = new Configuration(container);

#if NETFRAMEWORK
                config.Common.Scripting.AddEngine(typeof(ScriptingEngineJScript));
#endif
                config.Common.Scripting.AddEngine(typeof(ScriptingEngineJavascriptV8));
                
                // Runtime
                config.Runtime.Threading.IsInternalTimerEnabled = false;
                config.Runtime.ExceptionHandling.AddClass(typeof(SupportExceptionHandlerFactoryRethrow));
                config.Runtime.ExceptionHandling.UndeployRethrowPolicy = UndeployRethrowPolicy.RETHROW_FIRST;
                
                // Compiler
                config.Compiler.ByteCode.AttachEPL = true;

                if (!string.IsNullOrWhiteSpace(config.Compiler.Logging.AuditDirectory)) {
                    try {
                        Directory.Delete(config.Compiler.Logging.AuditDirectory, true);
                    }
                    catch (DirectoryNotFoundException) {
                    }

                    Directory.CreateDirectory(config.Compiler.Logging.AuditDirectory);
                }

                if (Environment.GetEnvironmentVariable(SYSTEM_PROPERTY_LOG_CODE) != null)
                {
                    config.Compiler.Logging.EnableCode = true;
                }
            }

            return config;
        }
Exemplo n.º 28
0
        public void addContainer_throws_if_containers_are_nested()
        {
            SupportContainer container1 = new SupportContainer();
            SupportContainer container2 = new SupportContainer();

            container1.AddChild(container2);
            viewManager.AddContainer(container1);
            viewManager.AddContainer(container2);
        }
        public void adding_two_fallbacks_should_remove_previous()
        {
            SupportContainer fallback1 = new SupportContainer();
            SupportContainer fallback2 = new SupportContainer();

            registry.SetFallbackContainer(fallback1);
            registry.SetFallbackContainer(fallback2);
            Assert.That(registry.FallbackBinding.Container, Is.EqualTo(fallback2));
        }
Exemplo n.º 30
0
 public void SetUp()
 {
     _container      = SupportContainer.Reset();
     _typesPerStream = new EventType[]
     {
         _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S0).FullName, typeof(SupportBean_S0), true, true, true),
         _container.Resolve <EventAdapterService>().AddBeanType(typeof(SupportBean_S1).FullName, typeof(SupportBean_S1), true, true, true)
     };
 }