Exemplo n.º 1
0
 public void TestClientRuntimeAnnotationImportInvalid()
 {
     RegressionSession session = RegressionRunner.Session();
     session.Configuration.Common.AddAnnotationImportType(typeof(SupportEnum));
     session.Configuration.Common.AddAnnotationImportType(typeof(MyAnnotationValueEnumAttribute));
     session.Configuration.Common.AddEventType(typeof(SupportBean));
     RegressionRunner.Run(session, new ClientRuntimeStatementAnnotation.ClientRuntimeAnnotationImportInvalid());
     session.Dispose();
 }
Exemplo n.º 2
0
 public void TestEventBeanPropertyResolutionCaseInsensitive()
 {
     RegressionSession session = RegressionRunner.Session();
     session.Configuration.Common.EventMeta.ClassPropertyResolutionStyle = PropertyResolutionStyle.CASE_INSENSITIVE;
     session.Configuration.Common.AddEventType(typeof(SupportBeanDupProperty));
     session.Configuration.Common.AddEventType(typeof(SupportBeanComplexProps));
     RegressionRunner.Run(session, new EventBeanPropertyResolutionCaseInsensitive());
     session.Dispose();
 }
Exemplo n.º 3
0
 public void TestRowRecogMaxStatesEngineWide4Instance()
 {
     RegressionSession session = RegressionRunner.Session();
     Configure(session.Configuration);
     session.Configuration.Runtime.MatchRecognize.MaxStates = 4L;
     session.Configuration.Runtime.MatchRecognize.IsMaxStatesPreventStart = true;
     RegressionRunner.Run(session, new RowRecogMaxStatesEngineWide4Instance());
     session.Dispose();
 }
Exemplo n.º 4
0
 public void TestInfraTableMTGroupedMergeReadMergeWriteSecondaryIndexUpd()
 {
     RegressionSession session = RegressionRunner.Session();
     session.Configuration.Runtime.Execution.IsFairlock = true;
     session.Configuration.Common.AddEventType(typeof(SupportTopGroupSubGroupEvent));
     session.Configuration.Common.AddEventType(typeof(SupportBean));
     session.Configuration.Common.AddEventType(typeof(SupportBean_S0));
     RegressionRunner.Run(session, new InfraTableMTGroupedMergeReadMergeWriteSecondaryIndexUpd());
     session.Dispose();
 }
Exemplo n.º 5
0
 public void TestClientInstrumentInstrumentation()
 {
     RegressionSession session = RegressionRunner.Session();
     foreach (Type clazz in new Type[] { typeof(SupportBean) })
     {
         session.Configuration.Common.AddEventType(clazz);
     }
     RegressionRunner.Run(session, new ClientInstrumentInstrumentation());
     session.Dispose();
 }
Exemplo n.º 6
0
 public void TestClientInstrumentMetricsReportingDisableStatement()
 {
     RegressionSession session = RegressionRunner.Session();
     ApplyMetricsConfig(session.Configuration, -1, 10000);
     ConfigurationRuntimeMetricsReporting.StmtGroupMetrics configOne = new ConfigurationRuntimeMetricsReporting.StmtGroupMetrics();
     configOne.Interval = -1;
     configOne.AddIncludeLike("%@METRIC%");
     session.Configuration.Runtime.MetricsReporting.AddStmtGroup("metrics", configOne);
     RegressionRunner.Run(session, new ClientInstrumentMetricsReportingDisableStatement());
     session.Dispose();
 }
Exemplo n.º 7
0
 public void TestClientInstrumentAudit()
 {
     RegressionSession session = RegressionRunner.Session();
     foreach (Type clazz in new Type[] { typeof(SupportBean), typeof(SupportBean_ST0), typeof(SupportBean_ST1) })
     {
         session.Configuration.Common.AddEventType(clazz);
     }
     session.Configuration.Runtime.Logging.AuditPattern = "[%u] [%d] [%s] [%i] [%c] %m";
     RegressionRunner.Run(session, ClientInstrumentAudit.Executions());
     session.Dispose();
 }
Exemplo n.º 8
0
        public void TestEventBeanPropertyResolutionCaseInsensitiveConfigureType()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonEventTypeBean beanWithCaseInsensitive = new ConfigurationCommonEventTypeBean();
            beanWithCaseInsensitive.PropertyResolutionStyle = PropertyResolutionStyle.CASE_INSENSITIVE;
            session.Configuration.Common.AddEventType("BeanWithCaseInsensitive", typeof(SupportBean), beanWithCaseInsensitive);

            RegressionRunner.Run(session, new EventBeanPropertyResolutionCaseInsensitiveConfigureType());
            session.Dispose();
        }
 public void TestResultSetOutputLimitMicrosecondResolution()
 {
     RegressionSession session = RegressionRunner.Session();
     session.Configuration.Common.AddEventType(typeof(SupportBean));
     session.Configuration.Common.TimeSource.TimeUnit = TimeUnit.MICROSECONDS;
     RegressionRunner.Run(session,
         new ResultSetOutputLimitMicrosecondResolution(0, "1", 1000000, 1000000));
     RegressionRunner.Run(session,
         new ResultSetOutputLimitMicrosecondResolution(789123456789L, "0.1", 789123456789L + 100000, 100000));
     session.Dispose();
 }
Exemplo n.º 10
0
 public void TestEPLVariablesTimer()
 {
     RegressionSession session = RegressionRunner.Session();
     Configuration configuration = session.Configuration;
     configuration.Runtime.Threading.IsInternalTimerEnabled = true;
     configuration.Common.AddEventType(typeof(SupportBean));
     configuration.Common.AddVariable("var1", typeof(long), "12");
     configuration.Common.AddVariable("var2", typeof(long?), "2");
     configuration.Common.AddVariable("var3", typeof(long?), null);
     RegressionRunner.Run(session, new EPLVariablesTimer());
     session.Dispose();
 }
Exemplo n.º 11
0
        public void TestEPLFromClauseMethodJoinPerformance()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonMethodRef configMethod = new ConfigurationCommonMethodRef();
            configMethod.SetLRUCache(10);
            session.Configuration.Common.AddMethodRef(typeof(SupportJoinMethods), configMethod);
            session.Configuration.Common.AddEventType(typeof(SupportBeanInt));
            session.Configuration.Common.AddImportType(typeof(SupportJoinMethods));

            RegressionRunner.Run(session, EPLFromClauseMethodJoinPerformance.Executions());
            session.Dispose();
        }
Exemplo n.º 12
0
        public void TestEPLFromClauseMethodCacheLRU()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonMethodRef methodConfig = new ConfigurationCommonMethodRef();
            methodConfig.SetLRUCache(3);
            session.Configuration.Common.AddMethodRef(typeof(SupportStaticMethodInvocations), methodConfig);
            session.Configuration.Common.AddImportNamespace(typeof(SupportStaticMethodInvocations));
            session.Configuration.Common.AddEventType(typeof(SupportBean));

            RegressionRunner.Run(session, new EPLFromClauseMethodCacheLRU());

            session.Dispose();
        }
Exemplo n.º 13
0
        public void TestEPLFromClauseMethodMultikeyWArray()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonMethodRef methodConfig = new ConfigurationCommonMethodRef();
            methodConfig.SetExpiryTimeCache(1, 10);
            session.Configuration.Common.AddMethodRef(typeof(EPLFromClauseMethodMultikeyWArray.SupportJoinResultIsArray), methodConfig);
            session.Configuration.Common.AddEventType<SupportEventWithManyArray>();
            session.Configuration.Common.Logging.IsEnableQueryPlan = true;

            RegressionRunner.Run(session, EPLFromClauseMethodMultikeyWArray.Executions());

            session.Dispose();
        }
Exemplo n.º 14
0
        public void TestClientExtendAdapterLoaderLoad()
        {
            RegressionSession session = RegressionRunner.Session();

            Properties props = new Properties();
            props.Put("name", "val");
            session.Configuration.Runtime.AddPluginLoader("MyLoader", typeof(SupportPluginLoader), props);

            props = new Properties();
            props.Put("name2", "val2");
            session.Configuration.Runtime.AddPluginLoader("MyLoader2", typeof(SupportPluginLoader), props);

            RegressionRunner.Run(session, new ClientExtendAdapterLoader());

            session.Dispose();
        }
Exemplo n.º 15
0
        public void TestEventAvroHook()
        {
            RegressionSession session = RegressionRunner.Session();

            foreach (Type clazz in new Type[] {
                typeof(SupportBean),
                typeof(SupportBean_S0),
                typeof(SupportEventWithDateTime),
                typeof(SupportEventWithDateTimeOffset)
            })
            {
                session.Configuration.Common.AddEventType(clazz);
            }

            session.Configuration.Common.EventMeta.AvroSettings.TypeRepresentationMapperClass =
                typeof(EventAvroHook.MyTypeRepresentationMapper).FullName;
            session.Configuration.Common.EventMeta.AvroSettings.ObjectValueTypeWidenerFactoryClass =
                typeof(EventAvroHook.MyObjectValueTypeWidenerFactory).FullName;

            EventAvroHook.MySupportBeanWidener.supportBeanSchema = SchemaBuilder.Record(
                "SupportBeanSchema",
                RequiredString("TheString"),
                RequiredInt("IntPrimitive"));
            Schema schemaMyEventPopulate = SchemaBuilder.Record("MyEventSchema",
                Field("sb", EventAvroHook.MySupportBeanWidener.supportBeanSchema));
            session.Configuration.Common.AddEventTypeAvro("MyEventPopulate", new ConfigurationCommonEventTypeAvro(schemaMyEventPopulate));

            Schema schemaMyEventSchema = SchemaBuilder.Record("MyEventSchema", RequiredString("isodate"));
            session.Configuration.Common.AddEventTypeAvro("MyEvent", new ConfigurationCommonEventTypeAvro(schemaMyEventSchema));

            EventAvroHook.MySupportBeanWidener.supportBeanSchema = SchemaBuilder.Record("SupportBeanSchema",
                RequiredString("TheString"),
                RequiredInt("IntPrimitive"));
            Schema schemaMyEventWSchema = SchemaBuilder.Record("MyEventSchema",
                Field("sb", Union(
                    NullType(),
                    EventAvroHook.MySupportBeanWidener.supportBeanSchema)));
            session.Configuration.Common.AddEventTypeAvro("MyEventWSchema", new ConfigurationCommonEventTypeAvro(schemaMyEventWSchema));

            RegressionRunner.Run(session, EventAvroHook.Executions());

            session.Dispose();
        }
Exemplo n.º 16
0
        public void TestViewTimeMicrosecondsWinFlipTime()
        {
            List<RegressionExecution> execs = new List<RegressionExecution>();

            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(0, "1", 1000000));
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(0, "10 milliseconds", 10000));
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(0, "10 microseconds", 10));
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(0, "1 seconds 10 microseconds", 1000010));
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(123456789, "10", 123456789 + 10 * 1000000));
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(0, "1 months 10 microseconds", TimePlusMonth(0, 1) * 1000 + 10));

            long currentTime = DateTimeParsingFunctions.ParseDefaultMSec("2002-05-1T08:00:01.999");
            execs.Add(new ViewTimeWin.ViewTimeWindowFlipTimer(currentTime * 1000 + 33, "3 months 100 microseconds", TimePlusMonth(currentTime, 3) * 1000 + 33 + 100));

            RegressionSession session = RegressionRunner.Session();
            ConfigureMicroseconds(session);
            RegressionRunner.Run(session, execs);
            session.Dispose();
        }
Exemplo n.º 17
0
        public void TestEPLVariableEngineConfigXML()
        {
            string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<esper-configuration xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"../esper-configuration-6-0.xsd\">" +
                "<common><variable name=\"p_1\" type=\"string\" />" +
                "<variable name=\"p_2\" type=\"bool\" initialization-value=\"true\"/>" +
                "<variable name=\"p_3\" type=\"long\" initialization-value=\"10\"/>" +
                "<variable name=\"p_4\" type=\"double\" initialization-value=\"11.1d\"/>" +
                "</common></esper-configuration>";
            var doc = SupportXML.GetDocument(xml);

            RegressionSession session = RegressionRunner.Session();
            Configuration configuration = session.Configuration;
            configuration.Common.AddEventType(typeof(SupportBean));
            configuration.Configure(doc);

            RegressionRunner.Run(session, new EPLVariableEngineConfigXML());

            session.Dispose();
        }
Exemplo n.º 18
0
        public void TestEventBeanPublicFields()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonEventTypeBean legacyDef = new ConfigurationCommonEventTypeBean();
            legacyDef.AccessorStyle = AccessorStyle.PUBLIC;
            session.Configuration.Common.AddEventType("MyLegacyNestedEvent", typeof(SupportLegacyBean.LegacyNested), legacyDef);

            ConfigurationCommonEventTypeBean anotherLegacyEvent = new ConfigurationCommonEventTypeBean();
            anotherLegacyEvent.AccessorStyle = AccessorStyle.PUBLIC;
            anotherLegacyEvent.AddFieldProperty("explicitFSimple", "fieldLegacyVal");
            anotherLegacyEvent.AddFieldProperty("explicitFIndexed", "fieldStringArray");
            anotherLegacyEvent.AddFieldProperty("explicitFNested", "fieldNested");
            anotherLegacyEvent.AddMethodProperty("explicitMSimple", "ReadLegacyBeanVal");
            anotherLegacyEvent.AddMethodProperty("explicitMArray", "ReadStringArray");
            anotherLegacyEvent.AddMethodProperty("explicitMIndexed", "ReadStringIndexed");
            anotherLegacyEvent.AddMethodProperty("explicitMMapped", "ReadMapByKey");
            session.Configuration.Common.AddEventType("AnotherLegacyEvent", typeof(SupportLegacyBean), anotherLegacyEvent);

            RegressionRunner.Run(session, new EventBeanPublicAccessors());
            session.Dispose();
        }
Exemplo n.º 19
0
        public void TestClientInstrumentMetricsReportingStmtMetrics()
        {
            RegressionSession session = RegressionRunner.Session();

            ApplyMetricsConfig(session.Configuration, -1, -1);

            ConfigurationRuntimeMetricsReporting.StmtGroupMetrics configOne = new ConfigurationRuntimeMetricsReporting.StmtGroupMetrics();
            configOne.Interval = 10000;
            configOne.AddIncludeLike("%cpuStmt%");
            configOne.AddIncludeLike("%wallStmt%");
            session.Configuration.Runtime.MetricsReporting.AddStmtGroup("nonmetrics", configOne);

            // exclude metrics themselves from reporting
            ConfigurationRuntimeMetricsReporting.StmtGroupMetrics configTwo = new ConfigurationRuntimeMetricsReporting.StmtGroupMetrics();
            configTwo.Interval = -1;
            configOne.AddExcludeLike("%metrics%");
            session.Configuration.Runtime.MetricsReporting.AddStmtGroup("metrics", configTwo);

            RegressionRunner.Run(session, new ClientInstrumentMetricsReportingStmtMetrics());

            session.Dispose();
        }
Exemplo n.º 20
0
        public void TestEventBeanExplicitOnly()
        {
            RegressionSession session = RegressionRunner.Session();

            ConfigurationCommonEventTypeBean legacyDef = new ConfigurationCommonEventTypeBean();
            legacyDef.AccessorStyle = AccessorStyle.EXPLICIT;
            legacyDef.AddFieldProperty("explicitFNested", "fieldNested");
            legacyDef.AddMethodProperty("explicitMNested", "ReadLegacyNested");
            session.Configuration.Common.AddEventType("MyLegacyEvent", typeof(SupportLegacyBean), legacyDef);

            legacyDef = new ConfigurationCommonEventTypeBean();
            legacyDef.AccessorStyle = AccessorStyle.EXPLICIT;
            legacyDef.AddFieldProperty("fieldNestedClassValue", "fieldNestedValue");
            legacyDef.AddMethodProperty("readNestedClassValue", "ReadNestedValue");
            session.Configuration.Common.AddEventType("MyLegacyNestedEvent", typeof(SupportLegacyBean.LegacyNested), legacyDef);

            ConfigurationCommonEventTypeBean mySupportBean = new ConfigurationCommonEventTypeBean();
            mySupportBean.AccessorStyle = AccessorStyle.EXPLICIT;
            session.Configuration.Common.AddEventType("MySupportBean", typeof(SupportBean), mySupportBean);

            RegressionRunner.Run(session, new EventBeanExplicitOnly());
            session.Dispose();
        }
Exemplo n.º 21
0
 public void TearDown()
 {
     _session.Dispose();
     _session = null;
 }
Exemplo n.º 22
0
 public void SetUp()
 {
     _session = RegressionRunner.Session();
     Configure(_session.Configuration);
 }
Exemplo n.º 23
0
 public void SetUp()
 {
     _session = RegressionRunner.Session();
     _configure?.Invoke(_session.Configuration);
 }
Exemplo n.º 24
0
 public void SetUp()
 {
     _session = RegressionRunner.Session();
     _session.Configuration.Common.AddEventType("SupportBean", typeof(SupportBean));
 }
Exemplo n.º 25
0
 public void TestEventMapInheritanceRuntime()
 {
     RegressionSession session = RegressionRunner.Session();
     RegressionRunner.Run(session, new EventMapInheritanceRuntime());
     session.Dispose();
 }
Exemplo n.º 26
0
 private void ConfigureMicroseconds(RegressionSession session)
 {
     session.Configuration.Common.AddEventType(typeof(SupportBean));
     session.Configuration.Common.TimeSource.TimeUnit = TimeUnit.MICROSECONDS;
 }
Exemplo n.º 27
0
 public void TestEventMapNestedConfigRuntime()
 {
     RegressionSession session = RegressionRunner.Session();
     RegressionRunner.Run(session, new EventMapNestedConfigRuntime());
     session.Dispose();
 }