You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Andrey Pokhilko <ap...@ya.ru> on 2015/05/14 18:34:10 UTC

HTTP Sampler to use FileServer

Hi,

Through my investigations of file uploads in JMeter I found that Post
Files do not use FileServer, thus unable to work correctly with paths
relative to JMX location. Or maybe I misunderstand the functionality of
FileServer. But it states in the class doc:

For instance, putting supporting files in the same directory as
* the saved test plan file allows users to refer to the file with just it's
* name - this FileServer class will find the file without a problem.

I see good value in this feature of paths relative to JMX location.
Otherwise it is quite painful to operate test plans with resource files.
One more thing is that CSV Data Set works fine because it uses
FileServer, so we're inconsistent: one component works with files in one
way, another works other way...

My questions:

 1. Is there intentional reason not to use FileServer in HTTP Sampler?
 2. Or should I implement usage for it?

-- 
Andrey Pokhilko


Re: HTTP Sampler to use FileServer

Posted by Andrey Pokhilko <ap...@ya.ru>.
Ok, I treat your words as "Yes, implement it". Will do it in a free minute.

Andrey Pokhilko

On 05/14/2015 07:55 PM, sebb wrote:
> On 14 May 2015 at 17:34, Andrey Pokhilko <ap...@ya.ru> wrote:
>> Hi,
>>
>> Through my investigations of file uploads in JMeter I found that Post
>> Files do not use FileServer, thus unable to work correctly with paths
>> relative to JMX location. Or maybe I misunderstand the functionality of
>> FileServer. But it states in the class doc:
>>
>> For instance, putting supporting files in the same directory as
>> * the saved test plan file allows users to refer to the file with just it's
>> * name - this FileServer class will find the file without a problem.
>>
>> I see good value in this feature of paths relative to JMX location.
>> Otherwise it is quite painful to operate test plans with resource files.
>> One more thing is that CSV Data Set works fine because it uses
>> FileServer, so we're inconsistent: one component works with files in one
>> way, another works other way...
>>
>> My questions:
>>
>>  1. Is there intentional reason not to use FileServer in HTTP Sampler?
> The FileServer class was originally designed for JMeter-specific
> files, rather than data files used by samplers.
> This is why it was not used for HTTP POST files.
>
>>  2. Or should I implement usage for it?
> Having said that, I suppose it might be useful to use it for such
> files, so long as the default behaviour is consistent.
> I.e. JMeter must continue to check the current location first. If the
> file is not found, then it could check other locations.
>
> This will be a behavioural change, so should be carefully noted in the docs.
> However I don't think it will change the output of a test unless the
> new code finds a file where the old code did not, AND it was
> intentional not to find the file.
> This seems an unlikely scenario to want to test - it is a test of
> JMeter rather than of any server.
>
>> --
>> Andrey Pokhilko
>>


Re: HTTP Sampler to use FileServer

Posted by Andrey Pokhilko <ap...@ya.ru>.
Thanks for reviewing, committed revision 1683328

Andrey Pokhilko

On 06/02/2015 10:52 PM, Philippe Mouawad wrote:
> thanks, look ok to me, except for missing javadocs and comments.
>
> Regards
> Philippe
>
> On Tue, Jun 2, 2015 at 3:20 PM, Andrey Pokhilko <ap...@ya.ru> wrote:
>
>> I have prepared the changes, please review it and let me know if it is
>> ok to commit it into svn:
>>
>> https://github.com/apache/jmeter/pull/23/files
>>
>> Andrey Pokhilko
>>
>> On 05/14/2015 07:55 PM, sebb wrote:
>>> On 14 May 2015 at 17:34, Andrey Pokhilko <ap...@ya.ru> wrote:
>>>> Hi,
>>>>
>>>> Through my investigations of file uploads in JMeter I found that Post
>>>> Files do not use FileServer, thus unable to work correctly with paths
>>>> relative to JMX location. Or maybe I misunderstand the functionality of
>>>> FileServer. But it states in the class doc:
>>>>
>>>> For instance, putting supporting files in the same directory as
>>>> * the saved test plan file allows users to refer to the file with just
>> it's
>>>> * name - this FileServer class will find the file without a problem.
>>>>
>>>> I see good value in this feature of paths relative to JMX location.
>>>> Otherwise it is quite painful to operate test plans with resource files.
>>>> One more thing is that CSV Data Set works fine because it uses
>>>> FileServer, so we're inconsistent: one component works with files in one
>>>> way, another works other way...
>>>>
>>>> My questions:
>>>>
>>>>  1. Is there intentional reason not to use FileServer in HTTP Sampler?
>>> The FileServer class was originally designed for JMeter-specific
>>> files, rather than data files used by samplers.
>>> This is why it was not used for HTTP POST files.
>>>
>>>>  2. Or should I implement usage for it?
>>> Having said that, I suppose it might be useful to use it for such
>>> files, so long as the default behaviour is consistent.
>>> I.e. JMeter must continue to check the current location first. If the
>>> file is not found, then it could check other locations.
>>>
>>> This will be a behavioural change, so should be carefully noted in the
>> docs.
>>> However I don't think it will change the output of a test unless the
>>> new code finds a file where the old code did not, AND it was
>>> intentional not to find the file.
>>> This seems an unlikely scenario to want to test - it is a test of
>>> JMeter rather than of any server.
>>>
>>>> --
>>>> Andrey Pokhilko
>>>>
>>
>


Re: HTTP Sampler to use FileServer

Posted by Philippe Mouawad <ph...@gmail.com>.
thanks, look ok to me, except for missing javadocs and comments.

Regards
Philippe

On Tue, Jun 2, 2015 at 3:20 PM, Andrey Pokhilko <ap...@ya.ru> wrote:

> I have prepared the changes, please review it and let me know if it is
> ok to commit it into svn:
>
> https://github.com/apache/jmeter/pull/23/files
>
> Andrey Pokhilko
>
> On 05/14/2015 07:55 PM, sebb wrote:
> > On 14 May 2015 at 17:34, Andrey Pokhilko <ap...@ya.ru> wrote:
> >> Hi,
> >>
> >> Through my investigations of file uploads in JMeter I found that Post
> >> Files do not use FileServer, thus unable to work correctly with paths
> >> relative to JMX location. Or maybe I misunderstand the functionality of
> >> FileServer. But it states in the class doc:
> >>
> >> For instance, putting supporting files in the same directory as
> >> * the saved test plan file allows users to refer to the file with just
> it's
> >> * name - this FileServer class will find the file without a problem.
> >>
> >> I see good value in this feature of paths relative to JMX location.
> >> Otherwise it is quite painful to operate test plans with resource files.
> >> One more thing is that CSV Data Set works fine because it uses
> >> FileServer, so we're inconsistent: one component works with files in one
> >> way, another works other way...
> >>
> >> My questions:
> >>
> >>  1. Is there intentional reason not to use FileServer in HTTP Sampler?
> > The FileServer class was originally designed for JMeter-specific
> > files, rather than data files used by samplers.
> > This is why it was not used for HTTP POST files.
> >
> >>  2. Or should I implement usage for it?
> > Having said that, I suppose it might be useful to use it for such
> > files, so long as the default behaviour is consistent.
> > I.e. JMeter must continue to check the current location first. If the
> > file is not found, then it could check other locations.
> >
> > This will be a behavioural change, so should be carefully noted in the
> docs.
> > However I don't think it will change the output of a test unless the
> > new code finds a file where the old code did not, AND it was
> > intentional not to find the file.
> > This seems an unlikely scenario to want to test - it is a test of
> > JMeter rather than of any server.
> >
> >> --
> >> Andrey Pokhilko
> >>
>
>


-- 
Cordialement.
Philippe Mouawad.

Re: HTTP Sampler to use FileServer

Posted by Andrey Pokhilko <ap...@ya.ru>.
I have prepared the changes, please review it and let me know if it is
ok to commit it into svn:

https://github.com/apache/jmeter/pull/23/files

Andrey Pokhilko

On 05/14/2015 07:55 PM, sebb wrote:
> On 14 May 2015 at 17:34, Andrey Pokhilko <ap...@ya.ru> wrote:
>> Hi,
>>
>> Through my investigations of file uploads in JMeter I found that Post
>> Files do not use FileServer, thus unable to work correctly with paths
>> relative to JMX location. Or maybe I misunderstand the functionality of
>> FileServer. But it states in the class doc:
>>
>> For instance, putting supporting files in the same directory as
>> * the saved test plan file allows users to refer to the file with just it's
>> * name - this FileServer class will find the file without a problem.
>>
>> I see good value in this feature of paths relative to JMX location.
>> Otherwise it is quite painful to operate test plans with resource files.
>> One more thing is that CSV Data Set works fine because it uses
>> FileServer, so we're inconsistent: one component works with files in one
>> way, another works other way...
>>
>> My questions:
>>
>>  1. Is there intentional reason not to use FileServer in HTTP Sampler?
> The FileServer class was originally designed for JMeter-specific
> files, rather than data files used by samplers.
> This is why it was not used for HTTP POST files.
>
>>  2. Or should I implement usage for it?
> Having said that, I suppose it might be useful to use it for such
> files, so long as the default behaviour is consistent.
> I.e. JMeter must continue to check the current location first. If the
> file is not found, then it could check other locations.
>
> This will be a behavioural change, so should be carefully noted in the docs.
> However I don't think it will change the output of a test unless the
> new code finds a file where the old code did not, AND it was
> intentional not to find the file.
> This seems an unlikely scenario to want to test - it is a test of
> JMeter rather than of any server.
>
>> --
>> Andrey Pokhilko
>>


Re: HTTP Sampler to use FileServer

Posted by sebb <se...@gmail.com>.
On 14 May 2015 at 17:34, Andrey Pokhilko <ap...@ya.ru> wrote:
> Hi,
>
> Through my investigations of file uploads in JMeter I found that Post
> Files do not use FileServer, thus unable to work correctly with paths
> relative to JMX location. Or maybe I misunderstand the functionality of
> FileServer. But it states in the class doc:
>
> For instance, putting supporting files in the same directory as
> * the saved test plan file allows users to refer to the file with just it's
> * name - this FileServer class will find the file without a problem.
>
> I see good value in this feature of paths relative to JMX location.
> Otherwise it is quite painful to operate test plans with resource files.
> One more thing is that CSV Data Set works fine because it uses
> FileServer, so we're inconsistent: one component works with files in one
> way, another works other way...
>
> My questions:
>
>  1. Is there intentional reason not to use FileServer in HTTP Sampler?

The FileServer class was originally designed for JMeter-specific
files, rather than data files used by samplers.
This is why it was not used for HTTP POST files.

>  2. Or should I implement usage for it?

Having said that, I suppose it might be useful to use it for such
files, so long as the default behaviour is consistent.
I.e. JMeter must continue to check the current location first. If the
file is not found, then it could check other locations.

This will be a behavioural change, so should be carefully noted in the docs.
However I don't think it will change the output of a test unless the
new code finds a file where the old code did not, AND it was
intentional not to find the file.
This seems an unlikely scenario to want to test - it is a test of
JMeter rather than of any server.

> --
> Andrey Pokhilko
>