Esempio n. 1
0
        public void TestTaskAdapter()
        {
            Assert.AreEqual(3, Grid1.GetCluster().GetNodes().Count);

            HashSet <Guid> allNodes = new HashSet <Guid>();

            for (int i = 0; i < 20 && allNodes.Count < 3; i++)
            {
                HashSet <Guid> res = Grid1.GetCompute().Execute(new TestSplitTask(), 1);

                Assert.AreEqual(1, res.Count);

                allNodes.UnionWith(res);
            }

            Assert.AreEqual(3, allNodes.Count);

            HashSet <Guid> res2 = Grid1.GetCompute().Execute <int, Guid, HashSet <Guid> >(typeof(TestSplitTask), 3);

            Assert.IsTrue(res2.Count > 0);

            Grid1.GetCompute().Execute(new TestSplitTask(), 100);

            Assert.AreEqual(3, allNodes.Count);
        }
Esempio n. 2
0
        public void TestReducerInjection()
        {
            int res = Grid1.GetCompute().Apply(new InjectionClosure(), new List <int> {
                1, 1, 1
            }, new InjectionReducer());

            Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res);
        }
Esempio n. 3
0
        public void TestNoResultCache()
        {
            int res = Grid1.GetCompute().Execute(new NoResultCacheTask(), 0);

            Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res);
        }
Esempio n. 4
0
        public void TestClosureInjection()
        {
            var res = Grid1.GetCompute().Broadcast(new InjectionClosure(), 1);

            Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res.Sum());
        }
Esempio n. 5
0
        public void TestTaskInjection()
        {
            int res = Grid1.GetCompute().Execute(new InjectionTask(), 0);

            Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res);
        }