예제 #1
0
        /// <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();
            }
        }
예제 #2
0
        /// <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();
            }
        }
예제 #3
0
 public void TestRemoteNodesClientMode(Example example)
 {
     TestRemoteNodes(example, true);
 }
예제 #4
0
 public void TestRemoteNodes(Example example)
 {
     TestRemoteNodes(example, false);
 }
예제 #5
0
 public void TestLocalNode(Example example)
 {
     example.Run();
 }
예제 #6
0
 public void TestRemoteNodes(Example example)
 {
     TestRemoteNodes(example, false);
 }
예제 #7
0
        public void TestThinExample(Example example)
        {
            Assert.IsTrue(example.IsThin);

            example.Run();
        }
예제 #8
0
 public void TestRemoteNodesClientMode(Example example)
 {
     TestRemoteNodes(example, true);
 }
예제 #9
0
        public void TestThickExample(Example example)
        {
            Assert.IsFalse(example.IsThin);

            example.Run();
        }
예제 #10
0
 public void TestLocalNode(Example example)
 {
     example.Run();
 }
예제 #11
0
 /// <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);
 }
예제 #12
0
 public void TestThickExampleWithExternalNode(Example example)
 {
     example.Run();
 }