jakarta-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1028515 - in /jakarta/jmeter/trunk: bin/ bin/examples/ src/core/org/apache/jmeter/reporters/ src/core/org/apache/jmeter/services/ xdocs/ xdocs/usermanual/
Date Wed, 03 Nov 2010 10:57:26 GMT
On 3 November 2010 10:18, sebb <sebbaz@gmail.com> wrote:
> On 3 November 2010 09:32, sebb <sebbaz@gmail.com> wrote:
>> On 3 November 2010 08:03, Milamber <milamber@apache.org> wrote:
>>> Hello,
>>>
>>> When I use Ant script [tests] (on same project), I have the following
>>> errors :
>>>
>>> * 1 error with jdk1.6_21
>>> * 1 error + 4 failures with jdk1.6_22
>>>
>>> For the error, I think that must remove a slash in
>>> test/src/org/apache/jmeter/services/TestFileServer.java
>>> on this line : "infile=findTestPath("/testfiles/test.csv");"
>>> to infile=findTestPath("testfiles/test.csv");
>>
>> Oops!
>>
>> No idea why this works on Windows.
>>
>>> For failures, I don't understand now (I don't really searching the root
>>> cause)
>>
>> Me neither, but I will investigate.
>
> Looks like the HTTP implementation has changed - it no longer seems to
> send the Content-Length header with POST requests.

Appears to be related to this bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996110

as setting "sun.net.http.allowRestrictedHeaders=true" allows the test
to complete successfully.

Unfortunately "sun.net.http.allowRestrictedHeaders" does not appear to
be documented anywhere yet apart from the bug report.

>>
>> I'm also updating the build script and test code so Hudson should
>> catch failures better.
>>
>>> ================== JDK1.6 u21=================================
>>>     [echo]
>>>     [echo]    gump.run = false
>>>     [echo]    java.awt.headless = ${java.awt.headless}
>>>     [echo]    test.headless =
>>>     [echo]    user.dir =
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [echo]    basedir =
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [echo]    test dir = build/test
>>>     [echo]    test dir gump = build/test
>>>     [echo]    testsaveservice.saveout = ${testsaveservice.saveout}
>>>     [echo]
>>>     [java] Setting JMeterHome:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [java] Setting up logging props using file:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] Using initializeProperties() from
>>> org.apache.jmeter.util.JMeterUtils
>>>     [java] Setting up initial properties using:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] Initializing Properties:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] java.version=1.6.0_21
>>>     [java] java.home=/home/milamber/opt/jdk1.6.0_21/jre
>>>     [java]
>>> user.dir=/home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin
>>>     [java] os.name=Linux
>>>     [java] os.version=2.6.32-5-amd64
>>>     [java] +++++++++++
>>>     [java] java.awt.headless=
>>>     [java] java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
>>>     [java] ------------
>>>     [java] Creating test suite
>>>     [java] Scanning build/test for test cases
>>>     [java] ClassFinder found: 87 TestCase classes
>>>     [java] INFO: JMeterGUIComponent: skipping some tests
>>> org.apache.jmeter.testbeans.gui.TestBeanGUI
>>>     [java] Created: 87 tests including 8 suites
>>>     [java] Starting test run, test count = 1999
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] ...............E..........................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] ...............................
>>>     [java] Time: 24.488
>>>     [java] There was 1 error:
>>>     [java] 1)
>>> testopen(org.apache.jmeter.services.TestFileServer)java.io.FileNotFoundException:
>>> /testfiles/test.csv (No such file or directory)
>>>     [java]     at java.io.FileInputStream.open(Native Method)
>>>     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.createBufferedReader(FileServer.java:241)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:218)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:202)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:190)
>>>     [java]     at
>>> org.apache.jmeter.services.TestFileServer.testopen(TestFileServer.java:90)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] FAILURES!!!
>>>     [java] Tests run: 1999,  Failures: 0,  Errors: 1
>>> =============================================================
>>>
>>>
>>>
>>> ================== JDK1.6 u22=================================
>>> _test:
>>>     [echo]
>>>     [echo]    gump.run = false
>>>     [echo]    java.awt.headless = ${java.awt.headless}
>>>     [echo]    test.headless =
>>>     [echo]    user.dir =
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [echo]    basedir =
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [echo]    test dir = build/test
>>>     [echo]    test dir gump = build/test
>>>     [echo]    testsaveservice.saveout = ${testsaveservice.saveout}
>>>     [echo]
>>>     [java] Setting JMeterHome:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration
>>>     [java] Setting up logging props using file:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] Using initializeProperties() from
>>> org.apache.jmeter.util.JMeterUtils
>>>     [java] Setting up initial properties using:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] Initializing Properties:
>>> /home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin/testfiles/jmetertest.properties
>>>     [java] java.version=1.6.0_22
>>>     [java] java.home=/home/milamber/opt/jdk1.6.0_22/jre
>>>     [java]
>>> user.dir=/home/milamber/W-workspaces/Workspaces-JMeter/JMeter-Integration/bin
>>>     [java] os.name=Linux
>>>     [java] os.version=2.6.32-5-amd64
>>>     [java] +++++++++++
>>>     [java] java.awt.headless=
>>>     [java] java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
>>>     [java] ------------
>>>     [java] Creating test suite
>>>     [java] Scanning build/test for test cases
>>>     [java] ClassFinder found: 87 TestCase classes
>>>     [java] INFO: JMeterGUIComponent: skipping some tests
>>> org.apache.jmeter.testbeans.gui.TestBeanGUI
>>>     [java] Created: 87 tests including 8 suites
>>>     [java] Starting test run, test count = 1999
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] ........................................F.
>>>     [java] .F..F..F....................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] ...............E..........................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] .........................................
>>>     [java] ...............................
>>>     [java] Time: 24.865
>>>     [java] There was 1 error:
>>>     [java] 1)
>>> testopen(org.apache.jmeter.services.TestFileServer)java.io.FileNotFoundException:
>>> /testfiles/test.csv (No such file or directory)
>>>     [java]     at java.io.FileInputStream.open(Native Method)
>>>     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.createBufferedReader(FileServer.java:241)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:218)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:202)
>>>     [java]     at
>>> org.apache.jmeter.services.FileServer.readLine(FileServer.java:190)
>>>     [java]     at
>>> org.apache.jmeter.services.TestFileServer.testopen(TestFileServer.java:90)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] There were 4 failures:
>>>     [java] 1)
>>> testPostRequest_UrlEncoded(org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer)junit.framework.AssertionFailedError:
>>> Expected type:application/x-www-form-urlencoded & length: 39 in:
>>>     [java] Connection: close
>>>     [java] Content-Type: application/x-www-form-urlencoded
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkHeaderTypeLength(TestHTTPSamplersAgainstHttpMirrorServer.java:1012)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkPostRequestBody(TestHTTPSamplersAgainstHttpMirrorServer.java:816)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkPostRequestUrlEncoded(TestHTTPSamplersAgainstHttpMirrorServer.java:708)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_UrlEncoded(TestHTTPSamplersAgainstHttpMirrorServer.java:165)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_UrlEncoded(TestHTTPSamplersAgainstHttpMirrorServer.java:106)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at
>>> junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>>>     [java]     at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>>>     [java]     at junit.extensions.TestSetup.run(TestSetup.java:27)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] 2)
>>> testPostRequest_FormMultipart(org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer)junit.framework.AssertionFailedError:
>>> Expected type:multipart/form-data;
>>> boundary=---------------------------7d159c1302d0y0 & length: 421 in:
>>>     [java] Connection: close
>>>     [java] Content-Type: multipart/form-data;
>>> boundary=---------------------------7d159c1302d0y0
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkHeaderTypeLength(TestHTTPSamplersAgainstHttpMirrorServer.java:1012)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkPostRequestFormMultipart(TestHTTPSamplersAgainstHttpMirrorServer.java:735)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_FormMultipart(TestHTTPSamplersAgainstHttpMirrorServer.java:270)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_FormMultipart(TestHTTPSamplersAgainstHttpMirrorServer.java:114)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at
>>> junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>>>     [java]     at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>>>     [java]     at junit.extensions.TestSetup.run(TestSetup.java:27)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] 3)
>>> testPostRequest_FileUpload(org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer)junit.framework.AssertionFailedError:
>>> Expected type:multipart/form-data;
>>> boundary=---------------------------7d159c1302d0y0 & length: 713 in:
>>>     [java] Connection: close
>>>     [java] Content-Type: multipart/form-data;
>>> boundary=---------------------------7d159c1302d0y0
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkHeaderTypeLength(TestHTTPSamplersAgainstHttpMirrorServer.java:1012)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkPostRequestFileUpload(TestHTTPSamplersAgainstHttpMirrorServer.java:783)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_FileUpload(TestHTTPSamplersAgainstHttpMirrorServer.java:369)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_FileUpload(TestHTTPSamplersAgainstHttpMirrorServer.java:122)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at
>>> junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>>>     [java]     at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>>>     [java]     at junit.extensions.TestSetup.run(TestSetup.java:27)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] 4)
>>> testPostRequest_BodyFromParameterValues(org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer)junit.framework.AssertionFailedError:
>>> Expected type:application/x-www-form-urlencoded & length: 20 in:
>>>     [java] Connection: close
>>>     [java] Content-Type: application/x-www-form-urlencoded
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkHeaderTypeLength(TestHTTPSamplersAgainstHttpMirrorServer.java:1012)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.checkPostRequestBody(TestHTTPSamplersAgainstHttpMirrorServer.java:816)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_BodyFromParameterValues(TestHTTPSamplersAgainstHttpMirrorServer.java:405)
>>>     [java]     at
>>> org.apache.jmeter.protocol.http.sampler.TestHTTPSamplersAgainstHttpMirrorServer.testPostRequest_BodyFromParameterValues(TestHTTPSamplersAgainstHttpMirrorServer.java:130)
>>>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>     [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>     [java]     at
>>> junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>>>     [java]     at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>>>     [java]     at junit.extensions.TestSetup.run(TestSetup.java:27)
>>>     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:224)
>>>     [java] FAILURES!!!
>>>     [java] Tests run: 1999,  Failures: 4,  Errors: 1
>>> =============================================================
>>>
>>>
>>> Milamber
>>>
>>>
>>> Le 28/10/2010 21:58, sebb@apache.org a ecrit :
>>>> Author: sebb
>>>> Date: Thu Oct 28 21:58:11 2010
>>>> New Revision: 1028515
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1028515&view=rev
>>>> Log:
>>>> Bug 49365 - Allow result set to be written to file in a path relative to
the loaded script
>>>>
>>>> Modified:
>>>>     jakarta/jmeter/trunk/bin/examples/CSVSample.jmx
>>>>     jakarta/jmeter/trunk/bin/jmeter.properties
>>>>     jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
>>>>     jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultSaver.java
>>>>     jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
>>>>     jakarta/jmeter/trunk/xdocs/changes.xml
>>>>     jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
>>>>     jakarta/jmeter/trunk/xdocs/usermanual/listeners.xml
>>>>
>>>> Modified: jakarta/jmeter/trunk/bin/examples/CSVSample.jmx
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/examples/CSVSample.jmx?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/bin/examples/CSVSample.jmx (original)
>>>> +++ jakarta/jmeter/trunk/bin/examples/CSVSample.jmx Thu Oct 28 21:58:11 2010
>>>> @@ -343,7 +343,7 @@
>>>>              <bytes>true</bytes>
>>>>            </value>
>>>>          </objProp>
>>>> -        <stringProp name="filename"></stringProp>
>>>> +        <stringProp name="filename">~/CSVSample.jtl</stringProp>
>>>>        </ResultCollector>
>>>>        <hashTree/>
>>>>        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector"
testname="View Results Tree" enabled="true">
>>>>
>>>> Modified: jakarta/jmeter/trunk/bin/jmeter.properties
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/bin/jmeter.properties (original)
>>>> +++ jakarta/jmeter/trunk/bin/jmeter.properties Thu Oct 28 21:58:11 2010
>>>> @@ -364,6 +364,9 @@ log_level.jorphan=INFO
>>>>  # Optional xml processing instruction for line 2 of the file:
>>>>  #jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="../extras/jmeter-results-detail-report_21.xsl"?>
>>>>
>>>> +# Prefix used to identify filenames that are relative to the current base
>>>> +#jmeter.save.saveservice.base_prefix=~/
>>>> +
>>>>  #---------------------------------------------------------------------------
>>>>  # Settings that affect SampleResults
>>>>  #---------------------------------------------------------------------------
>>>>
>>>> Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
(original)
>>>> +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
Thu Oct 28 21:58:11 2010
>>>> @@ -46,6 +46,7 @@ import org.apache.jmeter.samplers.Sample
>>>>  import org.apache.jmeter.samplers.SampleSaveConfiguration;
>>>>  import org.apache.jmeter.save.CSVSaveService;
>>>>  import org.apache.jmeter.save.SaveService;
>>>> +import org.apache.jmeter.services.FileServer;
>>>>  import org.apache.jmeter.testelement.TestElement;
>>>>  import org.apache.jmeter.testelement.TestListener;
>>>>  import org.apache.jmeter.testelement.property.BooleanProperty;
>>>> @@ -375,6 +376,7 @@ public class ResultCollector extends Abs
>>>>          if (filename == null || filename.length() == 0) {
>>>>              return null;
>>>>          }
>>>> +        filename = FileServer.resolveBaseRelativeName(filename);
>>>>          FileEntry fe = files.get(filename);
>>>>          PrintWriter writer = null;
>>>>          boolean trimmed = true;
>>>>
>>>> Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultSaver.java
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultSaver.java?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultSaver.java
(original)
>>>> +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultSaver.java
Thu Oct 28 21:58:11 2010
>>>> @@ -28,6 +28,7 @@ import org.apache.commons.lang.text.StrB
>>>>  import org.apache.jmeter.samplers.SampleEvent;
>>>>  import org.apache.jmeter.samplers.SampleListener;
>>>>  import org.apache.jmeter.samplers.SampleResult;
>>>> +import org.apache.jmeter.services.FileServer;
>>>>  import org.apache.jmeter.testelement.AbstractTestElement;
>>>>  import org.apache.jmeter.threads.JMeterContextService;
>>>>  import org.apache.jorphan.logging.LoggingManager;
>>>> @@ -173,7 +174,7 @@ public class ResultSaver extends Abstrac
>>>>       *         text/html;charset=ISO-8859-1
>>>>       */
>>>>      private String makeFileName(String contentType, boolean skipAutoNumber,
boolean skipSuffix) {
>>>> -        StrBuilder sb = new StrBuilder(getFilename());
>>>> +        StrBuilder sb = new StrBuilder(FileServer.resolveBaseRelativeName(getFilename()));
>>>>          if (!skipAutoNumber){
>>>>              sb.append(nextNumber());
>>>>          }
>>>>
>>>> Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
(original)
>>>> +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
Thu Oct 28 21:58:11 2010
>>>> @@ -37,6 +37,7 @@ import java.util.Map;
>>>>  import java.util.Random;
>>>>
>>>>  import org.apache.jmeter.gui.JMeterFileFilter;
>>>> +import org.apache.jmeter.util.JMeterUtils;
>>>>  import org.apache.jorphan.logging.LoggingManager;
>>>>  import org.apache.log.Logger;
>>>>
>>>> @@ -54,9 +55,17 @@ import org.apache.log.Logger;
>>>>   * test plans to execute on unknown boxes that only have Java installed.
>>>>   */
>>>>  public class FileServer {
>>>> +
>>>>      private static final Logger log = LoggingManager.getLoggerForClass();
>>>>
>>>> -    private static final String DEFAULT_BASE = System.getProperty("user.dir");
>>>> +    private static final String DEFAULT_BASE = System.getProperty("user.dir");//
$NON-NLS-1$
>>>> +
>>>> +    /** Default base prefix */
>>>> +    private static final String BASE_PREFIX_DEFAULT = "~/"; // $NON-NLS-1$
>>>> +
>>>> +    private static final String BASE_PREFIX =
>>>> +        JMeterUtils.getPropDefault("jmeter.save.saveservice.base_prefix",
// $NON-NLS-1$
>>>> +                BASE_PREFIX_DEFAULT);
>>>>
>>>>      //@GuardedBy("this")
>>>>      private File base;
>>>> @@ -345,4 +354,21 @@ public class FileServer {
>>>>              charSetEncoding=e;
>>>>          }
>>>>      }
>>>> +
>>>> +    /**
>>>> +     * Resolve a file name that may be relative to the base directory.
>>>> +     * If the name begins with the value of the JMeter property
>>>> +     * "jmeter.save.saveservice.base_prefix"
>>>> +     * - default "~/" - then the name is assumed to be relative to the
basename.
>>>> +     *
>>>> +     * @param relativeName
>>>> +     * @return the updated file
>>>> +     */
>>>> +    public static String resolveBaseRelativeName(String relativeName)
{
>>>> +        if (relativeName.startsWith(BASE_PREFIX)){
>>>> +            String newName = relativeName.substring(BASE_PREFIX.length());
>>>> +            return new File(getFileServer().getBaseDir(),newName).getAbsolutePath();
>>>> +        }
>>>> +        return relativeName;
>>>> +    }
>>>>  }
>>>>
>>>> Modified: jakarta/jmeter/trunk/xdocs/changes.xml
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/xdocs/changes.xml (original)
>>>> +++ jakarta/jmeter/trunk/xdocs/changes.xml Thu Oct 28 21:58:11 2010
>>>> @@ -128,6 +128,7 @@ To override the default local language f
>>>>  <ul>
>>>>  <li>View Results Tree - Add a dialog's text box on "Sampler result
tab > Parsed" to display the long value with a double click on cell</li>
>>>>  <li>Bug 37156 - Formatted view of Request in Results Tree</li>
>>>> +<li>Bug 49365 - Allow result set to be written to file in a path relative
to the loaded script</li>
>>>>  </ul>
>>>>
>>>>  <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
>>>>
>>>> Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
>>>> +++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Oct
28 21:58:11 2010
>>>> @@ -2197,7 +2197,13 @@ by using the -l command-line flag.
>>>>  <figure width="786" height="145" image="simpledatawriter.png">Result
file configuration panel</figure>
>>>>  </p>
>>>>  <properties>
>>>> -        <property name="File Name" required="No">Name of the file
containing sample results</property>
>>>> +        <property name="Filename" required="No">Name of the file
containing sample results.
>>>> +        The file name can be specified using either a relative or an
absolute path name.
>>>> +        Relative paths are resolved relative to the current working
directory (which defaults to the bin/ directory).
>>>> +        Versions of JMeter after 2.4 also support paths relative to
the directory containing the current test plan (JMX file).
>>>> +        If the path name begins with "~/" (or whatever is in the jmeter.save.saveservice.base_prefix
JMeter property),
>>>> +        then the path is assumed to be relative to the JMX file location.
>>>> +        </property>
>>>>          <property name="Browse..." required="No">File Browse
Button</property>
>>>>          <property name="Errors" required="No">Select this to
write/read only results with errors</property>
>>>>          <property name="Successes" required="No">Select this
to write/read only results without errors.
>>>> @@ -2625,7 +2631,12 @@ i.e. 30.0 requests/minute is saved as 0.
>>>>      </description>
>>>>   <properties>
>>>>   <property name="Name" required="No">Descriptive name for this element
that is shown in the tree.</property>
>>>> - <property name="Filename Prefix" required="Yes">Prefix for the generated
file names; this can include a directory name.</property>
>>>> + <property name="Filename Prefix" required="Yes">Prefix for the generated
file names; this can include a directory name.
>>>> +        Relative paths are resolved relative to the current working
directory (which defaults to the bin/ directory).
>>>> +        Versions of JMeter after 2.4 also support paths relative to
the directory containing the current test plan (JMX file).
>>>> +        If the path name begins with "~/" (or whatever is in the jmeter.save.saveservice.base_prefix
JMeter property),
>>>> +        then the path is assumed to be relative to the JMX file location.
>>>> + </property>
>>>>   <property name="Variable Name" required="No">
>>>>   Name of a variable in which to save the generated file name (so it can
be used later in the test plan).
>>>>   If there are sub-samples then a numeric suffix is added to the variable
name.
>>>>
>>>> Modified: jakarta/jmeter/trunk/xdocs/usermanual/listeners.xml
>>>> URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/listeners.xml?rev=1028515&r1=1028514&r2=1028515&view=diff
>>>> ==============================================================================
>>>> --- jakarta/jmeter/trunk/xdocs/usermanual/listeners.xml (original)
>>>> +++ jakarta/jmeter/trunk/xdocs/usermanual/listeners.xml Thu Oct 28 21:58:11
2010
>>>> @@ -48,7 +48,11 @@ write it as CSV or XML.
>>>>  CSV files are much smaller than XML files, so use CSV if you are generating
lots of samples.
>>>>  </p>
>>>>  <p>
>>>> -
>>>> +The file name can be specified using either a relative or an absolute path
name.
>>>> +Relative paths are resolved relative to the current working directory (which
defaults to the bin/ directory).
>>>> +Versions of JMeter after 2.4 also support paths relative to the directory
containing the current test plan (JMX file).
>>>> +If the path name begins with "~/" (or whatever is in the jmeter.save.saveservice.base_prefix
JMeter property),
>>>> +then the path is assumed to be relative to the JMX file location.
>>>>  </p>
>>>>  <p>
>>>>  If you only wish to record certain samples, add the Listener as a child
of the sampler.
>>>> @@ -176,6 +180,9 @@ sampleresult.timestamp.start=true
>>>>
>>>>  # Optional xml processing instruction for line 2 of the file:
>>>>  #jmeter.save.saveservice.xml_pi=&amp;lt;?xml-stylesheet type="text/xsl"
href="sample.xsl"?>
>>>> +
>>>> +# Prefix used to identify filenames that are relative to the current base
>>>> +#jmeter.save.saveservice.base_prefix=~/
>>>>  </pre>
>>>>  </code></p>
>>>>  <p>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: notifications-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: dev-help@jakarta.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: dev-help@jakarta.apache.org


Mime
View raw message