public override void Run(EPServiceProvider epService)
        {
            PlugInEventRepresentationContext initContext = SupportEventRepresentation.InitContext;

            Assert.AreEqual(new Uri("type://test/support"), initContext.EventRepresentationRootURI);
            Assert.AreEqual("abc", initContext.RepresentationInitializer);
            Assert.IsNotNull(initContext.EventAdapterService);

            ConfigurationOperations runtimeConfig = epService.EPAdministrator.Configuration;

            runtimeConfig.AddPlugInEventType("TestTypeOne", new Uri[] { new Uri("type://test/support?a=b&c=d") }, "t1");

            PlugInEventTypeHandlerContext plugincontext = SupportEventRepresentation.AcceptTypeContext;

            Assert.AreEqual(new Uri("type://test/support?a=b&c=d"), plugincontext.EventTypeResolutionURI);
            Assert.AreEqual("t1", plugincontext.TypeInitializer);
            Assert.AreEqual("TestTypeOne", plugincontext.EventTypeName);

            plugincontext = SupportEventRepresentation.EventTypeContext;
            Assert.AreEqual(new Uri("type://test/support?a=b&c=d"), plugincontext.EventTypeResolutionURI);
            Assert.AreEqual("t1", plugincontext.TypeInitializer);
            Assert.AreEqual("TestTypeOne", plugincontext.EventTypeName);

            epService.EPRuntime.GetEventSender(new Uri[] { new Uri("type://test/support?a=b") });
            PlugInEventBeanReflectorContext contextBean = SupportEventRepresentation.EventBeanContext;

            Assert.AreEqual("type://test/support?a=b", contextBean.ResolutionURI.ToString());
        }
Exemplo n.º 2
0
        public PlugInEventTypeHandler GetTypeHandler(PlugInEventTypeHandlerContext eventTypeContext)
        {
            String typeProperyies = (String)eventTypeContext.TypeInitializer;

            String[] propertyList = (typeProperyies != null) ? typeProperyies.Split(',') : new String[0];

            // the set of properties know are the set of this name as well as the set for the base
            ICollection <String> typeProps = new HashSet <String>(propertyList);

            typeProps.AddAll(baseProps);

            IDictionary <String, EventPropertyDescriptor> metadata = new LinkedHashMap <String, EventPropertyDescriptor>();

            foreach (String prop in typeProps)
            {
                metadata.Put(prop, new EventPropertyDescriptor(prop, typeof(string), null, false, false, false, false, false));
            }

            // save type for testing dynamic event object reflection
            MyPlugInPropertiesEventType eventType = new MyPlugInPropertiesEventType(null, eventTypeContext.EventTypeId, typeProps, metadata);

            types.Add(eventType);

            return(new MyPlugInPropertiesEventTypeHandler(eventType));
        }
Exemplo n.º 3
0
 public PlugInEventTypeHandler GetTypeHandler(PlugInEventTypeHandlerContext eventTypeContext)
 {
     EventTypeContext = eventTypeContext;
     return(new ProxyPlugInEventTypeHandler
     {
         EventTypeFunc = () => null,
         GetSenderFunc = r => null
     });
 }
        public void TestContextContents()
        {
            Configuration configuration = GetConfiguration();

            configuration.AddPlugInEventRepresentation(new Uri("type://test/support"), typeof(SupportEventRepresentation).FullName, "abc");
            _epService = EPServiceProviderManager.GetDefaultProvider(configuration);
            _epService.Initialize();
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.StartTest(_epService, GetType(), GetType().FullName);
            }

            PlugInEventRepresentationContext initContext = SupportEventRepresentation.InitContext;

            Assert.AreEqual(new Uri("type://test/support"), initContext.EventRepresentationRootURI);
            Assert.AreEqual("abc", initContext.RepresentationInitializer);
            Assert.NotNull(initContext.EventAdapterService);

            ConfigurationOperations runtimeConfig = _epService.EPAdministrator.Configuration;

            runtimeConfig.AddPlugInEventType("TestTypeOne", new Uri[] { new Uri("type://test/support?a=b&c=d") }, "t1");

            PlugInEventTypeHandlerContext context = SupportEventRepresentation.AcceptTypeContext;

            Assert.AreEqual(new Uri("type://test/support?a=b&c=d"), context.EventTypeResolutionURI);
            Assert.AreEqual("t1", context.TypeInitializer);
            Assert.AreEqual("TestTypeOne", context.EventTypeName);

            context = SupportEventRepresentation.EventTypeContext;
            Assert.AreEqual(new Uri("type://test/support?a=b&c=d"), context.EventTypeResolutionURI);
            Assert.AreEqual("t1", context.TypeInitializer);
            Assert.AreEqual("TestTypeOne", context.EventTypeName);

            _epService.EPRuntime.GetEventSender(new Uri[] { new Uri("type://test/support?a=b") });
            PlugInEventBeanReflectorContext contextBean = SupportEventRepresentation.EventBeanContext;

            Assert.AreEqual("type://test/support?a=b", contextBean.ResolutionURI.ToString());

            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.EndTest();
            }
        }
Exemplo n.º 5
0
 public bool AcceptsType(PlugInEventTypeHandlerContext acceptTypeContext)
 {
     AcceptTypeContext = acceptTypeContext;
     return(true);
 }
Exemplo n.º 6
0
 public bool AcceptsType(PlugInEventTypeHandlerContext context)
 {
     return(true);
 }