public void AddBackendListener() { //arrange JmeterScript jmeterScript = new JmeterScript(jmeterScriptFileName); //act jmeterScript.AddBackEndListener(); jmeterScript.WriteNewFile("backendlistener.jmx"); //assert Assert.IsTrue(true); }
public void JmeterTestHasCsvControl() { //arrange JmeterScript jmeterScript = new JmeterScript(jmeterScriptFileName); bool Expected = true; //act bool Actual = jmeterScript.HasEnabledCsvControl(); //assert Assert.AreEqual(Expected, Actual); }
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); }
public void CopyJmeter() { //arrange string jmeterDestinationFileName = "redis-copy.jmx"; JmeterScript jmeterScript = new JmeterScript(jmeterScriptFileName); //act jmeterScript.WriteNewFile(jmeterDestinationFileName); //assert bool fileWasCreated = File.Exists(jmeterDestinationFileName); Assert.IsTrue(fileWasCreated); }
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); } }