/// <summary> /// Tests the example with standalone Apache.Ignite.exe nodes. /// </summary> /// <param name="example">The example to run.</param> /// <param name="clientMode">Client mode flag.</param> private static void TestRemoteNodes(Example example, bool clientMode) { Assert.IsNotEmpty(example.ConfigPath); var configPath = Path.Combine(PathUtil.IgniteHome, PathUtil.DevPrefix, example.ConfigPath); // Try with multiple standalone nodes for (var i = 0; i < 2; i++) { // Start a grid to monitor topology // Stop it after topology check so we don't interfere with example Ignition.ClientMode = false; using (var ignite = Ignition.StartFromApplicationConfiguration( "igniteConfiguration", configPath)) { var args = new List<string> { "-configFileName=" + configPath}; if (example.NeedsTestDll) args.Add(" -assembly=" + typeof(AverageSalaryJob).Assembly.Location); var proc = new IgniteProcess(args.ToArray()); Assert.IsTrue(ignite.WaitTopology(i + 2)); Assert.IsTrue(proc.Alive); } Ignition.ClientMode = clientMode; // Run twice to catch issues with standalone node state example.Run(); example.Run(); } }
/// <summary> /// Tests the example with standalone Apache.Ignite.exe nodes. /// </summary> /// <param name="example">The example to run.</param> /// <param name="clientMode">Client mode flag.</param> private static void TestRemoteNodes(Example example, bool clientMode) { // Exclude LifecycleExample if (string.IsNullOrEmpty(example.SpringConfigUrl)) { Assert.AreEqual("LifecycleExample", example.Name); return; } // First node to start in current process defines JVM options. var gridConfig = new IgniteConfiguration { SpringConfigUrl = example.SpringConfigUrl, JvmOptions = new[] { "-Xms512m", "-Xmx1024m", "-Xdebug", "-Xnoagent", "-Djava.compiler=NONE", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" } }; // Try with multiple standalone nodes for (var i = 0; i < 2; i++) { // Start a grid to monitor topology // Stop it after topology check so we don't interfere with example Ignition.ClientMode = false; using (var ignite = Ignition.Start(gridConfig)) { var args = new List<string> {"-springConfigUrl=" + example.SpringConfigUrl}; if (example.NeedsTestDll) args.Add(" -assembly=" + typeof(AverageSalaryJob).Assembly.Location); var proc = new IgniteProcess(args.ToArray()); Assert.IsTrue(ignite.WaitTopology(i + 2, 30000)); Assert.IsTrue(proc.Alive); } Ignition.ClientMode = clientMode; // Run twice to catch issues with standalone node state example.Run(); example.Run(); } }
public void TestRemoteNodesClientMode(Example example) { TestRemoteNodes(example, true); }
public void TestRemoteNodes(Example example) { TestRemoteNodes(example, false); }
public void TestLocalNode(Example example) { example.Run(); }
public void TestThinExample(Example example) { Assert.IsTrue(example.IsThin); example.Run(); }
public void TestThickExample(Example example) { Assert.IsFalse(example.IsThin); example.Run(); }
/// <summary> /// Checks the test output. /// </summary> /// <param name="example">Example.</param> /// <param name="requiredLines">Optional extra lines to check for.</param> protected void CheckOutput(Example example, params string[] requiredLines) { CheckOutput(null, example, requiredLines); }
public void TestThickExampleWithExternalNode(Example example) { example.Run(); }