Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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
        }
Example #6
0
        private static async Task Test1(IClusterClient client)
        {
            var streamProvider = client.GetStreamProvider("SMSProvider");
            var guid           = new Guid();
            var photoStream    = streamProvider.GetStream <string>(guid, "Photo");
            var tagStream      = streamProvider.GetStream <string>(guid, "Tag");
            var gpsStream      = streamProvider.GetStream <string>(guid, "GPS");

            TopologyConfiguration conf = new TopologyConfiguration();
            TopologyManager       tpm  = new TopologyManager(conf);

            var a = tpm.AddSource(typeof(TestSourceA));

            a.Sink(typeof(GenericPrintSink));

            JobManager jmgr = new JobManager();
            await jmgr.StartJob(tpm, client);

            await DataDriver.Run(photoStream, tagStream, gpsStream, 1600, 0);
        }
Example #7
0
        /// <summary>
        /// Gets the contact center trusted gruu.
        /// </summary>
        /// <returns>Can return null.</returns>
        public string GetContactCenterTrustedGruu()
        {
            string contactCenterGruu = null;

            if (!String.IsNullOrEmpty(Configuration.ContactCenterApplicationId))
            {
                TopologyConfiguration   topologyConfig             = m_collabPlatform.TopologyConfiguration;
                ApplicationTopologyData wcfApplicationTopologyData = m_collabPlatform.ApplicationTopologyData;
                if (topologyConfig != null && wcfApplicationTopologyData != null)
                {
                    Collection <ApplicationTopologyData> applicationTopologyDataCollection = topologyConfig.GetApplicationTopologyData(Configuration.ContactCenterApplicationId);
                    if (applicationTopologyDataCollection.Count == 0)
                    {
                        Helper.Logger.Error("Unable to retrieve application topology data for the contact center application. Please make sure contact center application is configured properly.");
                    }
                    else
                    {
                        //Match the contact center application in the same site.
                        foreach (ApplicationTopologyData appData in applicationTopologyDataCollection)
                        {
                            if (appData.SiteId.Equals(wcfApplicationTopologyData.SiteId))
                            {
                                contactCenterGruu = appData.PoolGruu;
                                Helper.Logger.Info("Successfully retrieved contact center address.");
                                break;
                            }
                        }
                    }
                }
                else
                {
                    Helper.Logger.Error("Unable to retrieve topology configuration from the platform. Please make sure Microsoft Lync Server data replication is complete.");
                }
            }
            else
            {
                Helper.Logger.Error("Configuration does not contain a valid contact center application id. Please configure the contact center application id in web.config file.");
            }

            return(contactCenterGruu);
        }