I finally got everything setup to be able to commit my updates to cvs. I wanted to take a second and document some of the changes that I've made and throw out some of the changes that Mike and I are talking about.
One of the two things that I commited today is the ability to embed functions, which is relying heavily on CompoundFunction and AbstractFunction. Right now, when a function's setParameters method is called, it passes the entire string of encoded parameters to AbstractFunction.parseArguments. I created a parseArguments2 function which instead of returning a collection of strings, returns a collection of CompoundFunctions. Since CompoundFunction essentially builds functions (calling their setParameters method) we have instant recursion. Eventually, I'm going to deprecate the setParameters(String) method of function in exchange for a setParameters(Collection) method and allow CompoundFunction to take care of setting up the recursion. I've also added a no-arg execute() method to CompoundFunction, which is what is used to convert the CompoundFunction to a string when the top-level function's execute(SampleResult,Sampler) method is called. This is possible because I've added two new classes to org.apache.jmeter.threads: JMeterContext and JMeterContextService. JMeterContext essentially represents the current runtime information for the current thread that any object could need. Right now, it contains the thread's JMeterVariables, current Sampler, and previous SampleResults. JMeterContextService is a singleton class that gives out the current threads JMeterContext to any object that needs this information at a particular instance in time (i.e. a function that is embedded in another function). I'm in favor of adding this no-arg execute() method to function and give it an implementation in AbstractFunction. BTW...I've updated all of the standard functions to use these changes. I've tested them all, and they work great. My vision for JMeterContext is that we'll be able to remove a TestElement's dependancy on being setup by the TestCompiler and have the current Sampler, and other information that might not be necessary (and usually aren't) from being passed around. More information can be added to JMeterContext as needed, such as how long the thread's been running, etc. Furthermore, JMeterContextService can be molded to provide variable scoping to a test-element. Meaning that if a threadgroup has a user variables object that sets i to 3. If a controller that is a decendant of the thread-group overrides i, it only does so for the elements that are it's own children, or at-least allows the user to specify if the variable is global or local. The other thing I've added is the ModuleController. You're all probably aware that I was adding this, but if you don't know what it is, the idea extends the notion that a controller doesn't just provide logic to a test execution, but also gives a means to group requests into common functions(i.e. Login, Create Account, etc.) In load testing, these "modules" can be stored as controllers under the workbench and have all of the specifics of the request stripped away in favor of configuring them at runtime. The ModuleController can then be pointed to any of these modules and let the user configure them by attaching config elements, timers to the ModuleController itself. ModuleController places the controller it points to in it's own place and places the controllers subtree into the execution tree at compile time. We'll be using this pretty heavily at IBM, especially since I'm the only one in our test organization that really understands the product. I'll get all of this info (minus my ramblings about new ideas) in the docs when I figure out how to get to the docs (Are they in CVS?) Any questions? Thad __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
