You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ivelin Ivanov <iv...@apache.org> on 2002/05/26 20:09:05 UTC
Anteater tests
I would like to add a few more test cases to the anteater-tests target for
Cocoon 2.1.
Very similar to the tests Ovidiu wrote for the flow calc
xml-cocoon2\src\test\anteater.
My tests will simulate user paths through the XMLForm demo.
Everything seems pretty straightforward, but
the one thing I need to know is how to initiate a session and carry it over
consequitive steps.
Thanks,
Ivelin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Anteater session support (Re: Anteater tests)
Posted by Ivelin Ivanov <iv...@apache.org>.
Another question.
Does anteater support alternative scenarios for test cases.
Something based on the cocoon flow continuations concept.
For example can I write a login step and then continue with two independent
alternative paths. First one will go through one set of pages then the
second. At the end they will both logout. I would be interested in reusing
the login and logout steps, but these two test cases should run
independently of each other.
I would expect Anteater to first login, go through the first path, logout,
then login again, go through the second path, logout.
I think Anteater discussions should be on Cocoon's list, since automated
functional testing is a very key subject and Cocoon doesn't have a better
solution at the moment. Commercial web app testing tools cost tens,
sometimes hundreds of thousands.
Thanks for the help.
Ivelin
----- Original Message -----
From: "Jeff Turner" <je...@socialchange.net.au>
To: "Ivelin Ivanov" <iv...@apache.org>
Cc: <af...@lists.sourceforge.net>
Sent: Sunday, May 26, 2002 6:21 PM
Subject: Anteater session support (Re: Anteater tests)
> On Sun, May 26, 2002 at 01:09:05PM -0500, Ivelin Ivanov wrote:
> >
> > I would like to add a few more test cases to the anteater-tests target
for
> > Cocoon 2.1.
> >
> > Very similar to the tests Ovidiu wrote for the flow calc
> > xml-cocoon2\src\test\anteater.
> > My tests will simulate user paths through the XMLForm demo.
> >
> > Everything seems pretty straightforward, but the one thing I need to
> > know is how to initiate a session and carry it over consequitive
> > steps.
>
> I don't think that's possible right now without a custom task. It's
> *almost* possible to emulate a session, eg you can capture the cookie:
>
> <match>
> <header name="Set-Cookie" assign="cookie"/>
> </match>
> <echo>cookie is ${cookie}</echo>
>
> which prints:
>
> cookie is JSESSIONID=D37674C597C550D5E598740310A63695;Path=/cocoon
>
>
> And you can set cookies:
>
> <httpRequest ...>
> <header name="cookie"
value="JSESSIONID=22C663C2A4C77751B1560328D2D5E2F1/>
> ...
> </httpRequest>
>
>
> But I can't see an easy way to strip off that ';Path=..' bit at the end :(
>
> That, and problems with Tomcat4's chunked encoding[1] mean we really
> need to adopt a full-featured http client library. Ideally, I'd like to
> steal Latka's http abstraction layer, and then we can slot httpclient or
> whatever in underneath. Reusing Latka's layer would also make reusing
> validators/matchers across projects a lot easier.
>
>
> --Jeff
>
> [1]
>
http://sourceforge.net/tracker/index.php?func=detail&aid=547890&group_id=429
70&atid=434732
>
> > Thanks,
> >
> >
> > Ivelin
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Anteater session support (Re: Anteater tests)
Posted by Ovidiu Predescu <ov...@cup.hp.com>.
On 6/7/02 3:49 AM, "Ivelin Ivanov" <iv...@apache.org> wrote:
>> But I can't see an easy way to strip off that ';Path=..' bit at the end :(
>>
>> That, and problems with Tomcat4's chunked encoding[1] mean we really
>> need to adopt a full-featured http client library. Ideally, I'd like to
>> steal Latka's http abstraction layer, and then we can slot httpclient or
>> whatever in underneath. Reusing Latka's layer would also make reusing
>> validators/matchers across projects a lot easier.
>
> Have any progress been achieved in this direction?
> Maybe Anteater should seek help in its place of birth, the Cocoon community.
>
> Another big feature would be generating ant/JUnit compatible reports.
> This will stimulate writing complete test suites.
Unless Jeff worked on this in the meantime, this is not yet implemented.
This is the next thing on my list of features to implement.
Ovidiu
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Anteater session support (Re: Anteater tests)
Posted by Ovidiu Predescu <ov...@cup.hp.com>.
On 6/7/02 3:49 AM, "Ivelin Ivanov" <iv...@apache.org> wrote:
> Another big feature would be generating ant/JUnit compatible reports.
> This will stimulate writing complete test suites.
I think Jeff was looking at how to report test results in different formats.
Jeff, do you have an update on this?
Greetings,
--
Ovidiu Predescu <ov...@cup.hp.com>
http://www.geocities.com/SiliconValley/Monitor/7464/ (Apache, GNU, Emacs...)
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Anteater session support (Re: Anteater tests)
Posted by Ivelin Ivanov <iv...@apache.org>.
----- Original Message -----
From: "Jeff Turner" <je...@socialchange.net.au>
To: "Ivelin Ivanov" <iv...@apache.org>
Cc: <af...@lists.sourceforge.net>
Sent: Sunday, May 26, 2002 6:21 PM
Subject: Anteater session support (Re: Anteater tests)
>
> I don't think that's possible right now without a custom task. It's
> *almost* possible to emulate a session, eg you can capture the cookie:
>
> <match>
> <header name="Set-Cookie" assign="cookie"/>
> </match>
> <echo>cookie is ${cookie}</echo>
>
> which prints:
>
> cookie is JSESSIONID=D37674C597C550D5E598740310A63695;Path=/cocoon
>
>
> And you can set cookies:
>
> <httpRequest ...>
> <header name="cookie"
value="JSESSIONID=22C663C2A4C77751B1560328D2D5E2F1/>
> ...
> </httpRequest>
>
>
> But I can't see an easy way to strip off that ';Path=..' bit at the end :(
>
> That, and problems with Tomcat4's chunked encoding[1] mean we really
> need to adopt a full-featured http client library. Ideally, I'd like to
> steal Latka's http abstraction layer, and then we can slot httpclient or
> whatever in underneath. Reusing Latka's layer would also make reusing
> validators/matchers across projects a lot easier.
Have any progress been achieved in this direction?
Maybe Anteater should seek help in its place of birth, the Cocoon community.
Another big feature would be generating ant/JUnit compatible reports.
This will stimulate writing complete test suites.
Ivelin
>
>
> --Jeff
>
> [1]
>
http://sourceforge.net/tracker/index.php?func=detail&aid=547890&group_id=429
70&atid=434732
>
> > Thanks,
> >
> >
> > Ivelin
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Anteater session support (Re: Anteater tests)
Posted by Ivelin Ivanov <iv...@apache.org>.
Great to know that you're cracking away JUinit reporting and session
support.
As far as a new HttpClient is concerned, I can care less if session
support is implemented.
I looked at Anteater code and was surprised how simple and small it is,
yet the scripts can be quite flexible.
The power of code *reuse*.
I am looking at Schematron integration for better error reporting.
Please let me know your thoughts on how to integrate violation list in
the JUnit reports (see my previous message on the subject).
Actually if JUnit report integration is too hard, you could look at the
Canoo WebTest reporting. It is also ant based and might be easier to
integrate with.
Ivelin
PS: If the rest of the Cocoon people think this thread is OT, let me
know. Since Cocoon doesn't have a functional testing framework itself,
I find Anteater as an important component.
Jeff Turner wrote:
> On Tue, Jun 11, 2002 at 11:40:24PM -0500, Ivelin Ivanov wrote:
>
>>Jeff,
>>
>>Do you have any fresh ideas/code on session support.
>>Latka's <session> tag is nice.
>>How hard would it be to do this for Anteater?
>>Is it just about receiving and resending cookies.
>
>
> I'll take a break from JUnit formatting (taking longer than I thought),
> and have a play tonight. It shouldn't be too hard at all. Just a Session
> 'DataType' object shared among HttpRequest objects, eg:
>
> <project name="Anteater">
> <session id="mySession"/>
> <target name="test1">
> <http>
> <httpRequest ....>
> <session refid="mySession"/>
> </httpRequest>
> <httpRequest ....>
> <session refid="mySession"/>
> </httpRequest>
> ...
> </http>
> </target>
> </project>
>
>>Ovidiu mentioned possibly using another HttpClient lib, that will make
>>session support easier. Did you guys decide on this?
>
>
> Well, the 'correct' way to fix the problem is to turf out Ovidiu's
> lovingly handcrafted HttpMessage class ;) and write an Ant interface to
> HttpClient (either Commons' or the innovation.ch one). This would also
> allow Anteater to test Tomcat4-hosted apps (see bug
> http://sourceforge.net/tracker/index.php?func=detail&aid=547890&group_id=42970&atid=434732).
>
> Big change though. A HttpClient-Ant interface would be a project in it's
> own right. Probably can be done post-1.0 for Anteater.
>
>
> --Jeff
>
>
>>Ivelin
>
>
--
-= Ivelin =-
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org