jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milam...@apache.org
Subject svn commit: r1341220 - in /jmeter/trunk/test/src/org/apache/jmeter/testelement: BarChartTest.java LineGraphTest.java
Date Mon, 21 May 2012 21:53:35 GMT
Author: milamber
Date: Mon May 21 21:53:34 2012
New Revision: 1341220

URL: http://svn.apache.org/viewvc?rev=1341220&view=rev
Log:
Using a temporary directory and files for test stat graph

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java
    jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java?rev=1341220&r1=1341219&r2=1341220&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java Mon May 21 21:53:34
2012
@@ -18,6 +18,7 @@
 package org.apache.jmeter.testelement;
 
 import java.io.File;
+import java.io.IOException;
 
 import javax.swing.JComponent;
 
@@ -39,7 +40,7 @@ public class BarChartTest extends JMeter
         super(arg0);
     }
 
-    public void testGenerateBarChart() {
+    public void testGenerateBarChart() throws IOException {
         log.info("jtl version=" + JMeterUtils.getProperty("file_format.testlog"));
         // String sampleLog = "C:/eclipse3/workspace/jmeter-21/bin/testfiles/sample_log1.jtl";
         String sampleLog = findTestPath("testfiles/sample_log1.jtl");
@@ -79,7 +80,7 @@ public class BarChartTest extends JMeter
         String filename = bchart.getTitle();
         filename = filename.replace(' ','_');
         if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
-            String outName = findTestPath("./testfiles/" + filename);
+            String outName = File.createTempFile(filename, null).getAbsolutePath(); // tweak.
             serv.saveJComponent(outName,SaveGraphicsService.PNG,gr);
             assertTrue("Should have created the file",new File(outName+".png").exists());
         }

Modified: jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java?rev=1341220&r1=1341219&r2=1341220&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java Mon May 21 21:53:34
2012
@@ -18,6 +18,7 @@
 package org.apache.jmeter.testelement;
 
 import java.io.File;
+import java.io.IOException;
 
 import javax.swing.JComponent;
 
@@ -39,7 +40,7 @@ public class LineGraphTest extends JMete
         super(arg0);
     }
 
-    public void testGenerateLineChart() {
+    public void testGenerateLineChart() throws IOException {
         log.info("jtl version=" + JMeterUtils.getProperty("file_format.testlog"));
         // String sampleLog = "C:/eclipse3/workspace/jmeter-21/bin/testfiles/sample_log1.jtl";
         String sampleLog = findTestPath("testfiles/sample_log1.jtl");
@@ -79,7 +80,7 @@ public class LineGraphTest extends JMete
         String filename = lgraph.getTitle();
         filename = filename.replace(' ','_');
         if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
-            String outPfx = findTestPath("./testfiles/" + filename);
+            String outPfx = File.createTempFile(filename, null).getAbsolutePath(); // tweak.
             serv.saveJComponent(outPfx,SaveGraphicsService.PNG,gr);
             assertTrue("Should have created file",new File(outPfx+".png").exists());
         }



Mime
View raw message