public void TestWriteOnly() { epService = EPServiceProviderManager.GetDefaultProvider(SupportConfigFactory.GetConfiguration()); epService.Initialize(); if (InstrumentationHelper.ENABLED) { InstrumentationHelper.StartTest(epService, this.GetType(), this.GetType().FullName); } EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from " + typeof(SupportBeanWriteOnly).FullName); SupportUpdateListener listener = new SupportUpdateListener(); stmt.AddListener(listener); object theEvent = new SupportBeanWriteOnly(); epService.EPRuntime.SendEvent(theEvent); EventBean eventBean = listener.AssertOneGetNewAndReset(); Assert.AreSame(theEvent, eventBean.Underlying); EventType type = stmt.EventType; Assert.AreEqual(0, type.PropertyNames.Length); if (InstrumentationHelper.ENABLED) { InstrumentationHelper.EndTest(); } }
public void Run(RegressionEnvironment env) { env.CompileDeploy("@Name('s0') select * from SupportBeanWriteOnly").AddListener("s0"); object theEvent = new SupportBeanWriteOnly(); env.SendEventBean(theEvent); var eventBean = env.Listener("s0").AssertOneGetNewAndReset(); Assert.AreSame(theEvent, eventBean.Underlying); var type = env.Statement("s0").EventType; Assert.AreEqual(0, type.PropertyNames.Length); env.UndeployAll(); }
private void RunAssertionWriteOnly(EPServiceProvider epService) { EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from " + typeof(SupportBeanWriteOnly).FullName); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; var theEvent = new SupportBeanWriteOnly(); epService.EPRuntime.SendEvent(theEvent); EventBean eventBean = listener.AssertOneGetNewAndReset(); Assert.AreSame(theEvent, eventBean.Underlying); EventType type = stmt.EventType; Assert.AreEqual(0, type.PropertyNames.Length); stmt.Dispose(); }