public override void Consume(string input) { if (index == 0) { if (!"Test1".Equals(input)) { StaticTestHelper.FailTest("Wrong input received, expected Test1 | got: " + input); } else { StaticTestHelper.PassTest("Correct value received"); } index++; } else { StaticTestHelper.TempFailTest("Temp fail for index 2 "); if (!"Test2".Equals(input)) { StaticTestHelper.FailTest("Wrong input received, expected Test2 | got: " + input); } else { StaticTestHelper.PassTest("Correct value received"); } } }
public override void Consume(TypeB input) { if (index == 0) { if (!input.Field2.Equals("0")) { StaticTestHelper.FailTest("Wrong input received, expected: 0 |actual: " + input.Field2); } else { StaticTestHelper.PassTest("Expected input received, expected: 0 | actual: " + input.Field2); } index++; } else { StaticTestHelper.TempFailTest("Temp fail test for index 1"); if (!input.Field2.Equals("1")) { StaticTestHelper.FailTest("Wrong input received, expected: 1 |actual: " + input.Field2); } else { StaticTestHelper.PassTest("Expected input received, expected: 1 | actual: " + input.Field2); } } }
public async System.Threading.Tasks.Task TestParallelAsync() { var breaker = _cluster.GrainFactory.GetGrain <ITestHelper>(this.GetType().Namespace); StaticTestHelper.Reset(); StaticTestHelper.TempFailTest("Initial fail of the test"); var conf = new TopologyConfiguration(); conf.TimeCharacteristic = CoreOSP.TimePolicy.None; var mgr = new TopologyManager(conf); var ds = mgr.AddSource(typeof(TestSource), 1); var wds = ds.WindowAggregate(typeof(TestEventBasedAggregationM)); var terminationds = mgr.AddSource(typeof(TestSource1), 1); wds.AddInput(terminationds); var sink = wds.Sink(typeof(TestSink), 1); JobManager jmgr = new JobManager(); await jmgr.StartJob(mgr, _cluster.Client); Thread.Sleep(10000); var result = StaticTestHelper.GetStatus(); Assert.False(result.Item1, result.Item2); }
public override void Consume(string input) { if (!success) { StaticTestHelper.TempFailTest("Not yet received from both inputs"); } if (input == "Test1") { gotTest1 = true; } else if (input == "Test2") { gotTest2 = true; } else { StaticTestHelper.FailTest("Unexpected input: " + input); } if (gotTest2 && gotTest1) { success = true; } if (success) { StaticTestHelper.PassTest("Received from both inputs already"); } }
public override void Consume(string input) { if (!input.Equals("Test1")) { StaticTestHelper.FailTest("Wrong input received: " + input); } else { StaticTestHelper.PassTest("Correct input received"); } }
public override void Consume(int input) { StaticTestHelper.LogMessage("Logging input: " + input); if (input == 8 || input == 10) { StaticTestHelper.PassTest("Got expected value"); } else { StaticTestHelper.FailTest("got unexpected value : " + input); } }
public override void ProcessWatermark(Watermark wm, Metadata metadata) { wmCount++; if (wmCount != 2) { StaticTestHelper.TempFailTest("Wmcount !=2 actual: " + wmCount); } else { StaticTestHelper.PassTest("Wmcount == 2"); } }
public override void Consume(string input) { if (val == "") { StaticTestHelper.PassTest("Got a value"); val = input; } if (val != input) { StaticTestHelper.FailTest(string.Format("Wrong value received, expected: {0}, got {1} ", val, input)); } }
public async System.Threading.Tasks.Task TestWatermark() { StaticTestHelper.Reset(); StaticTestHelper.TempFailTest("Init test fail"); var conf = new TopologyConfiguration(); var mgr = new TopologyManager(conf); var ds = mgr.AddSource(typeof(TestSource), 1); var sink = ds.Sink(typeof(TestSink), 1); JobManager jmgr = new JobManager(); await jmgr.StartJob(mgr, _cluster.Client); Thread.Sleep(7000); var result = StaticTestHelper.GetStatus(); Assert.False(result.Item1, result.Item2); }
public override void Consume(string input) { if (val == "") { val = input; } if (val != input) { StaticTestHelper.FailTest("Unexpected value received"); } else { StaticTestHelper.PassTest("Value received"); } }
public override void Consume(int input) { if (input == 4 || input == 5 || input == 100 || input == 8 || input == 10) { StaticTestHelper.PassTest("Correct input received: " + input); count++; } else { StaticTestHelper.FailTest("Completely incorrect value received: " + input); } if (count != 5) { StaticTestHelper.TempFailTest("Count is not 5, actual: " + count); } }
public async System.Threading.Tasks.Task TestParallelFail2Async() { var breaker = _cluster.GrainFactory.GetGrain <ITestHelper>(this.GetType().Namespace); StaticTestHelper.Reset(); var conf = new TopologyConfiguration(); var mgr = new TopologyManager(conf); var ds = mgr.AddSource(typeof(TestSource2), 2); ds.Sink(typeof(TestSink1), 2); JobManager jmgr = new JobManager(); await jmgr.StartJob(mgr, _cluster.Client); Thread.Sleep(1000); var result = StaticTestHelper.GetStatus(); Assert.True(result.Item1, result.Item2); }
public async System.Threading.Tasks.Task TestSourceFilterSinkRunAsync() { StaticTestHelper.Reset(); StaticTestHelper.TempFailTest("Initial fail of test"); var conf = new TopologyConfiguration(); var mgr = new TopologyManager(conf); var ds = mgr.AddSource(typeof(TestSource1)); ds.Filter(typeof(TestFilter)).Sink(typeof(TestSink1)); JobManager jmgr = new JobManager(); await jmgr.StartJob(mgr, _cluster.Client); Thread.Sleep(1000); var result = StaticTestHelper.GetStatus(); Assert.False(result.Item1, result.Item2); }
public async System.Threading.Tasks.Task TestParallelMoreStreams() { var breaker = _cluster.GrainFactory.GetGrain <ITestHelper>(this.GetType().Namespace); StaticTestHelper.Reset(); var conf = new TopologyConfiguration(); var mgr = new TopologyManager(conf); var ds = mgr.AddSource(typeof(TestSource), 3); ds.Sink(typeof(TestSink1), 3); JobManager jmgr = new JobManager(); await jmgr.StartJob(mgr, _cluster.Client); Thread.Sleep(1000); var result = StaticTestHelper.GetStatus(); Assert.True(result.Item1, result.Item2); //must break because messages go 1,2,1,2 and there are 3 sinks 1->first 2->second 1->third 2->first = fail }
public override void ProcessWatermark(Watermark wm, Metadata metadata) { if (wmCount == 0) { if (wm.TimeStamp != new DateTime(2019, 10, 10, 10, 10, 9)) { error = true; } } else if (wmCount == 1) { if (wm.TimeStamp != new DateTime(2019, 10, 10, 10, 10, 10, 100)) { error = true; } } else if (wmCount == 2) { if (wm.TimeStamp != new DateTime(2019, 10, 10, 10, 10, 11, 500)) { error = true; } } wmCount++; if (wmCount != 3) { StaticTestHelper.TempFailTest("Wmcount != 3, actual: " + wmCount); } else { if (!error) { StaticTestHelper.PassTest("WmCount == 3"); } } }
public override void ProcessWatermark(Watermark wm, Metadata metadata) { StaticTestHelper.LogMessage("Watermarktime: " + wm.TimeStamp); base.ProcessWatermark(wm, metadata); }
public override void ProcessData(Data <Test> input, Metadata metadata) { StaticTestHelper.LogMessage("Window start: " + this.WindowStart); StaticTestHelper.LogMessage("Logginge event time: " + input.Value.EventTime); base.ProcessData(input, metadata); }