[Webtest] ReportSite step
Denis N. Antonioli
webtest@lists.canoo.com
Tue, 10 Jan 2006 11:25:09 +0100
Hi
how are you starting the tests?
In my experience, going to the webtest directory and typing:
bin/webtest clean develop
was all that was necessary to build and test a new release.
Best
dna
On 9 janv. 06, at 17:50, Jon Poulton [kinomi] wrote:
> Oh, and one more question. I have sorted out CVS access to the =20
> webtest source code, but when I do a build the web application =20
> tests fail. How do I start up Jetty so they pass? I noticed that =20
> the Jetty jar files are under source control. The error I get is:
>
>
>
> java.lang.reflect.InvocationTargetException
>
> at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown =20
> Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke=20
> (DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
>
> at =20
> org.apache.tools.ant.taskdefs.ProcessDestroyer.removeShutdownHook=20
> (ProcessDestroyer.java:116)
>
> at org.apache.tools.ant.taskdefs.ProcessDestroyer.remove=20
> (ProcessDestroyer.java:186)
>
> at org.apache.tools.ant.taskdefs.Execute.execute=20
> (Execute.java:495)
>
> at org.apache.tools.ant.taskdefs.Java.fork(Java.java:702)
>
> at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:=20=
> 161)
>
> at org.apache.tools.ant.taskdefs.Java.execute(Java.java:77)
>
> at org.apache.tools.ant.UnknownElement.execute=20
> (UnknownElement.java:269)
>
> at org.apache.tools.ant.Task.perform(Task.java:364)
>
> at org.apache.tools.ant.Target.execute(Target.java:301)
>
> at org.apache.tools.ant.Target.performTasks(Target.java:328)
>
> at org.apache.tools.ant.Project.executeTarget(Project.java:=20
> 1215)
>
> at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
>
> at org.apache.tools.ant.UnknownElement.execute=20
> (UnknownElement.java:269)
>
> at org.apache.tools.ant.Task.perform(Task.java:364)
>
> at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run=20
> (Parallel.java:420)
>
> at java.lang.Thread.run(Thread.java:534)
>
> Caused by: java.lang.IllegalStateException: Shutdown in progress
>
> at java.lang.Shutdown.remove(Shutdown.java:102)
>
> at java.lang.Runtime.removeShutdownHook(Runtime.java:218)
>
> ... 19 more
>
> [java] Java Result: 1
>
>
>
> Jon
>
>
>
> From: webtest-admin@gate2.canoo.com [mailto:webtest-=20
> admin@gate2.canoo.com] On Behalf Of Jon Poulton [kinomi]
> Sent: 09 January 2006 16:39
> To: webtest@gate2.canoo.com
> Subject: [Webtest] ReportSite step
>
>
>
> Hello everyone,
>
> I was recently looking through the list of core and extension steps =20=
> to see if I could find a step container that would do the =20
> following: for each page on a website perform =91n=92 verification =20
> steps. This would involve moving in a spider-like fashion through =20
> all of a web applications pages, and calling the same set of steps =20
> after reaching each page. In some ways this would work a little =20
> like the <verifyLinks> step, as it would also verify that all the =20
> links in the webapp worked.
>
>
>
> I found a largely undocumented class which seemed to do something =20
> along these lines called <reportSite>, which is an extension step =20
> written by someone called Denis Antonioli. After having a look at =20
> the source it seemed to do more or less what was required, although =20=
> unfortunately the Spider class it used wasn=92t quite working =20
> correctly (it tries to click mailto: links, and occasionally does =20
> other strange things). Anyway, I=92ve written a replacement class in =20=
> my own package. It=92s not entirely finished, but it does the job as =20=
> far as our requirements go. I was wondering a few things:
>
>
>
> 1) What are the spider package extension steps supposed to =20
> do, exactly? Are they still under development (hence lack of =20
> documentation)? Is anyone using them?
>
> 2) Is anyone interested in the replacement classes I=92ve =
written?
>
> 3) If so, what would be the best way forward? Replace the =20
> existing spider classes? Deprecate the existing classes and place =20
> mine in a separate package?
>
>
>
> To give an idea of how the stuff I=92ve written works, the test XML =20=
> would be something like:
>
>
>
> <steps>
>
> <!-- Log on. -->
>
> &logon;
>
>
>
> <reportSite excludes=3D"([\w:/]*/webapp/logoff))" =20
> description=3D"A set of steps to perform on every page of the site, =20=
> avoiding logoff pages.">
>
> <verifyText description=3D"Verify the text 'Kinomi' =20=
> is present on the page." text=3D"Kinomi" regex=3D"false" />
>
> <not description=3D"Verify that there are no missing =20=
> links to resource strings." >
>
> <verifyText description=3D"Check for presence of ???=20=
> resource.key???" text=3D"\?\?\?\w*\?\?\?" regex=3D"true" />
>
> </not>
>
> <!=97Extra steps applicable to groups of pages go here-->
>
> </reportSite>
>
>
>
> </steps>
>
>
>
> Let me know what you think,
>
> Cheers,
>
>
>
> Jon Poulton
>
>
>
>
--=20
A computer scientist is someone who, when told to "Go to Hell,"
sees the "go to," rather than the destination, as harmful.
-- Dr. Roger M. Firestone, rfire@cais.cais.com