You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Michael Lück <mi...@lueckonline.net> on 2014/01/23 10:29:04 UTC

TestBeans incompatible with 2.10 when using TextAreaEditor

I just tried to open a Testplan in 2.10 that worked fine in JMeter 2.9.
The loading is interrupted by an NPE because 
org.apache.testbeans.gui.JSyntaxTextArea#setLanguage is called with null 
value.

I figured out the the custom plugin (based on TestBean) was missing to call

p.setValue(TEXT_LANGUAGE, "xml")

after creating a property with TypeEditor.TextAreaEditor.

I'd suppose to add a null check in the mentioned method and throw an 
IllegalArgumentException with a detailed error message, stating the the 
developer of the plugin needs to add a line like the above to it's 
BeanInfo class.

I would have done it already but wanted to ask if throwing an Exception 
in that case is wanted if it's better to log a warning and take the 
default (like in the case that the key isn't found in the 
textarea.properties)

Regards,
Michael


Re: TestBeans incompatible with 2.10 when using TextAreaEditor

Posted by Michael Lück <mi...@lueckonline.net>.
Looking into it ...

Am 23.01.2014 14:47, schrieb sebb:
> On 23 January 2014 09:29, Michael Lück <mi...@lueckonline.net> wrote:
>> I just tried to open a Testplan in 2.10 that worked fine in JMeter 2.9.
> Does it also fail in JMeter 2.11?
>
> If so, can you provide a simple test case as a Bugzilla attachment?
>
>> The loading is interrupted by an NPE because
>> org.apache.testbeans.gui.JSyntaxTextArea#setLanguage is called with null
>> value.
>>
>> I figured out the the custom plugin (based on TestBean) was missing to call
>>
>> p.setValue(TEXT_LANGUAGE, "xml")
>>
>> after creating a property with TypeEditor.TextAreaEditor.
>>
>> I'd suppose to add a null check in the mentioned method and throw an
>> IllegalArgumentException with a detailed error message, stating the the
>> developer of the plugin needs to add a line like the above to it's BeanInfo
>> class.
>>
>> I would have done it already but wanted to ask if throwing an Exception in
>> that case is wanted if it's better to log a warning and take the default
>> (like in the case that the key isn't found in the textarea.properties)
>>
>> Regards,
>> Michael
>>



Re: TestBeans incompatible with 2.10 when using TextAreaEditor

Posted by Michael Lück <mi...@lueckonline.net>.
Hi,

submitted bug 56059 containing potential patches and testcases for them 
(Junit Tests).
Hope that is what you had in mind as a testcase.

Michael

Am 23.01.2014 14:47, schrieb sebb:
> On 23 January 2014 09:29, Michael Lück <mi...@lueckonline.net> wrote:
>> I just tried to open a Testplan in 2.10 that worked fine in JMeter 2.9.
> Does it also fail in JMeter 2.11?
>
> If so, can you provide a simple test case as a Bugzilla attachment?
>
>> The loading is interrupted by an NPE because
>> org.apache.testbeans.gui.JSyntaxTextArea#setLanguage is called with null
>> value.
>>
>> I figured out the the custom plugin (based on TestBean) was missing to call
>>
>> p.setValue(TEXT_LANGUAGE, "xml")
>>
>> after creating a property with TypeEditor.TextAreaEditor.
>>
>> I'd suppose to add a null check in the mentioned method and throw an
>> IllegalArgumentException with a detailed error message, stating the the
>> developer of the plugin needs to add a line like the above to it's BeanInfo
>> class.
>>
>> I would have done it already but wanted to ask if throwing an Exception in
>> that case is wanted if it's better to log a warning and take the default
>> (like in the case that the key isn't found in the textarea.properties)
>>
>> Regards,
>> Michael
>>



Re: TestBeans incompatible with 2.10 when using TextAreaEditor

Posted by sebb <se...@gmail.com>.
On 23 January 2014 09:29, Michael Lück <mi...@lueckonline.net> wrote:
> I just tried to open a Testplan in 2.10 that worked fine in JMeter 2.9.

Does it also fail in JMeter 2.11?

If so, can you provide a simple test case as a Bugzilla attachment?

> The loading is interrupted by an NPE because
> org.apache.testbeans.gui.JSyntaxTextArea#setLanguage is called with null
> value.
>
> I figured out the the custom plugin (based on TestBean) was missing to call
>
> p.setValue(TEXT_LANGUAGE, "xml")
>
> after creating a property with TypeEditor.TextAreaEditor.
>
> I'd suppose to add a null check in the mentioned method and throw an
> IllegalArgumentException with a detailed error message, stating the the
> developer of the plugin needs to add a line like the above to it's BeanInfo
> class.
>
> I would have done it already but wanted to ask if throwing an Exception in
> that case is wanted if it's better to log a warning and take the default
> (like in the case that the key isn't found in the textarea.properties)
>
> Regards,
> Michael
>