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

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

            _service = new ViewResolutionServiceImpl(registry, null, null);
        }
 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>());
 }
Ejemplo n.º 3
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _service   = new EventAdapterServiceImpl(
         _container,
         new EventTypeIdGeneratorImpl(), 5, null,
         SupportEngineImportServiceFactory.Make(_container));
 }
Ejemplo n.º 4
0
        public override void SetUp()
        {
            base.SetUp();

            _container = SupportContainer.Reset();
            _sumNode   = new ExprSumNode(false);

            ValidatedNodeToTest = MakeNode(5, typeof(int));
        }
Ejemplo n.º 5
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var config = new Configuration(_container);

            config.EngineDefaults.Threading.IsInternalTimerEnabled = false;
            _engine = EPServiceProviderManager.GetDefaultProvider(_container, config);
        }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
0
 public void SetUp()
 {
     _container         = SupportContainer.Reset();
     _schemaTypeId      = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Id);
     _schemaTypeString  = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String);
     _schemaTypeBoolean = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean);
     _schemaTypeDecimal = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Decimal);
     _schemaTypeInt     = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Int);
 }
Ejemplo n.º 8
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _statementResultService = new StatementResultServiceImpl(
         "name", null, null, new ThreadingServiceImpl(new ConfigurationEngineDefaults.ThreadingConfig()),
         _container.ThreadLocalManager());
     _selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(
         "abc", new StatementEventTypeRefImpl(_container.RWLockManager()));
 }
Ejemplo n.º 9
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _lockFactory     = new FilterServiceGranularLockFactoryReentrant(_container.RWLockManager());
            _eventType       = SupportEventTypeFactory.CreateBeanType(typeof(SupportBean));
            _topNode         = new FilterHandleSetNode(_container.RWLockManager().CreateDefaultLock());
            _filterCallbacks = new List <FilterHandle>();
            _pathsAddedTo    = new List <ArrayDeque <EventTypeIndexBuilderIndexLookupablePair> >();

            _testFilterSpecs = new List <FilterSpecCompiled>();
            _matchedEvents   = new List <EventBean>();
            _unmatchedEvents = new List <EventBean>();

            // Any int and double value specified here must match only the current filter spec not any other filter spec
            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.GREATER_OR_EQUAL, 100000 }));
            _matchedEvents.Add(MakeEvent(9999999, -1));
            _unmatchedEvents.Add(MakeEvent(0, -1));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.GREATER_OR_EQUAL, 10,
                                                         "DoublePrimitive", FilterOperator.EQUAL, 0.5 }));
            _matchedEvents.Add(MakeEvent(10, 0.5));
            _unmatchedEvents.Add(MakeEvent(0, 0.5));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "DoublePrimitive", FilterOperator.EQUAL, 0.8 }));
            _matchedEvents.Add(MakeEvent(-1, 0.8));
            _unmatchedEvents.Add(MakeEvent(-1, 0.1));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "DoublePrimitive", FilterOperator.EQUAL, 99.99,
                                                         "IntPrimitive", FilterOperator.LESS, 1 }));
            _matchedEvents.Add(MakeEvent(0, 99.99));
            _unmatchedEvents.Add(MakeEvent(2, 0.5));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "DoublePrimitive", FilterOperator.GREATER, .99,
                                                         "IntPrimitive", FilterOperator.EQUAL, 5001 }));
            _matchedEvents.Add(MakeEvent(5001, 1.1));
            _unmatchedEvents.Add(MakeEvent(5002, 0.98));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.LESS, -99000 }));
            _matchedEvents.Add(MakeEvent(-99001, -1));
            _unmatchedEvents.Add(MakeEvent(-98999, -1));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.GREATER_OR_EQUAL, 11,
                                                         "DoublePrimitive", FilterOperator.GREATER, 888.0 }));
            _matchedEvents.Add(MakeEvent(11, 888.001));
            _unmatchedEvents.Add(MakeEvent(10, 888));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.EQUAL, 973,
                                                         "DoublePrimitive", FilterOperator.EQUAL, 709.0 }));
            _matchedEvents.Add(MakeEvent(973, 709));
            _unmatchedEvents.Add(MakeEvent(0, 0.5));

            _testFilterSpecs.Add(MakeSpec(new Object[] { "IntPrimitive", FilterOperator.EQUAL, 973,
                                                         "DoublePrimitive", FilterOperator.EQUAL, 655.0 }));
            _matchedEvents.Add(MakeEvent(973, 655));
            _unmatchedEvents.Add(MakeEvent(33838, 655.5));
        }
Ejemplo n.º 10
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _bean              = SupportBeanComplexProps.MakeDefaultBean();
            _event             = SupportEventBeanFactory.CreateObject(_bean);
            _getter            = MakeGetter(0);
            _getterOutOfBounds = MakeGetter(int.MaxValue);
        }
Ejemplo n.º 11
0
 public void SetUp()
 {
     _container            = SupportContainer.Reset();
     _beanEventTypeFactory = new BeanEventAdapter(
         _container,
         new ConcurrentDictionary <Type, BeanEventType>(),
         _container.Resolve <EventAdapterService>(),
         new EventTypeIdGeneratorImpl());
 }
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            var configuration = new Configuration(_container);

            _serviceProvider = EPServiceProviderManager.GetDefaultProvider(configuration);
            _serviceProvider.Initialize();
        }
Ejemplo n.º 13
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)
     };
 }
Ejemplo n.º 14
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            for (var i = 0; i < _lists.Length; i++)
            {
                _lists[i] = new UnindexedEventTableImpl(0);
            }
        }
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _bean  = new SupportLegacyBean(new[] { "a", "b" });
            _event = SupportEventBeanFactory.CreateObject(_bean);

            _getter            = MakeGetter(0);
            _getterOutOfBounds = MakeGetter(int.MaxValue);
        }
 public void SetUp()
 {
     _container     = SupportContainer.Reset();
     _lockFactory   = new FilterServiceGranularLockFactoryReentrant(_container.RWLockManager());
     _testEvaluator = new SupportEventEvaluator();
     _testBean      = new SupportBean();
     _testEventBean = SupportEventBeanFactory.CreateObject(_testBean);
     _testEventType = _testEventBean.EventType;
     _matchesList   = new List <FilterHandle>();
 }
 public void SetUp()
 {
     _container            = SupportContainer.Reset();
     _typeService1Stream   = new SupportStreamTypeSvc1Stream();
     _typeService3Stream   = new SupportStreamTypeSvc3Stream();
     _groupByList          = new List <ExprNode>();
     _orderByList          = new List <OrderByItem>();
     _agentInstanceContext = SupportStatementContextFactory.MakeAgentInstanceContext(_container);
     _stmtContext          = _agentInstanceContext.StatementContext;
 }
Ejemplo n.º 18
0
        public void SetUp()
        {
            _container = SupportContainer.Reset(); _existsNodes = new ExprPropertyExistsNode[2];

            _existsNodes[0] = new ExprPropertyExistsNode();
            _existsNodes[0].AddChildNode(SupportExprNodeFactory.MakeIdentNode("dummy?", "s0"));

            _existsNodes[1] = new ExprPropertyExistsNode();
            _existsNodes[1].AddChildNode(SupportExprNodeFactory.MakeIdentNode("BoolPrimitive?", "s0"));
        }
Ejemplo n.º 19
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();
            _mapped    = new MappedProperty[2];
            _mapped[0] = new MappedProperty("Mapped", "keyOne");
            _mapped[1] = new MappedProperty("Mapped", "keyTwo");

            _theEvent  = SupportEventBeanFactory.CreateObject(SupportBeanComplexProps.MakeDefaultBean());
            _eventType = (BeanEventType)_theEvent.EventType;
        }
Ejemplo n.º 20
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)
     };
     _dependencyGraph = new DependencyGraph(2, false);
     _isHistorical    = new bool[2];
 }
Ejemplo n.º 21
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _variableService = new VariableServiceImpl(_container, 100, null, null, null);
            _variableService.CreateNewVariable(null, "var1", "string", true, false, false, null, null);
            _variableService.CreateNewVariable(null, "dummy", "string", true, false, false, null, null);
            _variableService.CreateNewVariable(null, "IntPrimitive", "int", true, false, false, null, null);
            _varNode = new ExprVariableNodeImpl(_variableService.GetVariableMetaData("var1"), null);
        }
Ejemplo n.º 22
0
 public void SetUp()
 {
     _container          = SupportContainer.Reset();
     _prop               = new SimpleProperty("SimpleProperty");
     _invalidPropMap     = new SimpleProperty("Mapped");
     _invalidPropIndexed = new SimpleProperty("Indexed");
     _invalidDummy       = new SimpleProperty("Dummy");
     _theEvent           = SupportEventBeanFactory.CreateObject(SupportBeanComplexProps.MakeDefaultBean());
     _eventType          = (BeanEventType)_theEvent.EventType;
 }
Ejemplo n.º 23
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _testEvaluator = new SupportEventEvaluator();
            _testBean      = new SupportBean();
            _testEventBean = SupportEventBeanFactory.CreateObject(_testBean);
            _testEventType = _testEventBean.EventType;
            _matchesList   = new List <FilterHandle>();
        }
Ejemplo n.º 24
0
        public void SetUp()
        {
            var configuration = new Configuration(SupportContainer.Reset());

            configuration.Runtime.Threading.IsInternalTimerEnabled = false;
            configuration.Common.AddImportNamespace(typeof(FileSinkFactory));
            configuration.Common.AddImportNamespace(typeof(DefaultSupportSourceOpForge));
            DefaultSupportGraphEventUtil.AddTypeConfiguration(configuration);
            runtime = EPRuntimeProvider.GetDefaultRuntime(configuration);
            runtime.Initialize();
        }
Ejemplo n.º 25
0
        public override void SetUp()
        {
            base.SetUp();

            _container = SupportContainer.Reset();

            _maxNode = new ExprMinMaxAggrNode(false, MinMaxTypeEnum.MAX, false, false);
            _minNode = new ExprMinMaxAggrNode(false, MinMaxTypeEnum.MIN, false, false);

            ValidatedNodeToTest = MakeNode(MinMaxTypeEnum.MAX, 5, typeof(int));
        }
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            SupportBean testEvent = new SupportBean();
            testEvent.IntPrimitive = 10;
            testEvent.TheString = "a";
            testEvent.DoubleBoxed = null;
    
            _unitTestBean = SupportEventBeanFactory.CreateObject(testEvent);
        }
Ejemplo n.º 27
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            _castNodes = new ExprCastNode[2];

            _castNodes[0] = new ExprCastNode("long");
            _castNodes[0].AddChildNode(new SupportExprNode(10L, typeof(long)));

            _castNodes[1] = new ExprCastNode("" + typeof(int?).FullName + "");
            _castNodes[1].AddChildNode(new SupportExprNode(0x10, typeof(byte)));
        }
Ejemplo n.º 28
0
        public void SetUp()
        {
            _container   = SupportContainer.Reset();
            _eventSource = _container.Resolve <EventAdapterService>();

            _types    = new EventType[5];
            _types[0] = _eventSource.AddBeanType("D1", typeof(SupportDeltaOne), false, false, false);
            _types[1] = _eventSource.AddBeanType("D2", typeof(SupportDeltaTwo), false, false, false);
            _types[2] = _eventSource.AddBeanType("D3", typeof(SupportDeltaThree), false, false, false);
            _types[3] = _eventSource.AddBeanType("D4", typeof(SupportDeltaFour), false, false, false);
            _types[4] = _eventSource.AddBeanType("D5", typeof(SupportDeltaFive), false, false, false);
        }
Ejemplo n.º 29
0
        public void SetUp()
        {
            _container  = SupportContainer.Reset();
            _indexed    = new IndexedProperty[4];
            _indexed[0] = new IndexedProperty("Indexed", 0);
            _indexed[1] = new IndexedProperty("Indexed", 1);
            _indexed[2] = new IndexedProperty("ArrayProperty", 0);
            _indexed[3] = new IndexedProperty("ArrayProperty", 1);

            _theEvent  = SupportEventBeanFactory.CreateObject(SupportBeanComplexProps.MakeDefaultBean());
            _eventType = (BeanEventType)_theEvent.EventType;
        }
Ejemplo n.º 30
0
        public void SetUp()
        {
            _container = SupportContainer.Reset();

            // Set up length window view and a test child view
            EventType type = SizeView.CreateEventType(SupportStatementContextFactory.MakeContext(_container), null, 1);

            _myView = new SizeView(SupportStatementContextFactory.MakeAgentInstanceContext(_container), type, null);

            _childView = new SupportBeanClassView(typeof(SupportMarketDataBean));
            _myView.AddView(_childView);
        }