Thanks Tim, I did mean WebTest. I have been working with it lately.

I have found that it is useful to put "milestone" code in my main action
method that checks a passed in parameter (testLevel) to see if it is
supposed to be at the current level. If it is, then it records some data in
a map to be returned. That map is used to populate a form that is used in a
WebTest script to do verification.

It also checks to see if it is to exit at that level and, if so, it rolls
back the transaction that was started at the beginning.

In a sense, this is akin to putting "if(Debug.isInfo()) Debug... "
statements along the way. It is not pretty, but it allows me to test the
actual production code by putting a parameter, "testLevel", in the url. I
can even choose whether to keep the transactions by adding another
parameter, "returnVal", which would be either "error" or "success".

If this sort of approach has any merit, then I wonder if there would not be
value in building something into OFBiz to make it unnecessary to implant
your own transaction statements? Something like a custom ControlFilter that
would automatically rollback the transaction. That seems like it would be a
lot easier then crafting a DbUnit script to do the rollback.

And if that works, then why not have it save transactions objects and reuse
them across multiple requests so all the data can be rolled back?

-Al

On 1/29/07, Tim Ruppert <[EMAIL PROTECTED]> wrote:

Al, I'm assuming that you meant WebTest instead of webtools there, but
nonetheless - we _could_ use something like DbUnit for this.  It could be a
HUGE dataset to get going to put things back together, but it can totally be
done and is perfect for this type of concern.
Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595


On Jan 29, 2007, at 5:18 AM, Al Byers wrote:

I hate to dumb things down, but I have a basic question. Is it true that
web-based testing (I am thinking WebTools or Selenium) are not able to
roll
back test by rolling back the transaction in the way that a JUnit test
could?

If that is true, is this an area where we might be able to do something
special for OFBiz to get around that problem?

-Al




Reply via email to