----- Original Message ----- From: "Jordi Salvat i Alabart" <[EMAIL PROTECTED]> To: "JMeter Developers List" <[EMAIL PROTECTED]> Sent: Friday, January 02, 2004 12:51 AM Subject: TestBeans: proof of concept
> How to try: > > - Check out branch testbeans_experimental_branch > - Build & run > - Right-click on Workbench -> Add -> Sampler -> HTTPSamplerBean > - See the automatically-generated GUI. OK, this seems to work, except that "runningVersion" should not appear in the GUI. (perhaps others as well?) - don't know if this affects the design or not. Also, the field names will need to become resources - I guess this will be easy enough. Some tidying up to do, e.g. some fields should be check-boxes (and I think we'll need radio buttons elsewhere). Would be nice to align input fields. Need to allow for multiple input fields on a single line, and logical grouping of fields. Would this be difficult? > > The component probably doesn't work. Of course I'll need to fix this > before declaring the proof-of-concept complete. > I would add that being able to replicate the existing GUI layout (more or less) is also necessary. > Understanding the thing: > > To start with, forget about all the changes in the core packages for the > time being. Let's focus in the HTTPSamplerBean class, which is a port to > the new concept of the HTTPSampler class in the > Root_testbeans_experimental_branch version. > > HTTPSamplerBean is exactly the same as the HTTPSampler except that: > > - It longer uses those JMeterProperties, but regular, familiar Java Bean > properties instead. > > - It subclasses TestBean and implements Sampler instead of subclassing > AbstractSampler. It would be trivial to create an AbstractSamplerBean > class to play the role of the AbstractSampler. > > - sample() now calls "prepare()" first thing. This is important, but my > idea is to change the engine to do this call. [Or I could have > sample(Entry) call it in the above-mentioned AbstractSamplerBean, which > would declare sample(Entry) final and sample() abstract.] > > I don't think I've done any other relevant changes (well, I've tried not > to). The JMeterProperty keys have been removed - I think they will need to be retained so that old JMX files can be converted, at least. Could perhaps extend the upgrade.properties file processing to handle this? > > The resulting class is obviously simpler than the original HTTPSampler, > but really not that much. The obvious advantage is in the GUI classes. Yes - the current design makes for very tedious coding, and it is easy to do things in the GUI class by mistake that need to be done for non-GUI mode as well. But it does offer complete control over GUI layout. I've little or no experience of Beans, so I don't know how easy it will be to customise the GUI layouts. However, I do think the GUI needs to be customisable. Is there a danger that the new GUI classes will then become very complicated? Should we be looking at a GUI design language ? For example, XUL - http://www.mozilla.org/xpfe/xptoolkit/index.html - not sure if that is suitable for our purposes as it stands. > > The GUI is based in two classes only: HTTPSamplerBeanBeanInfo (4 lines > of code) and HTTPArgumentsEditor (3 lines). They are necessary because > the HTTPSampler is a particularly complex test element, in that its GUI > has an embedded ArgumentsPanel, that is: the GUI for another test > element is embedded here. I chose it precisely because of this > complexity: I wanted to prove that the two approaches (old-style > testelements and TestBeans) can interoperate fully. The GUI classes are now in the same directory as the sampler, whereas previously they were in a separate gui/ directory. I prefer retaining a separate directory. > > The BeanInfo class will grow significantly larger before the > proof-of-concept is complete, but I wanted you to have a look at this > when it's still this simple -- it's a good example for what a developer > prototyping a new component will need to do. > > About the additions I've done in the core packages, feel free to have a > look, but I don't think it's that important now. The bits that are not > about handling the GUI are about maintaining compatibility with the > current approach. For example, TestBean is now a subclass of > TestElement, but it doesn't really need to be in the future: we will be > able to keep the bean and it's "description" (the propertie's values or > expressions to be used to compute them) separate. > > Constructive and destructive comments welcome. > Well done for tackling the GUI set-up complications! But I'm a bit concerned that quite a lot of work has gone into the current GUI design over the years. It's not perfect, but I think it is generally well laid out, and it would be confusing if all the layouts changed drastically. Other points: - I suggest deprecating wrapInProperty() and unwrapProperty() to discourage use - need to ensure that batch (non-gui) mode still works - ditto for client-server mode, which reminds me: In the next few days, I'm intending to try implementing RMI serialisation by using the external (XML) representation of the test plan, instead of serialising all the test element objects. This should reduce the data volumes sent across, as well as simplifying a lot of classes (no need to worry about implementing serializable). Don't know if this will affect your bean work. Sebastian --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
