Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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
        }