public void TestWriteCSV() { RunAssertion("MyXMLEvent", DefaultSupportGraphEventUtil.GetXMLEvents(), true); RunAssertion("MyOAEvent", DefaultSupportGraphEventUtil.GetOAEvents(), true); RunAssertion("MyMapEvent", DefaultSupportGraphEventUtil.GetMapEvents(), false); RunAssertion("MyDefaultSupportGraphEvent", DefaultSupportGraphEventUtil.GetPONOEvents(), true); CompileDeploy(runtime, "@public @buseventtype create json schema MyJsonEvent(MyDouble double, MyInt int, MyString string)"); RunAssertion("MyJsonEvent", DefaultSupportGraphEventUtil.GetJsonEvents(), true); }
public void Run(RegressionEnvironment env) { if (env.IsHA) { return; } RunAssertionAllTypes( env, DefaultSupportGraphEventUtil.EVENTTYPENAME, DefaultSupportGraphEventUtil.GetPONOEvents()); RunAssertionAllTypes(env, "MyXMLEvent", DefaultSupportGraphEventUtil.GetXMLEvents()); RunAssertionAllTypes(env, "MyOAEvent", DefaultSupportGraphEventUtil.GetOAEvents()); RunAssertionAllTypes(env, "MyMapEvent", DefaultSupportGraphEventUtil.GetMapEvents()); }
public void Run(RegressionEnvironment env) { RunAssertionStatementNameExists( env, DefaultSupportGraphEventUtil.EVENTTYPENAME, DefaultSupportGraphEventUtil.GetPONOEvents()); RunAssertionStatementNameExists(env, "MyMapEvent", DefaultSupportGraphEventUtil.GetMapEvents()); RunAssertionStatementNameExists(env, "MyOAEvent", DefaultSupportGraphEventUtil.GetOAEvents()); RunAssertionStatementNameExists(env, "MyXMLEvent", DefaultSupportGraphEventUtil.GetXMLEvents()); // test doc samples var epl = "@Name('flow') create dataflow MyDataFlow\n" + " create schema SampleSchema(tagId string, locX double),\t// sample type\t\t\t\n" + "\t\t\t\n" + " // ConsIder only the statement named MySelectStatement when it exists.\n" + " EPStatementSource -> stream.one<eventbean<?>> {\n" + " statementDeploymentId : 'MyDeploymentABC',\n" + " statementName : 'MySelectStatement'\n" + " }\n" + " \n" + " // ConsIder all statements that match the filter object provided.\n" + " EPStatementSource -> stream.two<eventbean<?>> {\n" + " statementFilter : {\n" + " class : '" + typeof(MyFilter).MaskTypeName() + "'\n" + " }\n" + " }\n" + " \n" + " // ConsIder all statements that match the filter object provided.\n" + " // With collector that performs transformation.\n" + " EPStatementSource -> stream.two<SampleSchema> {\n" + " collector : {\n" + " class : '" + typeof(MyCollector).MaskTypeName() + "'\n" + " },\n" + " statementFilter : {\n" + " class : '" + typeof(MyFilter).MaskTypeName() + "'\n" + " }\n" + " }"; env.CompileDeploy(epl); env.Runtime.DataFlowService.Instantiate(env.DeploymentId("flow"), "MyDataFlow"); env.UndeployAll(); }
public void Run(RegressionEnvironment env) { RunAssertionAllTypes(env, "MyXMLEvent", DefaultSupportGraphEventUtil.GetXMLEvents()); RunAssertionAllTypes(env, "MyOAEvent", DefaultSupportGraphEventUtil.GetOAEvents()); RunAssertionAllTypes(env, "MyMapEvent", DefaultSupportGraphEventUtil.GetMapEvents()); RunAssertionAllTypes( env, DefaultSupportGraphEventUtil.EVENTTYPENAME, DefaultSupportGraphEventUtil.GetPONOEvents()); // invalid: output stream TryInvalidCompile( env, "create dataflow DF1 EventBusSink -> s1 {}", "Failed to obtain operator 'EventBusSink': EventBusSink operator does not provide an output stream"); var path = new RegressionPath(); env.CompileDeploy("create schema SampleSchema(tagId string, locX double, locY double)", path); var docSmple = "@Name('s0') create dataflow MyDataFlow\n" + "BeaconSource -> instream<SampleSchema> {} // produces sample stream to\n" + "//demonstrate below\n" + "// Send SampleSchema events produced by beacon to the event bus.\n" + "EventBusSink(instream) {}\n" + "\n" + "// Send SampleSchema events produced by beacon to the event bus.\n" + "// With collector that performs transformation.\n" + "EventBusSink(instream) {\n" + "collector : {\n" + "class : '" + typeof(MyTransformToEventBus).MaskTypeName() + "'\n" + "}\n" + "}"; env.CompileDeploy(docSmple, path); env.Runtime.DataFlowService.Instantiate(env.DeploymentId("s0"), "MyDataFlow"); env.UndeployAll(); }
public void Run(RegressionEnvironment env) { RunAssertionAllTypes( env, DefaultSupportGraphEventUtil.EVENTTYPENAME, DefaultSupportGraphEventUtil.GetPONOEvents()); RunAssertionAllTypes( env, "MyXMLEvent", DefaultSupportGraphEventUtil.GetXMLEvents()); RunAssertionAllTypes( env, "MyOAEvent", DefaultSupportGraphEventUtil.GetOAEvents()); RunAssertionAllTypes( env, "MyMapEvent", DefaultSupportGraphEventUtil.GetMapEvents()); // test doc sample var epl = "@Name('flow') create dataflow MyDataFlow\n" + " create schema SampleSchema(tagId string, locX double),\t// sample type\n" + " BeaconSource -> samplestream<SampleSchema> {}\n" + " \n" + " // Filter all events that have a tag Id of '001'\n" + " Filter(samplestream) -> tags_001 {\n" + " filter : tagId = '001' \n" + " }\n" + " \n" + " // Filter all events that have a tag Id of '001', putting all other tags into the second stream\n" + " Filter(samplestream) -> tags_001, tags_other {\n" + " filter : tagId = '001' \n" + " }"; env.CompileDeploy(epl); env.Runtime.DataFlowService.Instantiate(env.DeploymentId("flow"), "MyDataFlow"); env.UndeployAll(); // test two streams DefaultSupportCaptureOpStatic<object>.GetInstances().Clear(); var graph = "@Name('flow') create dataflow MyFilter\n" + "Emitter -> sb<SupportBean> {name : 'e1'}\n" + "filter(sb) -> out.ok, out.fail {filter: TheString = 'x'}\n" + "DefaultSupportCaptureOpStatic(out.ok) {}" + "DefaultSupportCaptureOpStatic(out.fail) {}"; env.CompileDeploy(graph); var instance = env.Runtime.DataFlowService.Instantiate(env.DeploymentId("flow"), "MyFilter"); var captive = instance.StartCaptive(); captive.Emitters.Get("e1").Submit(new SupportBean("x", 10)); captive.Emitters.Get("e1").Submit(new SupportBean("y", 11)); var instances = DefaultSupportCaptureOpStatic<object>.GetInstances(); Assert.That(instances, Has.Count.EqualTo(2)); Assert.AreEqual(10, ((SupportBean) instances[0].Current[0]).IntPrimitive); Assert.AreEqual(11, ((SupportBean) instances[1].Current[0]).IntPrimitive); DefaultSupportCaptureOpStatic<object>.GetInstances().Clear(); env.UndeployAll(); }