ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject RE: [PATCH] multithreading tasks
Date Thu, 22 Jun 2000 11:22:27 GMT
> -----Original Message-----
> From: James Duncan Davidson [mailto:james.davidson@eng.sun.com]
>
> on 2000/06/18 05:26, Conor MacNeill at conor@m64.com wrote:
>
> Oh, I'm open to being "worked" on. And hopefully my being pig-headish well
> help in the long run. :)

No doubt :-)

>
> Help me out -- give me some syntax to work with. I would like to see a
> sample of the XML build file.

OK, here is my actual test setup with some attributes elided for brevity

<target name="test" depends="install, testcode">
  <wlrun taskname="server"
         async="yes"
         classpath="${weblogic.boot.classpath}"
         wlclasspath="${weblogic.classes}:..."
         name="${server.name}" home="${weblogic.home}"
         properties="${server.name}/${server.name}.properties"/>
  <sleep delay="80000"/>
  <echo message="starting JUnit test"/>
  <java taskname="junit"
        fork="yes"
        classpath="${testrun.classpath}"
        classname="AllTests"/>
  <wlstop classpath="${weblogic.classes}"
          user="..."
          password="..."
          url="..." />
  <join/>
  <echo message="test finished"/>
</target>

Let me explain a few things.

<wlrun> is a task which I use to start a weblogic server (EJB Container).
<wlstop> is a task to stop a weblogic server.

In the patch I sent in last week, I made changes to tag all task logging
with a taskname. This is set to the task type (javac, deltree, etc) by
default but can be overridden by the taskname attribute. Thus I can see the
<java> tasks output as "junit" in the log. Matt's build events patch also
tags all task log output with the task type name.

The wlrun task is run in a separate thread (controlled by the "async"
attribute). The <join>before the echo is for demonstration purposes only -
there is an implicit join performed at the end of the target anyway. The
<sleep> ensures the server has completed initialisation before JUnit starts
to perform its tests.

The output (with much stuff removed)

[server] Thu Jun 22 20:45:33 GMT+10:00 2000:<I> <WebLogicServer> WebLogic
Server started
starting JUnit test
[...]
[junit] Time: 836.332
[junit]
[junit] FAILURES!!!
[junit] Test Results:
[junit] Run: 70 Failures: 3 Errors: 0
[junit] There were 3 failures:
[junit]
test finished
Completed in 1024 seconds

>
> If I understand right, you've got the threading constructs set up as tasks
> themselves. I'm not sure that they are tasks really since they are telling
> Ant to do certain things. Feels a bit like operator overloading
> to me if I'm
> imagining it right. ;) Maybe seeing a build file will help me with this.
>

sleep and join are implemented as tasks but I guess that is equivalent to
those concepts being methods in Java itself. Is that what you meant here?

>
> My main worry is comprehensibility/clarity. Help me with that point and
> let's see where it leads us.
>

It seems to be pretty straight forward to me - whaddaya reckon?

Conor


Mime
View raw message