Пример #1
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));
        }
Пример #2
0
        public static void Validate3Stream(ExprNode topNode)
        {
            var streamTypeService = new SupportStreamTypeSvc3Stream();

            var factoriesPerStream = new ViewFactoryChain[3];

            for (var i = 0; i < factoriesPerStream.Length; i++)
            {
                var factories = new List <ViewFactory>();
                factories.Add(new LengthWindowViewFactory());
                factoriesPerStream[i] = new ViewFactoryChain(streamTypeService.EventTypes[i], factories);
            }
            var viewResources = new ViewResourceDelegateUnverified();

            EngineImportService engineImportService = SupportEngineImportServiceFactory.Make();

            VariableService variableService = new VariableServiceImpl(0, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.Service, null);

            variableService.CreateNewVariable(null, "IntPrimitive", typeof(int?).FullName, false, false, false, 10, engineImportService);
            variableService.AllocateVariableState("IntPrimitive", EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, null, false);
            variableService.CreateNewVariable(null, "var1", typeof(string).FullName, false, false, false, "my_variable_value", engineImportService);
            variableService.AllocateVariableState("var1", EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, null, false);

            ExprNodeUtility.GetValidatedSubtree(
                ExprNodeOrigin.SELECT, topNode, new ExprValidationContext(
                    streamTypeService, SupportEngineImportServiceFactory.Make(),
                    null, viewResources,
                    null, variableService, null,
                    new SupportExprEvaluatorContext(null),
                    null, null, 1, null, null, null,
                    false, false, false, false, null, false));
        }
Пример #3
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();
            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);
        }
 public static EPLTreeWalkerListener MakeWalker(CommonTokenStream tokenStream)
 {
     return(MakeWalker(
                tokenStream,
                SupportEngineImportServiceFactory.Make(),
                new VariableServiceImpl(0, null, SupportEventAdapterService.Service, null)));
 }
Пример #6
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _service   = new EventAdapterServiceImpl(
         _container,
         new EventTypeIdGeneratorImpl(), 5, null,
         SupportEngineImportServiceFactory.Make(_container));
 }
Пример #7
0
        public static EPLTreeWalkerListener ParseAndWalkEPL(String expression)
        {
            var container = SupportContainer.Instance;

            return(ParseAndWalkEPL(expression,
                                   SupportEngineImportServiceFactory.Make(container),
                                   new VariableServiceImpl(container, 0, null, container.Resolve <EventAdapterService>(), null)));
        }
Пример #8
0
        public static EPLTreeWalkerListener MakeWalker(CommonTokenStream tokenStream)
        {
            var container = SupportContainer.Instance;

            return(MakeWalker(
                       tokenStream,
                       SupportEngineImportServiceFactory.Make(container),
                       new VariableServiceImpl(
                           container, 0, null, container.Resolve <EventAdapterService>(), null)));
        }
Пример #9
0
        public static StatementContext MakeContext(SchedulingService stub)
        {
            var variableService = new VariableServiceImpl(1000, null, SupportEventAdapterService.Service, null);
            var config          = new Configuration();

            config.EngineDefaults.ViewResourcesConfig.IsAllowMultipleExpiryPolicies = true;

            var stmtEngineServices = new StatementContextEngineServices(
                "engURI",
                SupportEventAdapterService.Service,
                new NamedWindowServiceImpl(null, variableService, new TableServiceImpl(), false, ReaderWriterLockManager.CreateDefaultLock(), new ExceptionHandlingService("engURI", Collections.GetEmptyList <ExceptionHandler>(), Collections.GetEmptyList <ConditionHandler>()), false, null),
                null, new TableServiceImpl(),
                new EngineSettingsService(new Configuration().EngineDefaults, new Uri[0]),
                new ValueAddEventServiceImpl(),
                config,
                null,
                null,
                null,
                null,
                new StatementEventTypeRefImpl(),
                null,
                null,
                null,
                null);

            return(new StatementContext(
                       stmtEngineServices,
                       null,
                       stub,
                       new ScheduleBucket(1),
                       new EPStatementHandle("id1", "name1", "epl1", StatementType.SELECT, "epl1", false, null, 0, false, false, MultiMatchHandlerFactory.DefaultHandler),
                       new ViewResolutionServiceImpl(new PluggableObjectRegistryImpl(new PluggableObjectCollection[] { ViewEnumHelper.BuiltinViews }), null, null),
                       new PatternObjectResolutionServiceImpl(null),
                       null,
                       null,
                       new MethodResolutionServiceImpl(SupportEngineImportServiceFactory.Make(), null),
                       null,
                       null,
                       new StatementResultServiceImpl("name", null, null, new ThreadingServiceImpl(new ConfigurationEngineDefaults.Threading())),  // statement result svc
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       false,
                       null,
                       null,
                       AggregationServiceFactoryServiceImpl.DEFAULT_FACTORY,
                       null,
                       false,
                       null));
        }
Пример #10
0
        public static DatabaseConfigServiceImpl MakeService()
        {
            IDictionary <string, ConfigurationDBRef> configs = new Dictionary <String, ConfigurationDBRef>();

            configs.Put(DBNAME_FULL, DbConfigReferenceNative);
            configs.Put(DBNAME_PART, DbConfigReferenceODBC);

            return(new DatabaseConfigServiceImpl(configs,
                                                 new SupportSchedulingServiceImpl(), null,
                                                 SupportEngineImportServiceFactory.Make(SupportContainer.Instance)));
        }
Пример #11
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _service   = new VariableServiceImpl(
         _container, 10000,
         new SchedulingServiceImpl(
             new TimeSourceServiceImpl(),
             _container.Resolve <ILockManager>()),
         _container.Resolve <EventAdapterService>(), null);
     _engineImportService = SupportEngineImportServiceFactory.Make(
         _container.Resolve <ClassLoaderProvider>());
 }
Пример #12
0
        public void SetUp()
        {
            IList <ConfigurationPlugInPatternObject> init = new List <ConfigurationPlugInPatternObject>();

            init.Add(MakeGuardSpec("g", "h", typeof(SupportGuardFactory).FullName));
            init.Add(MakeObserverSpec("a", "b", typeof(SupportObserverFactory).FullName));
            PluggableObjectCollection desc = new PluggableObjectCollection();

            desc.AddPatternObjects(init, SupportEngineImportServiceFactory.Make());
            desc.AddObjects(PatternObjectHelper.BuiltinPatternObjects);
            service = new PatternObjectResolutionServiceImpl(desc);
        }
 private void TryInvalid(IEnumerable <ConfigurationPlugInPatternObject> config)
 {
     try
     {
         var desc = new PluggableObjectCollection();
         desc.AddPatternObjects(config.ToList(), SupportEngineImportServiceFactory.Make(_container));
         _service = new PatternObjectResolutionServiceImpl(_container, desc);
         Assert.Fail();
     }
     catch (ConfigurationException)
     {
         // expected
     }
 }
Пример #14
0
        private ViewResolutionService CreateService(string[] namespaces, string[] names, string[] classNames)
        {
            var configs = new List <ConfigurationPlugInView>();

            for (var i = 0; i < namespaces.Length; i++)
            {
                var config = new ConfigurationPlugInView();
                config.Namespace        = namespaces[i];
                config.Name             = names[i];
                config.FactoryClassName = classNames[i];
                configs.Add(config);
            }

            var desc = new PluggableObjectCollection();

            desc.AddViews(configs,
                          Collections.GetEmptyList <ConfigurationPlugInVirtualDataWindow>(),
                          SupportEngineImportServiceFactory.Make(_container));
            var registry = new PluggableObjectRegistryImpl(new[] { desc });

            return(new ViewResolutionServiceImpl(registry, null, null));
        }
Пример #15
0
 public void SetUp()
 {
     _service = new EventAdapterServiceImpl(new EventTypeIdGeneratorImpl(), 5, null, SupportEngineImportServiceFactory.Make());
 }
 public void SetUp()
 {
     _container           = SupportContainer.Reset();
     _engineImportService = SupportEngineImportServiceFactory.Make(_container);
 }
Пример #17
0
 public static EPLTreeWalkerListener ParseAndWalkEPL(String expression)
 {
     return(ParseAndWalkEPL(expression, SupportEngineImportServiceFactory.Make(), new VariableServiceImpl(0, null, SupportEventAdapterService.Service, null)));
 }
Пример #18
0
 public void SetUp()
 {
     _engineImportService = SupportEngineImportServiceFactory.Make();
 }
Пример #19
0
 public void SetUp()
 {
     _service             = new VariableServiceImpl(10000, new SchedulingServiceImpl(new TimeSourceServiceImpl()), SupportEventAdapterService.Service, null);
     _engineImportService = SupportEngineImportServiceFactory.Make();
 }