public void StopClient() { Ignition.StopAll(true); }
public void TearDown() { IgniteProcess.KillAll(); Ignition.StopAll(true); }
public void StopClient() { Ignition.StopAll(true); IgniteProcess.KillAll(); }
public void TestFixtureTearDown() { Ignition.StopAll(true); }
public void StopGrids() { Ignition.StopAll(true); }
public void FixtureTearDown() { _ignite.GetCompute().ExecuteJavaTask <object>(StopTask, _javaNodeName); Ignition.StopAll(true); }
public void TearDown() { Ignition.StopAll(true); }
/// <summary> /// Stops the grids. /// </summary> private void StopGrids() { _grid1 = null; Ignition.StopAll(true); }
public void TestFailover() { // Start 3 nodes. Ignition.Start(TestUtils.GetTestConfiguration(name: "0")); Ignition.Start(TestUtils.GetTestConfiguration(name: "1")); Ignition.Start(TestUtils.GetTestConfiguration(name: "2")); // Connect client. var port = IgniteClientConfiguration.DefaultPort; var cfg = new IgniteClientConfiguration { Endpoints = new[] { "localhost", string.Format("127.0.0.1:{0}..{1}", port + 1, port + 2) } }; // ReSharper disable AccessToDisposedClosure using (var client = Ignition.StartClient(cfg)) { Assert.AreEqual(0, client.GetCacheNames().Count); Action checkReconnect = () => { // First operation may fail or may not. // Sometimes the client will switch to another socket in background due to // OnAffinityTopologyVersionChange callback. var timeout = DateTime.Now.AddSeconds(0.3); while (DateTime.Now < timeout) { try { Assert.AreEqual(0, client.GetCacheNames().Count); break; } catch (Exception e) { Assert.IsNotNull(GetSocketException(e)); } } }; // Stop first node. var nodeId = ((IPEndPoint)client.RemoteEndPoint).Port - port; Ignition.Stop(nodeId.ToString(), true); checkReconnect(); // Stop second node. nodeId = ((IPEndPoint)client.RemoteEndPoint).Port - port; Ignition.Stop(nodeId.ToString(), true); checkReconnect(); // Stop all nodes. Ignition.StopAll(true); Assert.IsNotNull(GetSocketException(Assert.Catch(() => client.GetCacheNames()))); Assert.IsNotNull(GetSocketException(Assert.Catch(() => client.GetCacheNames()))); } }
public void GlobalCleanup() { Ignition.StopAll(true); }
public void TestFixtureTearDown() { Ignition.StopAll(true); TestUtils.KillProcesses(); }
public void TearDown() { Ignition.StopAll(true); UnloadDomains(); }
public static void StopAll() => Ignition.StopAll(false);
public virtual void GlobalCleanup() { Client.Dispose(); Ignition.StopAll(true); }
public void FixtureTearDown() { Ignition.StopAll(true); Client.Dispose(); }
public void TestFailoverWithRetryPolicyCompletesOperationWithoutException( [Values(true, false)] bool async, [Values(true, false)] bool partitionAware) { // Start 3 nodes. Func <string, IgniteConfiguration> getConfig = name => new IgniteConfiguration(TestUtils.GetTestConfiguration(name: name)) { ClientConnectorConfiguration = new ClientConnectorConfiguration { ThinClientConfiguration = new ThinClientConfiguration { MaxActiveComputeTasksPerConnection = 1 } } }; Ignition.Start(getConfig("0")); Ignition.Start(getConfig("1")); Ignition.Start(getConfig("2")); // Connect client. var port = IgniteClientConfiguration.DefaultPort; var cfg = new IgniteClientConfiguration { Endpoints = new[] { "localhost", string.Format("127.0.0.1:{0}..{1}", port + 1, port + 2) }, RetryPolicy = new ClientRetryAllPolicy(), RetryLimit = 3, EnablePartitionAwareness = partitionAware }; // ReSharper disable AccessToDisposedClosure using (var client = Ignition.StartClient(cfg)) { var cache = client.GetOrCreateCache <int, int>("c"); // Check all DoOp overloads. Action checkOperation = partitionAware ? async ? (Action)(() => Assert.IsFalse(cache.ContainsKeyAsync(1).Result)) : () => Assert.IsFalse(cache.ContainsKey(1)) : async ? (Action)(() => Assert.IsNotNull(client.GetCompute().ExecuteJavaTaskAsync <object>( ComputeClientTests.TestTask, null).Result)) : () => Assert.AreEqual(1, client.GetCacheNames().Count); checkOperation(); // Stop first node. var nodeId = ((IPEndPoint)client.RemoteEndPoint).Port - port; Ignition.Stop(nodeId.ToString(), true); checkOperation(); // Stop second node. nodeId = ((IPEndPoint)client.RemoteEndPoint).Port - port; Ignition.Stop(nodeId.ToString(), true); checkOperation(); // Stop all nodes. Ignition.StopAll(true); Assert.IsNotNull(GetSocketException(Assert.Catch(() => client.GetCacheNames()))); Assert.IsNotNull(GetSocketException(Assert.Catch(() => client.GetCacheNames()))); } }
/// <summary> /// Stops the grids. /// </summary> private void StopGrids() { Grid1 = Grid2 = Grid3 = null; Ignition.StopAll(true); }
public virtual void FixtureTearDown() { Ignition.StopAll(true); }
public virtual void AfterTests() { Ignition.StopAll(true); }
public void TestStartGetStop() { var cfgs = new List <string> { "config\\start-test-grid1.xml", "config\\start-test-grid2.xml", "config\\start-test-grid3.xml" }; var cfg = new IgniteConfiguration { SpringConfigUrl = cfgs[0], JvmOptions = TestUtils.TestJavaOptions(), JvmClasspath = TestUtils.CreateTestClasspath() }; var grid1 = Ignition.Start(cfg); Assert.AreEqual("grid1", grid1.Name); cfg.SpringConfigUrl = cfgs[1]; var grid2 = Ignition.Start(cfg); Assert.AreEqual("grid2", grid2.Name); cfg.SpringConfigUrl = cfgs[2]; var grid3 = Ignition.Start(cfg); Assert.IsNull(grid3.Name); Assert.AreSame(grid1, Ignition.GetIgnite("grid1")); Assert.AreSame(grid1, Ignition.TryGetIgnite("grid1")); Assert.AreSame(grid2, Ignition.GetIgnite("grid2")); Assert.AreSame(grid2, Ignition.TryGetIgnite("grid2")); Assert.AreSame(grid3, Ignition.GetIgnite(null)); Assert.AreSame(grid3, Ignition.TryGetIgnite(null)); Assert.Throws <IgniteException>(() => Ignition.GetIgnite("invalid_name")); Assert.IsNull(Ignition.TryGetIgnite("invalid_name")); Assert.IsTrue(Ignition.Stop("grid1", true)); Assert.Throws <IgniteException>(() => Ignition.GetIgnite("grid1")); grid2.Dispose(); Assert.Throws <IgniteException>(() => Ignition.GetIgnite("grid2")); grid3.Dispose(); Assert.Throws <IgniteException>(() => Ignition.GetIgnite("grid3")); foreach (var cfgName in cfgs) { cfg.SpringConfigUrl = cfgName; cfg.JvmOptions = TestUtils.TestJavaOptions(); Ignition.Start(cfg); } foreach (var gridName in new List <string> { "grid1", "grid2", null }) { Assert.IsNotNull(Ignition.GetIgnite(gridName)); } Ignition.StopAll(true); foreach (var gridName in new List <string> { "grid1", "grid2", null }) { Assert.Throws <IgniteException>(() => Ignition.GetIgnite(gridName)); } }
public void TearDown() { Ignition.StopAll(true); Directory.Delete(TempDir, true); }
/** <inheritDoc /> */ protected override void OnStop() { Ignition.StopAll(true); }
public void TearDown() { TestUtils.KillProcesses(); Ignition.StopAll(true); }
public void SetUp() { Ignition.StopAll(true); IgniteProcess.KillAll(); }
public void FixtureSetUp() { Ignition.StopAll(true); }
public void TearDown() { Ignition.StopAll(true); IgniteProcess.KillAll(); Ignition.ClientMode = false; }
public void FixtureTearDown() { Ignition.StopAll(true); Directory.Delete(_tempDir, true); }
public static void ClassCleanup() { Ignition.StopAll(true); }