commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: [latka][jelly] commons-vfs?
Date Thu, 18 Jul 2002 23:24:33 GMT
Thanks for setting up the build James,

On Wed, Jul 17, 2002 at 03:52:33PM +0100, James Strachan wrote:
... 
> OK so now we've got the first cut of VFS as a commons component, how would
> you see this working inside Ant/Jelly/Latka/Anteater?
> 
> The way the iteration works in Jelly is to define a <fileset> then iterate
> over it. e.g.
> 
> <j:jelly xmlns:j="jelly:core" xmlns="jelly:ant">
> 
>     <!-- create a scanner -->
>     <fileScanner var="scanner">
>         <!-- define some regular Ant style filesets -->
>         <fileset dir="src/test" includes="**/*.jelly"/>
>     </fileScanner>
> 
>     <!-- now iterate through the files -->
>     <j:forEach var="file" items="${scanner.iterator()}">
>         <!-- process the file in some way-->
>         Found ${file.absolutePath}
>     </j:forEach>
> 
> </j:jelly>
> 
> 
> So maybe we need some way to define a VFS fileSet and work in a similar way?

That was the general idea. Then there can be Latka tags inside the
<forEach>, operating on each 'file'.

It would require quite a lot of coding to get to this stage though. The
HTTP->VFS layer is not trivial (unless it's Cocoon you're testing:), and
Latka/Anteater would need some recoding to use the VFS API.

> Then we can iterate over the set, do set unions, manipulations etc.
> The XPath-like language you mention, I guess we could use that to
> define include/exclude patterns as an alternative to the Ant ones.

I was imagining stuff like:

<!-- Validate all .html files on the website -->
<forEach select="//*.html">
  <xmlvalidate dtd="dtds/xhtml.dtd"/>
</forEach>

or if the VFS back-end supported federation[1], then we could look
inside nodes, eg "WEB-INF/web.xml/web-app/servlet/*", or
"/index.html/*" for "All files linked to from index.html".

(incidentally and totally OT, wouldn't it be cool if there were
XPath-enabled shells.. eg 'ls //*.txt' for "all .txt files", or 'ls
*.txt[@content='*foo*']' for "txt files containing 'foo'")

Ant currently has Selectors[2], which let one limit a fileset based on
things like file date, size, etc. I hope Ant2 will have pluggable
expression languages, which would provide a more compact way of using
selectors.

All just wild imaginings of how to factor out as much as possible
between functional testing tools.


--Jeff

[1] http://java.sun.com/products/jndi/tutorial/beyond/fed/
[2] http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html

> Thoughts?
> 
> James

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message