public void TestFlowRequired()
        {
            _rootCartNodeOneReq.Init(null);

            EventBean[] stream2Events = SupportJoinResultNodeFactory.MakeEvents(2); // for identifying rows in cartesian product
            EventBean[] stream3Events = SupportJoinResultNodeFactory.MakeEvents(2); // for identifying rows in cartesian product
            EventBean[] stream4Events = SupportJoinResultNodeFactory.MakeEvents(2); // for identifying rows in cartesian product

            // Post result from 3, send 2 rows
            List <EventBean[]> resultFinalRows = new List <EventBean[]>();

            EventBean[] childRow = new EventBean[5];
            childRow[3] = stream3Events[0];
            _rootCartNodeOneReq.Result(childRow, 3, null, null, resultFinalRows, null);
            childRow    = new EventBean[5];
            childRow[3] = stream3Events[1];
            _rootCartNodeOneReq.Result(childRow, 3, null, null, resultFinalRows, null);

            // Post result from 2, send 2 rows
            childRow    = new EventBean[5];
            childRow[2] = stream2Events[0];
            _rootCartNodeOneReq.Result(childRow, 2, null, null, resultFinalRows, null);
            childRow    = new EventBean[5];
            childRow[2] = stream2Events[1];
            _rootCartNodeOneReq.Result(childRow, 2, null, null, resultFinalRows, null);

            // Post result from 4
            childRow    = new EventBean[5];
            childRow[4] = stream4Events[0];
            _rootCartNodeOneReq.Result(childRow, 4, null, null, resultFinalRows, null);
            childRow    = new EventBean[5];
            childRow[4] = stream4Events[1];
            _rootCartNodeOneReq.Result(childRow, 4, null, null, resultFinalRows, null);

            // process posted rows (child rows were stored and are compared to find other rows to generate)
            _rootCartNodeOneReq.Process(null, resultFinalRows, null);

            // 5 generated rows: 2 (stream 2) + 2 (stream 3) + 1 (self, Node 2)
            Assert.AreEqual(8, _parentNode.RowsList.Count);

            EventBean[][] rowArr = SupportJoinResultNodeFactory.ConvertTo2DimArr(_parentNode.RowsList);
            EPAssertionUtil.AssertEqualsAnyOrder(
                new[]
            {
                new[] { null, null, stream2Events[0], stream3Events[0], stream4Events[0] },
                new[] { null, null, stream2Events[0], stream3Events[1], stream4Events[0] },
                new[] { null, null, stream2Events[1], stream3Events[0], stream4Events[0] },
                new[] { null, null, stream2Events[1], stream3Events[1], stream4Events[0] },
                new[] { null, null, stream2Events[0], stream3Events[0], stream4Events[1] },
                new[] { null, null, stream2Events[0], stream3Events[1], stream4Events[1] },
                new[] { null, null, stream2Events[1], stream3Events[0], stream4Events[1] },
                new[] { null, null, stream2Events[1], stream3Events[1], stream4Events[1] },
            }, rowArr);
        }
        public void TestFlowOptional()
        {
            RootCartProdAssemblyNode rootCartNodeAllOpt = (RootCartProdAssemblyNode) new RootCartProdAssemblyNodeFactory(1, 5, true).MakeAssemblerUnassociated();

            rootCartNodeAllOpt.AddChild(new SupportJoinProcNode(2, 5));
            rootCartNodeAllOpt.AddChild(new SupportJoinProcNode(3, 5));
            rootCartNodeAllOpt.AddChild(new SupportJoinProcNode(4, 5));

            _parentNode.AddChild(rootCartNodeAllOpt);

            rootCartNodeAllOpt.Init(null);
            List <EventBean[]> resultFinalRows = new List <EventBean[]>();

            rootCartNodeAllOpt.Process(null, resultFinalRows, null);

            // 5 generated rows: 2 (stream 2) + 2 (stream 3) + 1 (self, Node 2)
            Assert.AreEqual(1, _parentNode.RowsList.Count);

            EventBean[][] rowArr = SupportJoinResultNodeFactory.ConvertTo2DimArr(_parentNode.RowsList);
            EPAssertionUtil.AssertEqualsAnyOrder(
                new[] { new EventBean[] { null, null, null, null, null } }, rowArr);
        }