private static Predicate <string> PredicateFor(Feature feature) { var content = feature.Content; if (content.Include != null) { var include = Patterns.Include(content.Include); return(null == content.Exclude ? include : Patterns.And(include, Patterns.Exclude(content.Exclude))); } return(content.Exclude == null ? fileName => true : Patterns.Exclude(content.Exclude)); }
private void RunAssertionOp(EPServiceProvider epService) { EventCollection events = EventCollectionFactory.GetEventSetOne(0, 1000); var testCaseList = new CaseList(); EventExpressionCase testCase; testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and not d=" + EVENT_D_CLASS); testCase.Add("B1", "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); string text = "select * from pattern [every b=" + EVENT_B_CLASS + " and not g=" + EVENT_G_CLASS + "]"; var model = new EPStatementObjectModel(); model.SelectClause = SelectClause.CreateWildcard(); PatternExpr pattern = Patterns.And() .Add(Patterns.EveryFilter(EVENT_B_CLASS, "b")) .Add(Patterns.NotFilter(EVENT_G_CLASS, "g")); model.FromClause = FromClause.Create(PatternStream.Create(pattern)); model = (EPStatementObjectModel)SerializableObjectCopier.Copy(epService.Container, model); Assert.AreEqual(text, model.ToEPL()); testCase = new EventExpressionCase(model); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=" + EVENT_B_CLASS + " and not g=" + EVENT_G_CLASS); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=" + EVENT_B_CLASS + " and not d=" + EVENT_D_CLASS); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and not a=" + EVENT_A_CLASS + "(id='A1')"); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and not a2=" + EVENT_A_CLASS + "(id='A2')"); testCase.Add("B1", "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " and not b3=" + EVENT_B_CLASS + "(id='B3'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " or not " + EVENT_D_CLASS + "())"); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (every b=" + EVENT_B_CLASS + " and not " + EVENT_B_CLASS + "(id='B2'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B3", "b", events.GetEvent("B3")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " and not " + EVENT_B_CLASS + "(id='B2'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("(b=" + EVENT_B_CLASS + " -> d=" + EVENT_D_CLASS + ") and " + " not " + EVENT_A_CLASS); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("(b=" + EVENT_B_CLASS + " -> d=" + EVENT_D_CLASS + ") and " + " not " + EVENT_G_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " -> d=" + EVENT_D_CLASS + ") and " + " not " + EVENT_G_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " -> d=" + EVENT_D_CLASS + ") and " + " not " + EVENT_G_CLASS + "(id='x')"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); var util = new PatternTestHarness(events, testCaseList, this.GetType()); util.RunTest(epService); }
public void TestOp() { EventCollection events = EventCollectionFactory.GetEventSetOne(0, 1000); CaseList testCaseList = new CaseList(); EventExpressionCase testCase; testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and every d=" + EVENT_D_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=" + EVENT_B_CLASS + " and d=" + EVENT_D_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and d=" + EVENT_D_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every(b=" + EVENT_B_CLASS + " and d=" + EVENT_D_CLASS + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); EPStatementObjectModel model = new EPStatementObjectModel(); model.SelectClause = SelectClause.CreateWildcard(); PatternExpr pattern = Patterns.Every(Patterns.And(Patterns.Filter(EVENT_B_CLASS, "b"), Patterns.Filter(EVENT_D_CLASS, "d"))); model.FromClause = FromClause.Create(PatternStream.Create(pattern)); model = (EPStatementObjectModel)SerializableObjectCopier.Copy(model); Assert.AreEqual("select * from pattern [every (b=" + EVENT_B_CLASS + " and d=" + EVENT_D_CLASS + ")]", model.ToEPL()); testCase = new EventExpressionCase(model); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( b=" + EVENT_B_CLASS + " and every d=" + EVENT_D_CLASS + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=" + EVENT_B_CLASS + " and every d=" + EVENT_D_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( every b=" + EVENT_B_CLASS + " and d=" + EVENT_D_CLASS + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every a=" + EVENT_A_CLASS + " and d=" + EVENT_D_CLASS + " and b=" + EVENT_B_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( every b=" + EVENT_B_CLASS + " and every d=" + EVENT_D_CLASS + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); for (int i = 0; i < 3; i++) { testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); } testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3")); for (int i = 0; i < 5; i++) { testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); } testCaseList.AddTest(testCase); testCase = new EventExpressionCase("a=" + EVENT_A_CLASS + " and d=" + EVENT_D_CLASS + " and b=" + EVENT_B_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every a=" + EVENT_A_CLASS + " and every d=" + EVENT_D_CLASS + " and b=" + EVENT_B_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=" + EVENT_B_CLASS + " and b=" + EVENT_B_CLASS); testCase.Add("B1", "b", events.GetEvent("B1"), "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every a=" + EVENT_A_CLASS + " and every d=" + EVENT_D_CLASS + " and every b=" + EVENT_B_CLASS); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (a=" + EVENT_A_CLASS + " and every d=" + EVENT_D_CLASS + " and b=" + EVENT_B_CLASS + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=" + EVENT_B_CLASS + " and b=" + EVENT_B_CLASS + ")"); testCase.Add("B1", "b", events.GetEvent("B1"), "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2"), "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3"), "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); PatternTestHarness util = new PatternTestHarness(events, testCaseList, GetType(), GetType().FullName); util.RunTest(); }
public void Run(RegressionEnvironment env) { var events = EventCollectionFactory.GetEventSetOne(0, 1000); var testCaseList = new CaseList(); EventExpressionCase testCase; testCase = new EventExpressionCase("b=SupportBean_B and not d=SupportBean_D"); testCase.Add("B1", "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); var text = "select * from pattern [every b=SupportBean_B and not g=SupportBean_G]"; var model = new EPStatementObjectModel(); model.SelectClause = SelectClause.CreateWildcard(); PatternExpr pattern = Patterns.And() .Add(Patterns.EveryFilter("SupportBean_B", "b")) .Add(Patterns.NotFilter("SupportBean_G", "g")); model.FromClause = FromClause.Create(PatternStream.Create(pattern)); model = env.CopyMayFail(model); Assert.AreEqual(text, model.ToEPL()); testCase = new EventExpressionCase(model); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=SupportBean_B and not g=SupportBean_G"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=SupportBean_B and not d=SupportBean_D"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=SupportBean_B and not a=SupportBean_A(Id='A1')"); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=SupportBean_B and not a2=SupportBean_A(Id='A2')"); testCase.Add("B1", "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=SupportBean_B and not b3=SupportBean_B(Id='B3'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=SupportBean_B or not SupportBean_D())"); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (every b=SupportBean_B and not SupportBean_B(Id='B2'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B3", "b", events.GetEvent("B3")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=SupportBean_B and not SupportBean_B(Id='B2'))"); testCase.Add("B1", "b", events.GetEvent("B1")); testCase.Add("B3", "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "(b=SupportBean_B -> d=SupportBean_D) and " + " not SupportBean_A"); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "(b=SupportBean_B -> d=SupportBean_D) and " + " not SupportBean_G"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every (b=SupportBean_B -> d=SupportBean_D) and " + " not SupportBean_G"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every (b=SupportBean_B -> d=SupportBean_D) and " + " not SupportBean_G(Id='x')"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); var util = new PatternTestHarness(events, testCaseList, GetType()); util.RunTest(env); }
public void Run(RegressionEnvironment env) { var events = EventCollectionFactory.GetEventSetOne(0, 1000); var testCaseList = new CaseList(); EventExpressionCase testCase; testCase = new EventExpressionCase("b=SupportBean_B and d=SupportBean_D"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=SupportBean_B and every d=SupportBean_D"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=SupportBean_B and d=SupportBean_D"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every(b=SupportBean_B and d=SupportBean_D" + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); var model = new EPStatementObjectModel(); model.SelectClause = SelectClause.CreateWildcard(); PatternExpr pattern = Patterns.Every( Patterns.And(Patterns.Filter("SupportBean_B", "b"), Patterns.Filter("SupportBean_D", "d"))); model.FromClause = FromClause.Create(PatternStream.Create(pattern)); model = env.CopyMayFail(model); Assert.AreEqual( "select * from pattern [every (b=SupportBean_B and d=SupportBean_D" + ")]", model.ToEPL()); testCase = new EventExpressionCase(model); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( b=SupportBean_B and every d=SupportBean_D" + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every b=SupportBean_B and every d=SupportBean_D"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( every b=SupportBean_B and d=SupportBean_D" + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every a=SupportBean_A and d=SupportBean_D" + " and b=SupportBean_B"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every( every b=SupportBean_B and every d=SupportBean_D" + ")"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1")); for (var i = 0; i < 3; i++) { testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2")); } testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3")); for (var i = 0; i < 5; i++) { testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3")); } testCaseList.AddTest(testCase); testCase = new EventExpressionCase("a=SupportBean_A and d=SupportBean_D" + " and b=SupportBean_B"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every a=SupportBean_A and every d=SupportBean_D" + " and b=SupportBean_B"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("b=SupportBean_B and b=SupportBean_B"); testCase.Add("B1", "b", events.GetEvent("B1"), "b", events.GetEvent("B1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every a=SupportBean_A and every d=SupportBean_D" + " and every b=SupportBean_B"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D1", "b", events.GetEvent("B2"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B2"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D1"), "a", events.GetEvent("A2")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("B3", "b", events.GetEvent("B3"), "d", events.GetEvent("D2"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B2"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B3"), "d", events.GetEvent("D3"), "a", events.GetEvent("A2")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase( "every (a=SupportBean_A and every d=SupportBean_D" + " and b=SupportBean_B)"); testCase.Add("D1", "b", events.GetEvent("B1"), "d", events.GetEvent("D1"), "a", events.GetEvent("A1")); testCase.Add("D2", "b", events.GetEvent("B1"), "d", events.GetEvent("D2"), "a", events.GetEvent("A1")); testCase.Add("D3", "b", events.GetEvent("B1"), "d", events.GetEvent("D3"), "a", events.GetEvent("A1")); testCaseList.AddTest(testCase); testCase = new EventExpressionCase("every (b=SupportBean_B and b=SupportBean_B)"); testCase.Add("B1", "b", events.GetEvent("B1"), "b", events.GetEvent("B1")); testCase.Add("B2", "b", events.GetEvent("B2"), "b", events.GetEvent("B2")); testCase.Add("B3", "b", events.GetEvent("B3"), "b", events.GetEvent("B3")); testCaseList.AddTest(testCase); var util = new PatternTestHarness(events, testCaseList, GetType()); util.RunTest(env); }
public void TestIncludeAllRecursivelyExcludingNonExistingSingle() { var found = finder.FindAll(Patterns.And(Patterns.Include(@"**\*.*"), Patterns.Exclude(@"Bin\NonExisting"))); AssertFiles(AllFiles(), found); }
public void TestIncludeAllRecursivelyExcludingSingle() { var found = finder.FindAll(Patterns.And(Patterns.Include(@"**\*.*"), Patterns.Exclude(@"Bin\OMNSetup.msi"))); AssertFiles(AllFiles().Except(new[] { (IFile)Bin["OMNSetup.msi"] }), found); }