Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 84812 invoked by uid 500); 5 Apr 2002 22:27:07 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Delivered-To: moderator for cocoon-dev@xml.apache.org Received: (qmail 55218 invoked from network); 5 Apr 2002 12:43:40 -0000 Message-ID: <002301c1dc9f$f8a10ee0$0c91fea9@galina> From: "Ivelin Ivanov" To: Cc: "Jeff Turner" References: <200204050558.g355wH113202@hercules.home> Subject: Re: Cocoon functional testing using Anteater Date: Fri, 5 Apr 2002 06:46:55 -0600 Organization: ivelin@apache.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ovidiu, You leave me speachless. Only two requests I can think of: - take Anteater out of the schecoon tree and move it in its own tree uner scratchpad. - write a 2 page README or xdoc that explains how to run a few tests. You can use your last response for start :) When you do that I would love to play with this framemework and promote it to people I know. Cheers, Ivelin ----- Original Message ----- From: "Ovidiu Predescu" To: "Ivelin Ivanov" Cc: ; "Jeff Turner" Sent: Thursday, April 04, 2002 11:58 PM Subject: Re: Cocoon functional testing using Anteater > On Thu, 4 Apr 2002 21:25:42 -0600, "Ivelin Ivanov" wrote: > > > > > Super Extra Cocool ! > > > > Have you considered integration with Jakarta's Latka? > > http://jakarta.apache.org/commons/latka/index.html > > Jeff Turner, the co-author of Anteater, is looking into this. He's a > committer in the Latka project. Unfortunately Latka is not implemented > on top of Ant, so integration would really mean refactoring most of > the code. > > > Please put on the wish list a features: > > > > 1) allowing for POST of text/xml mime content. This will allow testing web > > services. > > This is already done. Use the contentType attribute of , > or directly use the which is a specialization of > for SOAP requests. > > > 2) Allowing for match of XML content. This will help with WS (related to 1) > > and testing against "content" views of a web site. > > Already implemented ;-) > > Anteater was designed specifically for Web Services and Web > Applications testing. > > > A quick and dirty example: > > > > > > > > > > > > > > > > > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > > > > > xmlns="http://www.soapengine.com/lucin/salcentral/cidea.asmx"> > > long > > string > > boolean > > > > > > > > > > > > > select="envelope/body/getTopIdeasResponse/GetTopIdeasResult" > > assign="result"> > > > > > xmlns="http://www.soapengine.com/lucin/salcentral/cidea.asmx"> > > 6 > > Global Positioning > > 0 > > 0 > > > > > > > > > > > > > > > > > > > > Do you think this will make it in CVS before 2010 ;-) ? > > Already implemented ;-), although with a different syntax. > > The following sample is taken directly from the test.xml file in the > Anteater distribution: > > > > A SOAP request will now be sent off to ${url} to retrieve a stock quote. > > > content="test/requests/get-quote"> > >
> > assign="result"/> > Got ${cl} bytes back from server; HTTP response code ${rc} > XPath-selected the value '${result}' > > > > > > > To check for specific values just use: > > > > This test will succeed only if the value of the specified XPath is > exactly the specified value. You can also use or > to match on the content. > > The major difference between Anteater and any other HTTP testing > framework out there is that you can use Anteater to test the client > side, not only the server side. Most of the testing frameworks > simulate the client side only, with Anteater you can simulate the > server side as well! > > This is achieved using the task. Suppose you want to test > if your client Web service application sends the correct message to a > service. You can write something like this: > > > > >
>
> > > > > > You can setup multiple listeners to wait in parallel for requests > using , if you don't care about the order in which the > messages are received. Or you can use to listen for > messages only in a given order. > > Again check out the test.xml file from Anteater's distribution for > more samples. You're more than welcome to contribute suggestions for > improvements, or even code to Anteater ;-) > > Regards, > -- > Ovidiu Predescu > http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff) > > > > ----- Original Message ----- > > From: "Ovidiu Predescu" > > To: > > Sent: Thursday, April 04, 2002 8:14 PM > > Subject: Cocoon functional testing using Anteater > > > > > > > I've finally decided to take time to implement functional testing in > > > Cocoon using Anteater, a tool Jeff Turner and I worked on since the > > > end of last year. > > > > > > Using Anteater you can write regression tests against a deployed > > > Cocoon application. You can fire HTTP requests, and check for various > > > things in the response, using regular expressions, XPath and other > > > things. Anteater is more powerful than this, it can also act as the > > > server side, allowing you to test the client side of your application. > > > > > > For now the integration is done specifically for Schecoon, but it > > > should be trivial to adapt to the normal Cocoon. To run the tests you > > > simply type in the schecoon/ directory: > > > > > > ./build.sh test > > > > > > This spawns off Anteater on the tests/anteater/all-tests.xml file. The > > > default task in this file will search for test files located in > > > tests/anteater and will run them automatically. > > > > > > To write a test you create a "normal" Ant file, which will actually > > > contain Anteater extended tasks. The file should contain only one > > > target, whose name is the same as the file's name, except for the .xml > > > suffix. This target will be automatically picked up by the > > > all-tests.xml file and executed. Checkout the calc.xml test for an > > > example: > > > > > > > > http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/schecoon/tests/ > > anteater/calc.xml?rev=1.3&content-type=text/vnd.viewcvs-markup > > > > > > This file tests the Calculator example written using the brand new > > > control flow layer in Schecoon. > > > > > > To run the sample, you first need to install Anteater from > > > > > > http://sourceforge.net/projects/aft/ > > > > > > At this point, the Anteater documentation is very crude, and there's > > > no Web page, besides the Sourceforge project one. If you know Ant it > > > should be fairly easy to learn the new commands introduced by > > > Anteater. > > > > > > Please let me know if you're interested in getting more info on > > > Schecoon or Anteater. > > > > > > Have fun, > > > -- > > > Ovidiu Predescu > > > 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 > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org