Sorry, our mail server apparently scrubbed the attachment. Here's the
patch:
---
c:/temp/jakarta-jmeter-2.3.4/src/core/org/apache/jmeter/threads/TestComp
iler.java 2009-06-17 08:29:33.000000000 -0700
+++ src/core/org/apache/jmeter/threads/TestCompiler.java
2009-07-24 08:54:12.476896400 -0700
@@ -264,6 +264,7 @@
Iterator iter = configs.iterator();
while (iter.hasNext()) {
ConfigTestElement config = (ConfigTestElement) iter.next();
+ TestBeanHelper.prepare(config);
sam.addTestElement(config);
}
}
-----Original Message-----
From: Donohue, Jack
Sent: Friday, July 24, 2009 9:11 AM
To: [email protected]
Subject: Possible bug? ConfigElements implementing TestBean: setters not
called
I initially posted this problem to the users list, but after a little
more digging I think this is a bug. I'm new to JMeter so please correct
me if I'm wrong :-)
To reproduce, deploy the following simple ConfigElement implementing
TestBean. The "setServer" method is never called on the element itself.
After a little digging, I believe the problem is that
TestBeanHelper.prepare(element) is never called on any config elements.
TestBeanHelper.prepare() seems to get called on every other kind of test
element (samplers, etc.), but not config elements.
Attached is a proposed patch to ensure that TestBeanHelper.prepare() is
also called for all ConfigElements. I'm not certain this is the right
place to do this, but it seems roughly consistent with how it is called
for other element types.
<code>
public class MyConfig extends ConfigTestElement implements TestBean {
private String server = null;
public String getServer() {
// this is never called
return server;
}
public void setServer(String val) {
// this is never called
server = val;
}
}
public class MyConfigBeanInfo extends BeanInfoSupport {
Logger log = LoggingManager.getLoggerForClass();
public MyConfigBeanInfo() {
super(MyConfig.class);
PropertyDescriptor p = property("server");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "localhost");
}
}
</code>
--
THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED
SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN
CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE
ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS
MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE
THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE THIS
MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM.
--
THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR
THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL,
PROPRIETARY OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE ADDRESSEE INDICATED
IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON)
YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES
TRANSMITTED HEREWITH. IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT THE
SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR
SYSTEM.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]