[Webtest] Re: Resetting between test runs

Healey, Thomas webtest@lists.canoo.com
Thu, 8 May 2003 08:30:21 -0400


Where is the configuration parameter example, so that I can turn this
behaviour off if I want to?

Tom Healey
Darden Information Systems
HealeyT@darden.virginia.edu
434.924.0562



-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Jeff Nielsen
Sent: Wednesday, May 07, 2003 6:33 AM
To: webtest@gate.canoo.com
Subject: Re: [Webtest] Re: Resetting between test runs


I altered WebTest so that it would set a property with the failure
message when a test failed, but still continue on with the ant build.
This was because I had tasks I *always* wanted to run after the
tests--the "finally" behavior you allude to.  Using this failure
property, I can perform my cleanup tasks (other ant tasks) and then
determine afterward whether a test has failed.

I added this code to
com.canoo.webtest.ant.TestSpecificationTask.execute()

.        String failure =3D
PlainTextReporter.getBuildFailMessage(webTestResult);
.        if ((webTestResult.isError() || webTestResult.isFailure())
.                && fConfig.getFailureProperty() !=3D null) {
.            project.setProperty(fConfig.getFailureProperty(), failure);
.        }


and this code to com.canoo.webtest.engine.Configuration

.    private String fFailureProperty;
.    public String getFailureProperty() { return fFailureProperty; }
.    public void setFailureProperty(String propertyName) {
.        fFailureProperty =3D propertyName;
.    }




----- Original Message -----
From: "Brian O'Kelley" <brian@poindextersystems.com>
To: <webtest@gate.canoo.com>
Sent: Monday, May 05, 2003 3:36 PM
Subject: [Webtest] Re: Resetting between test runs


> In partial answer to my own question - here's what I did:
>
> I created a new action on my web application (I'm using struts, so I=20
> probably should say Action) that does the database resetting that I=20
> need.
>
> I call this before and after the critical tasks. This mitigates the=20
> need
to
> call Java classes or access the database directly.
>
> Now - how can I get catch/finally behavior from this?
>
> Brian
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com=20
> http://lists.canoo.com/mailman/listinfo/webtest