public void Run(RegressionEnvironment env) { MyStatementNameResolver.Contexts.Clear(); var args = new CompilerArguments(env.Configuration); args.Options.StatementName = (new MyStatementNameResolver()).GetValue; var epl = "select * from SupportBean"; var compiled = env.Compile(epl, args); StatementNameContext ctx = MyStatementNameResolver.Contexts[0]; Assert.AreEqual(epl, ctx.EplSupplier.Invoke()); Assert.AreEqual(null, ctx.StatementName); Assert.AreEqual(null, ctx.ModuleName); Assert.AreEqual(0, ctx.Annotations.Length); Assert.AreEqual(0, ctx.StatementNumber); env.Deploy(compiled); Assert.AreEqual("hello", env.Statement("hello").Name); env.UndeployAll(); }
public string GetValue(StatementNameContext env) { contexts.Add(env); return "hello"; }