protected static void AssertDisqualified( RegressionEnvironment env, RegressionPath path, string typeName, string epl) { SupportFilterPlanHook.Reset(); env.Compile(epl, path); FilterSpecParamForge forge = SupportFilterPlanHook.AssertPlanSingleForTypeAndReset(typeName); Assert.AreEqual(FilterOperator.BOOLEAN_EXPRESSION, forge.FilterOperator); }
protected static void AssertDisqualified( RegressionEnvironment env, RegressionPath path, string typeName, string filters) { string hook = "@Hook(HookType=HookType.INTERNAL_FILTERSPEC, Hook='" + typeof(SupportFilterPlanHook).Name + "')"; string epl = hook + "select * from " + typeName + "(" + filters + ") as me"; SupportFilterPlanHook.Reset(); env.Compile(epl, path); FilterSpecParamForge forge = SupportFilterPlanHook.AssertPlanSingleTripletAndReset(typeName); if (forge.FilterOperator != FilterOperator.BOOLEAN_EXPRESSION && forge.FilterOperator != REBOOL) { Assert.Fail(); } }
public void Run(RegressionEnvironment env) { SupportFilterPlanHook.Reset(); string hook = "@Hook(HookType=HookType.INTERNAL_FILTERSPEC, Hook='" + typeof(SupportFilterPlanHook).FullName + "')"; string epl = hook + "@Name('s0') select * from SupportBean(TheString regexp '.*a.*')"; env.CompileDeploy(epl).AddListener("s0"); if (HasFilterIndexPlanAdvanced(env)) { FilterSpecParamForge forge = SupportFilterPlanHook.AssertPlanSingleTripletAndReset("SupportBean"); Assert.AreEqual(FilterOperator.REBOOL, forge.FilterOperator); Assert.AreEqual(".TheString regexp ?", forge.Lookupable.Expression); Assert.AreEqual(typeof(string), forge.Lookupable.ReturnType); AssertFilterSvcSingle(env.Statement("s0"), ".TheString regexp ?", REBOOL); } epl = "@Name('s1') select * from SupportBean(TheString regexp '.*a.*')"; env.CompileDeploy(epl).AddListener("s1"); epl = "@Name('s2') select * from SupportBean(TheString regexp '.*b.*')"; env.CompileDeploy(epl).AddListener("s2"); env.Milestone(0); if (HasFilterIndexPlanAdvanced(env)) { IDictionary<string, FilterItem> filters = SupportFilterServiceHelper.GetFilterSvcAllStmtForTypeSingleFilter(env.Runtime, "SupportBean"); FilterItem s0 = filters.Get("s0"); FilterItem s1 = filters.Get("s1"); FilterItem s2 = filters.Get("s2"); Assert.AreEqual(FilterOperator.REBOOL, s0.Op); Assert.IsNotNull(s0.OptionalValue); Assert.IsNotNull(s0.Index); Assert.AreSame(s0.Index, s1.Index); Assert.AreSame(s0.OptionalValue, s1.OptionalValue); Assert.AreSame(s0.Index, s2.Index); Assert.AreNotSame(s0.OptionalValue, s2.OptionalValue); } SendSBAssert(env, "garden", true, true, false); SendSBAssert(env, "house", false, false, false); SendSBAssert(env, "grub", false, false, true); env.UndeployAll(); }