コード例 #1
0
        private void RunAssertionIterable(EPServiceProvider epService)
        {
            var configField = new ConfigurationEventTypeLegacy();

            configField.AccessorStyle = AccessorStyleEnum.PUBLIC;
            epService.EPAdministrator.Configuration.AddEventType(typeof(MyEventWithField).Name, typeof(MyEventWithField).AssemblyQualifiedName, configField);
            var eventField = new MyEventWithField();

            eventField.OtherEventsIterable = Collections.List(new OtherEvent("id1"));
            eventField.OtherEventsMap      = Collections.SingletonMap("key", new OtherEvent("id2"));
            eventField.OtherEventsList     = Collections.List(new OtherEvent("id3"));

            var configCglib = new ConfigurationEventTypeLegacy();

            epService.EPAdministrator.Configuration.AddEventType(typeof(MyEventWithMethodWCGLIB).Name, typeof(MyEventWithMethodWCGLIB).AssemblyQualifiedName, configCglib);
            var eventMethodCglib = new MyEventWithMethodWCGLIB(Collections.List(new OtherEvent("id1")), Collections.SingletonMap("key", new OtherEvent("id2")), Collections.List(new OtherEvent("id3")));

            var configNoCglib = new ConfigurationEventTypeLegacy();

            configNoCglib.CodeGeneration = CodeGenerationEnum.DISABLED;
            epService.EPAdministrator.Configuration.AddEventType(typeof(MyEventWithMethodNoCGLIB).Name, typeof(MyEventWithMethodNoCGLIB).AssemblyQualifiedName, configNoCglib);
            var eventMethodNocglib = new MyEventWithMethodNoCGLIB(Collections.List(new OtherEvent("id1")), Collections.SingletonMap("key", new OtherEvent("id2")), Collections.List(new OtherEvent("id3")));

            TryAssertionIterable(epService, typeof(MyEventWithField), eventField);
            TryAssertionIterable(epService, typeof(MyEventWithMethodWCGLIB), eventMethodCglib);
            TryAssertionIterable(epService, typeof(MyEventWithMethodNoCGLIB), eventMethodNocglib);
        }
コード例 #2
0
        private void RunAssertionIterable(RegressionEnvironment env)
        {
            var eventField = new MyEventWithField();
            eventField.otherEventsIterable = Arrays.AsList(new OtherEvent("id1"));
            eventField.otherEventsMap = Collections.SingletonMap("key", new OtherEvent("id2"));
            eventField.otherEventsList = Arrays.AsList(new OtherEvent("id3"));

            var eventMethod = new MyEventWithMethod(
                Arrays.AsList(new OtherEvent("id1")),
                Collections.SingletonMap("key", new OtherEvent("id2")),
                Arrays.AsList(new OtherEvent("id3")));

            TryAssertionIterable(env, typeof(MyEventWithField), eventField);
            TryAssertionIterable(env, typeof(MyEventWithMethod), eventMethod);
        }