[Webtest] Custom tasks: take care at loaderRef

Marc Guillemot webtest@lists.canoo.com
Fri, 25 Jul 2003 09:31:31 +0200


it is possible to add my custom steps to
${webtests.canoohome}/webtestTaskdefs.properties and my classes to the path
but I think that it's not a clean solution as it implies to update this file
each time I want to benefit from a new build of Canoo Webtest.

Btw, going through the code, I think the classes could generally be improved
using interfaces instead of concrete implementations:
ex: in com.canoo.webtest.steps.Step
    public HashMap getParameterDictionary()
should be
    public Map getParameterDictionary()
the concrete type used is an implementation detail and therefore doesn't
need to be showed.

Marc.




----- Original Message -----
From: "Dierk Koenig" <dierk.koenig@canoo.com>
To: <webtest@lists.canoo.com>
Sent: Thursday, July 24, 2003 6:35 PM
Subject: RE: [Webtest] Custom tasks: take care at loaderRef


> interesting... thanx for the post.
>
> Have you tried to add your step to the
> ${webtests.canoohome}/webtestTaskdefs.properties
> and add your implementation jar to the
> webtests.classpath ?
>
> cheers
> Mittie
>
>
> > -----Original Message-----
> > From: webtest-admin@lists.canoo.com
> > [mailto:webtest-admin@lists.canoo.com]On Behalf Of Marc Guillemot
> > Sent: Donnerstag, 24. Juli 2003 18:11
> > To: webtest@lists.canoo.com
> > Subject: [Webtest] Custom tasks: take care at loaderRef
> >
> >
> > Hi,
> >
> > I've just won an hard battle against ant to make my custom tasks
working.
> > Maybe the results could interest someone (or get integrated in the
> > Troubleshooting page).
> >
> > I got each time the error like:
> >
> > file:E:/EWorkspace/Junetz/web-app/WEB-INF/src/webtests/build.xml:58:
Task
> > must be of type "Step": zkystorexpath at
> > file:E:/EWorkspace/Junetz/web-app/WEB-INF/src/webtests/front/testN
> > avLinksBot
> > tom.xml:25:  is of type org.apache.tools.ant.UnknownElement
> >
> > although my tasks extend Step.
> >
> > The cause of the problem was the class loader: my tasks had to be loaded
> > with the same class loader as the canoo tasks.
> >
> > Now my definitions look like this (and this works perfect):
> >
> > <path id="webtests.classpath">
> >    <fileset dir="${webtests.canoohome}" includes="**/lib/*.jar"/>
> >    <pathelement path="${myWebtestTasks}"/>
> > </path>
> >
> > <taskdef file="${webtests.canoohome}/webtestTaskdefs.properties"
> > loaderRef="toto" classpathref="webtests.classpath"/>
> >
> > <taskdef
> > resource="de/internetzky/webtests/extension/webtestsTaskdefs.properties"
> > loaderRef="toto" classpathref="webtests.classpath"/>
> >
> > Marc.
> >
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> >
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>