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); }
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); }
public void TestNoResultCache() { int res = Grid1.GetCompute().Execute(new NoResultCacheTask(), 0); Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res); }
public void TestClosureInjection() { var res = Grid1.GetCompute().Broadcast(new InjectionClosure(), 1); Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res.Sum()); }
public void TestTaskInjection() { int res = Grid1.GetCompute().Execute(new InjectionTask(), 0); Assert.AreEqual(Grid1.GetCluster().GetNodes().Count, res); }