You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by Graham Turrell <GT...@uk.ibm.com> on 2007/02/06 01:27:12 UTC

Re: specifying VM args on an ant

Arthur,

Good call. I have a proposal which offers a better solution than trying to
add vm args to the ant-test build.xml <taskdef>:

The existing resolver system properties can be set programatically using
java.lang.System.setProperty().
This has the same external effect as creating a resolver setFeature()
method and has the advantage in general
of allowing either programmatic setting *or* setting via vm arguments (for
situations where runtime
control is preferable).

In the case of the W3C tests, we need to set the catalog location (property
org.apache.woden.resolver.simpleresolver.catalog)
and the single base URI (property
org.apache.woden.resolver.simpleresolver.baseURIs). Both of these are in
set locations (relative to woden's root directory ${woden.dir} in the
build.xml).

The solution requires two additional setter methods in ValidateWSDL20,
which allows calls to that class from the build.xml
to specify two additional parameters "catalog" and "baseURI" (both as
filesystem locations and converted to URLs).
ValidateWSDL20 will then set the corresponding system properties to the
specified locations (as URLs), courtesy of the ant framework
and the additional setter methods.

An example build.xml call within an ant target is then:

<validatewsdl20 dir="${test-suite.dir}/documents/good" includes="**/*.wsdl"
cm="yes" cmdir="results" report="documents-good-report.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
 baseURI="${test-suite.dir}"/>

I've successfully tested the approach in an M7 sandbox and keenly await
your/all-devs comments.
We're in a code freeze situation for the M7 branch so I'd also need consent
to commit the solution there.

Kind Regards,

Graham Turrell


Arthur Ryman/Toronto/IBM wrote on 01/02/2007 20:07:42:

> Graham,
>
> I don't know off hand how to do that, but I suspect there is a way
> to use Ant to set Java properties.
>
> However, passing these parameters in as Java VM properties seems
> very awkward. There should be a way to pass these parameter in as a
> call to Woden, e.g. like setting features on the parser. Could you
> propose a design to the mailing list? Maybe propose a new feature URI?
>
> Arthur Ryman,
> IBM Software Group, Rational Division
>
> blog: http://ryman.eclipsedevelopersjournal.com/
> phone: +1-905-413-3077, TL 969-3077
> assistant: +1-905-413-2411, TL 969-2411
> fax: +1-905-413-4920, TL 969-4920
> mobile: +1-416-939-5063, text: 4169395063@fido.ca
>
> Graham Turrell/UK/IBM@IBMGB
> 02/01/2007 12:05 PM
>
> To
>
> Arthur Ryman/Toronto/IBM@IBMCA
>
> cc
>
> Subject
>
> specifying VM args on an ant <taskdef>
>
> Hi Arthur,
>
> I've been looking for a way to set java vm system properties (the
> equivalent of -Dxx=yy on the cmd line) on the validatewsdl20 ant
> task. I had hoped there was a <taskdef> attribute for this but
> trawling the documentation there doesnt seem to be. I wonder if  you
> happen to know of a way of passing these into ant?
>
> Any tips would be very welcome :)
>
> TIA.
>
> Kind Regards,
>
> Graham.
> _____________________________________________
> Graham C Turrell CEng, MBCS
> Chartered IT Practitioner
>
> WebSphere ESB Foundation Technologies
> DE3F16 / MP 211
> IBM Labs
> Hursley Park
> Winchester, Hampshire
> England.  SO21 2JN
>
> Tel +44-(0)1962-815018
> email: gturrell@uk.ibm.com
>
> "No army can withstand the force of an idea whose time
> has come.". -Victor Hugo


---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Re: specifying VM args on an ant

Posted by Arthur Ryman <ar...@gmail.com>.
+1

On 2/5/07, Graham Turrell <GT...@uk.ibm.com> wrote:
>
> Arthur,
>
> Good call. I have a proposal which offers a better solution than trying to
> add vm args to the ant-test build.xml <taskdef>:
>
> The existing resolver system properties can be set programatically using
> java.lang.System.setProperty().
> This has the same external effect as creating a resolver setFeature()
> method and has the advantage in general
> of allowing either programmatic setting *or* setting via vm arguments (for
> situations where runtime
> control is preferable).
>
> In the case of the W3C tests, we need to set the catalog location
> (property
> org.apache.woden.resolver.simpleresolver.catalog)
> and the single base URI (property
> org.apache.woden.resolver.simpleresolver.baseURIs). Both of these are in
> set locations (relative to woden's root directory ${woden.dir} in the
> build.xml).
>
> The solution requires two additional setter methods in ValidateWSDL20,
> which allows calls to that class from the build.xml
> to specify two additional parameters "catalog" and "baseURI" (both as
> filesystem locations and converted to URLs).
> ValidateWSDL20 will then set the corresponding system properties to the
> specified locations (as URLs), courtesy of the ant framework
> and the additional setter methods.
>
> An example build.xml call within an ant target is then:
>
> <validatewsdl20 dir="${test-suite.dir}/documents/good"
> includes="**/*.wsdl"
> cm="yes" cmdir="results" report="documents-good-report.xml"
> catalog="${woden.dir
> }/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
> baseURI="${test-suite.dir}"/>
>
> I've successfully tested the approach in an M7 sandbox and keenly await
> your/all-devs comments.
> We're in a code freeze situation for the M7 branch so I'd also need
> consent
> to commit the solution there.
>
> Kind Regards,
>
> Graham Turrell
>
>
> Arthur Ryman/Toronto/IBM wrote on 01/02/2007 20:07:42:
>
> > Graham,
> >
> > I don't know off hand how to do that, but I suspect there is a way
> > to use Ant to set Java properties.
> >
> > However, passing these parameters in as Java VM properties seems
> > very awkward. There should be a way to pass these parameter in as a
> > call to Woden, e.g. like setting features on the parser. Could you
> > propose a design to the mailing list? Maybe propose a new feature URI?
> >
> > Arthur Ryman,
> > IBM Software Group, Rational Division
> >
> > blog: http://ryman.eclipsedevelopersjournal.com/
> > phone: +1-905-413-3077, TL 969-3077
> > assistant: +1-905-413-2411, TL 969-2411
> > fax: +1-905-413-4920, TL 969-4920
> > mobile: +1-416-939-5063, text: 4169395063@fido.ca
> >
> > Graham Turrell/UK/IBM@IBMGB
> > 02/01/2007 12:05 PM
> >
> > To
> >
> > Arthur Ryman/Toronto/IBM@IBMCA
> >
> > cc
> >
> > Subject
> >
> > specifying VM args on an ant <taskdef>
> >
> > Hi Arthur,
> >
> > I've been looking for a way to set java vm system properties (the
> > equivalent of -Dxx=yy on the cmd line) on the validatewsdl20 ant
> > task. I had hoped there was a <taskdef> attribute for this but
> > trawling the documentation there doesnt seem to be. I wonder if  you
> > happen to know of a way of passing these into ant?
> >
> > Any tips would be very welcome :)
> >
> > TIA.
> >
> > Kind Regards,
> >
> > Graham.
> > _____________________________________________
> > Graham C Turrell CEng, MBCS
> > Chartered IT Practitioner
> >
> > WebSphere ESB Foundation Technologies
> > DE3F16 / MP 211
> > IBM Labs
> > Hursley Park
> > Winchester, Hampshire
> > England.  SO21 2JN
> >
> > Tel +44-(0)1962-815018
> > email: gturrell@uk.ibm.com
> >
> > "No army can withstand the force of an idea whose time
> > has come.". -Victor Hugo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: woden-dev-help@ws.apache.org
>
>