On Tue, 25 Sep 2001 08:56:26 +1000, Jeff Turner <[EMAIL PROTECTED]> wrote:

> On Mon, Sep 24, 2001 at 10:29:11AM -0700, Ovidiu Predescu wrote:
> > Jeff and all,
> > 
> > Over the weekend I worked on extracting the HttpClient test framework
> > that comes with Tomcat 3.3, and making it a standalone framework.
> 
> Wow, that was impressively quick :)

In fact I was amazed too, it was very simple to extract the Tomcat
framework out of its context and create a project out of it.

> [..]
> > 
> > >From the other tasks, the biggest problem seems to be <spawn>. This
> > one requires changes in the Ant internals, which I'm reluctant to do,
> > unless I get some feedback from the Ant developers.
> 
> Hmm.. if <parallel> worked as a task, I'd have thought <spawn> would.

The problem is quite tricky. Imagine we have this:

<spawn threads="50">
  <httpClient>
    <httpRequest href="http://localhost/cocoon"/>
    <httpResponseMatch select="/html/h1" value="Welcome to Cocoon2!"/>
  <httpClient>
  <some other tasks here>
</spawn>

The meaning of this is that the <httpClient> task should run in 50
threads in parallel the sequence of children tasks. You can translate
it to this:

<parallel>
  <sequential>
    <httpClient>
      <httpRequest href="http://localhost/cocoon"/>
      <httpResponseMatch select="/html/h1" value="Welcome to Cocoon2!"/>
    <httpClient>
    <some other tasks here>
  </sequential>

  <sequential>
    <httpClient>
      <httpRequest href="http://localhost/cocoon"/>
      <httpResponseMatch select="/html/h1" value="Welcome to Cocoon2!"/>
    <httpClient>
    <some other tasks here>
  </sequential>

  ...

  <the above sequential appears 50 times>
</parallel>

The implementation of the <spawn> task should in fact create a
<sequential> task containing all the original tasks, and then multiply
it 50 times. This is equivalent to deep copying all the tasks! This is
currently not implemented in Ant, and requires some major changes if
you think about it.

> [..]
> > There are two other tasks I'm looking at to implement:
> > 
> > - <include> to include XML fragment files in the main Ant build.xml
> > file. This would allow the tests to be put in separate files, and have
> > them included all at once in the main Ant driver.
> 
> You could use good'ol entity declarations here. If you use this for the
> build.xml doctype decl:
> 
> <!DOCTYPE project [
>     <!ENTITY tests SYSTEM "file:build-tests.xml">
> ]>
> 
> Then you can put a:
> 
>   &tests;
> 
> somewhere in build.xml, and tests.xml will be included.

Yes, I know, this is what I'm using and I don't like it too much. I
would certainly prefer to have something like:

<includeFiles srcdir="tests" includes="**/*.xml"/>

BTW, I think <includeFiles> is a better name than the already
overloaded <include> name.

> > - <listen>. This is very specific to asynchronous SOAP
> > communication. In such a scenario a SOAP client sends a SOAP request
> > to a server, which will later on send the client on a particular URL
> > other SOAP messages. I'm looking at using the EmbeddedTomcat class
> > from Tomcat 3.3.
> 
> 'EmbededTomcat', one of those tragic spelling mistakes preserved
> forevermore in the public API ;)

Yes, that's indeed very unfortunate.

> > I'll post some source code as soon as I have the code integrated with
> > Cocoon and Cactus.
> 
> I look forward to having a play.

Thanks for your feedback!


Regards,
-- 
Ovidiu Predescu <[EMAIL PROTECTED]>
http://orion.rgv.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to