public void DetectsNoCsvFileNames()
        {
            //arrange
            string       jmxWithNoCsvFileNames = "csv-missing-filenames.jmx";
            JmeterScript jmeterScript          = new JmeterScript(jmxWithNoCsvFileNames);
            //act
            bool Actual = jmeterScript.HasEnabledCsvControl();

            jmeterScript.AddRedisControl();
            //assert
            Assert.IsTrue(true);
        }
        public void AddRedisConfigControl()
        {
            //arrange
            JmeterScript jmeterScript = new JmeterScript(jmeterScriptFileName);
            bool         Expected     = true;
            //act
            bool Actual = jmeterScript.HasEnabledCsvControl();

            jmeterScript.AddRedisControl();
            jmeterScript.WriteNewFile("maybe.jmx");
            //assert
            Assert.AreEqual(Expected, Actual);
        }
示例#3
0
        static void RunOptions(Options opts)
        {
            string testScript = Path.GetFileName(opts.TestScript);
            var    workingDir = Path.GetDirectoryName(opts.TestScript);

            Directory.SetCurrentDirectory(workingDir);
            string testScriptNew = Path.GetFileNameWithoutExtension(testScript) + "-modified.jmx";

            Logger.Info($"Opening {testScript}");
            JmeterScript jmeterScript = new JmeterScript(testScript, Logger);

            if (opts.AddBackEndListener)
            {
                Logger.Info("Adding Influx DB backend listener.");
                jmeterScript.AddBackEndListener();
            }
            Logger.Info("Checking for CSV config elements");
            if (jmeterScript.HasEnabledCsvControl())
            {
                Logger.Info("Starting to process the Csv Configs");
                jmeterScript.AddRedisControl(opts.ContinueOnError);
                jmeterScript.WriteNewFile(testScriptNew);
            }
        }