cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@cup.hp.com>
Subject Re: AntEater: a functional testing framework for HTTP/SOAP apps
Date Fri, 05 Oct 2001 18:48:29 GMT
On Sat, 6 Oct 2001 00:07:52 +1000, Jeff Turner <jeff@socialchange.net.au> wrote:

> Specific comments:
> 
> Going through Anteater.txt, I couldn't find any way to provide an
> error message if the test failed. How about adding a <failMessage>
> block, to say what it means when the test fails? Does <comment>
> fulfil this role?

Yes, comment is used to tell you which task produced the problem.

> Also, how about using the standard "description" attribute instead
> of <comment>? In Ant 1.4, "description" can be attached to just
> about everything, and has rather become a standard.

Yep, good idea! I used <comment> as it was already in use by Tomcat's
httpClient. I'll switch to <description>.

> Likewise to keep with Ant naming conventions, "assign" could be
> "id", and "href" become "refid".

Actually there's a slight difference between "assign" and
"id". Traditionally "id" is used in XML to denote a unique
element. With "assign" you can assign a value to an Ant property
multiple times from multiple places. If "id" is used for this, we'll
have multiple elements whose "id" attribute is the same.

Also "href" is used to denote an HTTP URL, not an Ant reference. I do
plan to use "refid" however to refer to other elements defined in the
XML file.

> I saw a few references to namespace-scoped elements there ("soap:"),
> but no namespace declarations. Are namespaces ignored?

Yes, namespaces are ignored by the current Ant as it still uses the
old SAX1 API.

> I was thinking.. you currently have a <http> task. Would it be easy
> to add a <file> task, so that validations can be applied to things
> like sitemap.xmap, cocoon.xconf, or a site's web.xml? That would
> allow elimination of misconfigurations as a source of apparent
> failures. For example, to ensure that the Cocoon servlet is
> registered:
> 
> <file path="build/cocoon/webapp/WEB-INF/web.xml">
>   <match>
>     <xpath select="web-app/servlet/servlet-class"
>     value="org.apache.cocoon.servlet.CocoonServlet"/>
>   </match>
> </file>
> 
> And to ensure that the sitemap is present and contains a mapping for
> /index.html:
> 
> <file path="build/cocoon/webapp/sitemap.xmap">
>   <match>
>     <xpath select="map:sitemap/map:pipeline/map:match[pattern='hello.html']"/>
>   </match>
> </file>

Yes, this sounds like a good idea. I'll look into it.

> This then leads on to your suggestion:
> 
> > If Anteater and Cocoon are on the same machine, you can use normal
> > Ant tasks to modify Cocoon files while the system is running, send
> > another request to the server and test in the response the
> > modified Cocoon behavior.
> 
> I don't think those "normal Ant tasks" exist yet ;) What would be
> really nice is a version of James Strachan's xtags taglib, for Ant
> instead of JSP.

As I described in an earlier email to Stefano, you can use a
combination of <copy> with <filterset> to replace a token in a
template file.

Would be interesting to see the xtags elements as well. Do you have a
URL to James work?

> On Thu, Oct 04, 2001 at 09:20:17AM -0700, Ovidiu Predescu wrote:
> > Hi,
> > 
> [..]
> > I was wondering what would be a good way to release it. As it is
> > right now it's a standalone package, much like Ant. You install it
> > on the local filesystem, and you get an 'anteater' script, that
> > behaves just like the 'ant' script from ant, while adding
> > additional tasks.
> 
> Have you needed to make any modifications to the Ant core? If not,
> why not just put the jar in lib/, and create a new Ant file
> 'tests.xml' with a bunch of <taskdef>s to declare the tasks?

No, I haven't done any changes to the Ant core, although some changes
will probably be needed in the future to support more advanced
features to be able to implement some minimal stress testing
functionality.

The way things are setup right now, is not quite possible to take the
Anteater.jar file and drop it in lib/. This is because I embedded
Tomcat inside Ant, to be able to implement the <listener>
functionality. It's quite a neat integration, where Tomcat runs in a
separate thread inside Ant.

> Anyway, well done, and I look forward to playing, and sponging off
> your hard work for private projects ;)

Have fun ;-)


Regards,
-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message