JUnitTask fork problem?

2006-03-09 Thread Oliver Hummel
Dear all,

I have a problem with installing a security manager for a JUnitTask. I
use something like the following code to call ant programmatically:

JUnitTask junit = (JUnitTask) project.createTask("junit");
junit.createJvmarg().setValue("-Djava.security.manager");
junit.setTaskName("junit");
junit.setFork(true);
junit.setForkMode(new JUnitTask.ForkMode("once"));
junit.setTimeout(1);

Testing and everything works fine, the only thing is there is obviously
no security manager installed for the test cases. I.e. printing
System.getSecurityManager in a test case delivers null and I can still
execute any command I like in the test cases.

Seems to me there is a problem with forking here as I cannot see another
JVM starting up in the task manager when I run the program..?

Is this a known issue? Or am I doing something fundamentally wrong here?

Any help is greatly appreciated!

Cheers,

  Oliver





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



Re: How to access command line arguments passed to Ant. How to search Ant manual

2006-03-09 Thread Ninju Bohra
This was discussed on the mailing list a couple of times...here a link to the 
latest time is was discussed:
 
http://marc.theaimsgroup.com/?l=ant-user&m=113040722211523&w=2
 
(And a reasonable solution is offered, yea !!)
 



- Original Message 
From: [EMAIL PROTECTED]
To: user@ant.apache.org
Sent: Wednesday, March 8, 2006 7:07:14 AM
Subject: RE: How to access command line arguments passed to Ant. How to search 
Ant manual


I have a .bat file that starts Ant with the parameters that the user
specifies. The reason I want to use the argument instead of using -D is
that different targets have different parameters passed to them. For
example, if I am building my test tool, the second parameter should be
the server name, if I am building a package, the second parameter should
be the package type. Unless I make the .bat file know about different
targets and set -Dserver in the first case and -DpackageType in the
second case, I have to use something generic like -Darg2=%2. It seems
more elegant if the .bat file did not have to know about different
arguments, it would just pass them to Ant(along with the target) and the
Ant file would use the arguments as needed. Since there does not seem to
be a way to do that, I have resorted to using the -Darg2 approach.



Thanks,

Mehdi Rakhshani

BES-IT Development, GXS

813-496-3624

-Original Message-
From: notify@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of schmaxelander
Sent: Wednesday, March 08, 2006 7:51 AM
To: Rakhshani, Mehdi (GXS)
Subject: Re: How to access command line arguments passed to Ant. How to
search Ant manual



Hi Mehdi,



--- In [EMAIL PROTECTED], <[EMAIL PROTECTED]> wrote:

> I went through as much of the Ant manual as I could and did not find
any

> information that tells me how to use a command line argument that was

> passed to Ant (I am sure it is there and I missed it).

> 

> [...]

> 

> 2-   If I call Ant with "target argument_needed_by_target" how do
I

> use the second argument in my target? (I know about using

> -Dmyproperty=%2 but am looking for a better option)



Well, you seem to know the standard way of doing so: "-Dmyproperty=...".



Counterquestion: why are you looking for a different way?

Even if there might be better ways (which I doubt), this is the

standard. 



Regarding your example "ant ... target argument_needed_by_target": 

ANT interprets these parameters as target names.

So if you don't add "-D" in front of your argument, ANT can't identify

it as such.



~Alex

Issue overriding a target in build.xml that is importing other build files with the same target

2006-03-09 Thread Eric Wood
I have a build.xml (A.xml) that defines:



A.xml imports a build.xml file (B.xml) which does NOT have a deploy
target.
B.xml imports a build.xml file (C.xml) which does have a deploy target. 
C.xml imports a build.xml file D.xml) which does have a deploy target. 

So A.xml imports B.xml which imports C.xml which imports D.xml. A.xml,
C.xml and D.xml all have deploy targets.

When I execute A.xml with -debug I get the following output:
  Already defined in main or a previous import, define deploy as
C.deploy
 then the line
  Already defined in main or a previous import, define deploy as
D.deploy

So far so good, then I get the following line in the debug output:
Build sequence for target(s) `deploy' is [init, clean-loop, clean,
_fetch, fetch, _compile, compile, _gatherReferences, gatherReferences,
_manifestClassPath, manifestClassPath, _manifest, manifest, _package,
package, build, deploy]

This is the dependency list for D.xml's deploy target. The build starts
to execute the targets in the depends="" and the build fails because
A.xml can't support the functionality that D.xml is expecting. That is
why I overrode the functionality in A.xml in the first place.

Any ideas why I am not executing my "deploy" in A.xml?

Eric


Re: uptodate with a target directory

2006-03-09 Thread Daniel Smith
I've tested this now under Ant 1.6.5, and on two different platforms;  
the same bug is present.  Can anyone confirm this bad behavior on  
their own system?  If there are no objections, I think I'll create a  
bug report.


For comparison, here is a full script that works correctly (notice  
that the only difference is in the "uptodate" command):





  


  

  unless="generated" >



  

  

  
srcfile="source" />

  




—Dan Smith


On Mar 7, 2006, at 2:04 PM, Daniel Smith wrote:

uptodate does not seem to handle target directories properly.  It  
will incorrectly determine that a generated directory with an out- 
of-date timestamp is actually up to date.  Example script:




  


  

  unless="generated" >



  

  

  

  

  




If, in an empty directory, I do the following:
- ant update-source (to generate the source file)
- ant update-target (to generate the target directory)
- ant update-source (to change the timestamp on the source file)
- ant update-target (to generate a *new* target directory)

On the second "update-target" uptodate incorrectly determines that  
the directory is up to date.


If I modify my script to do the following:
 targetfile="target" />

it will work as expected.

It also works as expected if I generate a target *file* instead of  
a target *directory*.


I'm using Ant 1.6.2 and Java 1.5.0_05.

—Dan Smith


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



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



[ant1.6.5] IBiblio upload request for ant-testutil.jar and its sources

2006-03-09 Thread Adrian Herscu
Hi all,

Can someone upload the ant-testutil.jar and its sources to IBiblio so it
will be available for Maven 2 users?
This jar is not distributed as part of the ANT (1.6.5) binary
distribution and it took me some time to make it work with the ANT
tutorials -- if it would be on the ibiblio repo then it would be much
simpler.

Thanks,
Adrian.


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



Introduction to Ant

2006-03-09 Thread Joe Schmetzer
I've just published a new slide show called "Introduction to Ant" at
http://www.exubero.com/ant/antintro-s5.html

Hopefully this can become a useful resource for people learning about
Ant, or teaching others about Ant. I'd be interested in any feedback, if
people want to suggest any corrections, additions or improvements.

Cheers!
-- 
Joe Schmetzer .:. Renaissance Developer .:. http://www.exubero.com/


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



junit & ant

2006-03-09 Thread Adam Stroud
Hey All:

I am sure that most of you have seen this message com across the list
before.  I am trying to use junit with ant.  I want to be able to have
the junit.jar file reside somewhere else than in the ANT_HOME/lib
directory.  I have searched the web for ideas about how to solve this
problem but nothing seems to work.  Currently, I am trying to move
ant-junit.jar and junit.jar into the same dir and declare my own
taskdef.  I keep getting the following error:

build.xml:42:taskdef class
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found

I have seen on the web that this seems to be a fairly common problem,
so I was thinking that someone must know how to do this.

Again, I know this had probably come across the mailing list before,
so any help (or a pointer to another mailing list thread that might
yield the answer) would be greatly appreciated.

Thanks
A

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



[ant-testutil] setUp() an ANT test case

2006-03-09 Thread Adrian Herscu
Hi all,

I am following the ANT tutorials, and now I am trying to see how I can
run tests under Maven.

I have put the HelloWorld and HelloWorldTest classes into a package
(let's say mypck). The test build file is also found in that package. So
when compiled the file system looks like this:

basedir
+-target
+-classes
+-mypck
HelloWorld.class
+-test-classes
+-mypck
HelloWorldTest.class
test-helloworld.build.xml

Now, if I am calling configureProject() with just the test build file
name then ANT tries to retrieve it from basedir (which results in a
FileNotFoundException).

I am trying to solve this without hardcoding the full pathname in the
HelloWorldTest::setUp method by calling:

getResource("test-helloworld.build.xml").getFile()

which returns an absolute path to the test build file.

The problem is that the BuildFileTest::configureProject does not know
how to handle absolute pathnames and a FileNotFoundExecption is thrown.

Any idea how to solve that?
Adrian.


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



How can I check an xml file timestamp and execute with a java in build file

2006-03-09 Thread Yagna Boorada
Hi
 
I am currently using a java class to parse a set of  xml files.
 
I would like to check the timestamp of each one of of the xml files
and process only those.
 
It would be a great help for me if I get one. 
 

Yagna

If your mind can conceive it and heart can believe  it then you can
surely achieve it.

 
MASTEK 
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
all computers.
~~


question about overall build success when subant fails.

2006-03-09 Thread Kevin Martin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Re-Post.

Is this the wrong list to post this to?  if so, what would be a better list?

Thanks.

Kevin

Kevin Martin wrote:
> Saw a thread from 2004 where the user had multiple subant tasks that weren't 
> dependent on each other so he set the
> failonerror="false" for those tasks so the build could run all the way to 
> completion.  At the end of the build, ANT reported BUIlD
> SUCCESSFUL when, in fact, one or more of the subant tasks had failed.  He 
> asked if there was a way that ANT would recognize that
> subant tasks had failed and report the status as such at the end of the 
> build.  I found no answer for his question and I have the
> same scenario and the same question.  If a subant task fails ANT should 
> report the overall build as FAILED IMHO.
> 
> I've been unsuccessful in finding a resolution to this in the documentation 
> but maybe I'm just misunderstanding something.
> 
> Thanks.
> 
> Kevin

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


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEEQ6xaXZlxDxYaM4RAkUfAJ9Nw9kR8TOjTCQABh+zxR6PCo6rMgCgi7wD
QIu1uI06HWvO7XRxRF+bJZA=
=ina1
-END PGP SIGNATURE-

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



Exec Task

2006-03-09 Thread Res Pons
How do I pass arguments with quotation marks intact to the exec task?  I am 
having difficulty passing double quotes for comments to the svn ci -m 
"comment" filename


	








Thank you.

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



AW: Introduction to Ant

2006-03-09 Thread Jan.Materne
Nice slides
- location/date of presentation is not set ;-)
- how to go to previous slide?

- 3: I love the last sentence
  "Ant is not a programming language"
- 4: maybe you´ll say a few words about which scm´s are supported
  -- scm: svn, cvs, synergy, perforce, ...
  -- also supports JUnit4
- 4: Ant manages dependencies between??? what??
- 5: some IDEs use Ant under their hood for the build process
- 8: project attributes are optional (since 1.6)
- 9: a  is not needed by syntax any more (1.6). You could place
  tasks directly under the project. But of course targets should be used
  for more than one or two tasks ;-)
- 9: targets can be conditional (if/unless)
- 10: I think a graph for the dependencies is clearer
- 11: usually tasks dont use references to properties. They use a value. 
  The string 'foo' is given as a value. The string '${foo}' is given as string
  and while that translated to 'foovalue' respective '${foo}' (if foo is not 
set).
  The task does not know whether the value came from a property.
- 12: a collegue of mine compares properties with string constants
- 12: order of setting the properties
  -- 1st: command line -D
  -- 2nd: s under  in their written order
  -- 3rd: s under s in their executed order
- 13: 
  -- what is the difference between properties from file or from resource?
  -- hint: you cant set environment variables from Ant
  -- hint: , 
 (ok, have seen at #27; maybe a hint 'for later')
- 15: too much text (last line is under the green bar at the buttom)
  ant.java.version: I think since a few days it can also hold '1.6' ;-)
- 16: do you also say something about ResourceCollections? Will be very 
important
  with 1.7...
- 18: also supported by NetBeans, IntelliJ IDEA, ...
- 19: these steps are written in the manual, but AFAIK not really necessary
  -- ANT_HOME is set by the wrapper script if not present
  -- JAVA_HOME is needed
  -- PATH is only for convenience, you could also use the absolute path
- 20: -projecthelp will use the information provided by  and
   and . If none is there Ant doesnt try 
to 
  guess ... 
- 23: 
- 24: mmmh . is  not 'really' supported (maintained)? 
  AFAIK we prefer using Tomcats own task.
- 27: 
- 28:  
- 30: maybe a visual representation of the project layout
  (Windows: tree /A /F)
- 31: comment in target 'init' too long for the line
- 31: personally I create a directory where the task is which needed that
  (here javac I think, see also your solution on #33)
- 31: indent of the  is other than of the other tasks
- 31: project name differ from the name of the root directory; which name is 
better?
- 33: would be better to use
  
  
   
- 41: for homework, provide the java source ;-)



public/private targets:
* public target has a description
* private targets dont have that and their name starts with a '-'
(see http://issues.apache.org/bugzilla/show_bug.cgi?id=22020 )

special environment variables
* ANT_ARGS
* ANT_OPTS

special files
* ${user.home}/antrc_pre.[sh|bat]
* ${user.home}/antrc_post.[sh|bat]

how to install external tasks?
* ${user.home}/.ant/lib + /xmlns

extended version of the buildfile
* run-target ()
*  with  and Main-Class attribute
 
 

cheers
Jan


>-Ursprüngliche Nachricht-
>Von: Joe Schmetzer [mailto:[EMAIL PROTECTED] 
>Gesendet: Donnerstag, 9. März 2006 23:31
>An: Ant Users List
>Betreff: Introduction to Ant
>
>I've just published a new slide show called "Introduction to 
>Ant" at http://www.exubero.com/ant/antintro-s5.html
>
>Hopefully this can become a useful resource for people 
>learning about Ant, or teaching others about Ant. I'd be 
>interested in any feedback, if people want to suggest any 
>corrections, additions or improvements.
>
>Cheers!
>--
>Joe Schmetzer .:. Renaissance Developer .:. http://www.exubero.com/
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



AW: How can I check an xml file timestamp and execute with a java in build file

2006-03-09 Thread Jan.Materne
>I would like to check the timestamp of each one of of the 
>xml files and process only those.

Those which are what?

Try nested selectors in .


Jan

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



AW: Exec Task

2006-03-09 Thread Jan.Materne
>How do I pass arguments with quotation marks intact to the 
>exec task?  I am having difficulty passing double quotes for 
>comments to the svn ci -m "comment" filename

xml entities?   "


>   
>   

Mmh ... really  ?? Multiple options need a 
But here it would be better to use multiple s
  
  
  


Have you tried the available svn tasks? Mostly the tasks provided by the
svn team...


Jan

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



RE: How can I check an xml file timestamp and execute with a java in build file

2006-03-09 Thread Yagna Boorada
Hi Jan
Thanks for your reply!

Basically I want to pass only modified xml files for parsing.

How does this fileset helps me to recognise modified files.

Yagna

If your mind can conceive it and heart can believe  it then you can
surely achieve it.

Extn: 4452, 7818


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 10, 2006 12:53 PM
To: user@ant.apache.org
Subject: AW: How can I check an xml file timestamp and execute with a
java in build file

>I would like to check the timestamp of each one of of the xml files

>and process only those.

Those which are what?

Try nested selectors in .


Jan

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




MASTEK 
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
all computers.
~~


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



AW: How can I check an xml file timestamp and execute with a java in build file

2006-03-09 Thread Jan.Materne
A fileset selects files. include/exclude uses name patterns for selecting 
special files. For more precise selection you could specify nested selectors 
[1].
For a simple timestamp check, you could use . If you use generated files 
(which content could be unchanged, but completetly new created) you could use 
.

Jan

[1] http://ant.apache.org/manual/CoreTypes/selectors.html

>-Ursprüngliche Nachricht-
>Von: Yagna Boorada [mailto:[EMAIL PROTECTED] 
>Gesendet: Freitag, 10. März 2006 08:27
>An: Ant Users List
>Betreff: RE: How can I check an xml file timestamp and execute 
>with a java in build file
>
>Hi Jan
>   Thanks for your reply!
>
>   Basically I want to pass only modified xml files for parsing.
>
>   How does this fileset helps me to recognise modified files.
>
>Yagna
>
>If your mind can conceive it and heart can believe  it then 
>you can surely achieve it.
>
>Extn: 4452, 7818
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Friday, March 10, 2006 12:53 PM
>To: user@ant.apache.org
>Subject: AW: How can I check an xml file timestamp and execute 
>with a java in build file
>
>>I would like to check the timestamp of each one of of the 
>xml files
>
>>and process only those.
>
>Those which are what?
>
>Try nested selectors in .
>
>
>Jan
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED] For 
>additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>MASTEK
>"Making a valuable difference"
>Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
>In the US, we're called MAJESCOMASTEK
>
>~~~
>~~~
>Opinions expressed in this e-mail are those of the individual 
>and not that of Mastek Limited, unless specifically indicated 
>to that effect. Mastek Limited does not accept any 
>responsibility or liability for it. This e-mail and 
>attachments (if any) transmitted with it are confidential 
>and/or privileged and solely for the use of the intended 
>person or entity to which it is addressed. Any review, 
>re-transmission, dissemination or other use of or taking of 
>any action in reliance upon this information by persons or 
>entities other than the intended recipient is prohibited. This 
>e-mail and its attachments have been scanned for the presence 
>of computer viruses. It is the responsibility of the recipient 
>to run the virus check on e-mails and attachments before 
>opening them. If you have received this e-mail in error, 
>kindly delete this e-mail from all computers.
>~~~
>~~~
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED] For 
>additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



RE: junit & ant

2006-03-09 Thread Jon Skeet
> I am sure that most of you have seen this message com across 
> the list before.  I am trying to use junit with ant.  I want 
> to be able to have the junit.jar file reside somewhere else 
> than in the ANT_HOME/lib directory.  I have searched the web 
> for ideas about how to solve this problem but nothing seems 
> to work.  Currently, I am trying to move ant-junit.jar and 
> junit.jar into the same dir and declare my own taskdef.  I 
> keep getting the following error:
> 
> build.xml:42:taskdef class
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found
> 
> I have seen on the web that this seems to be a fairly common 
> problem, so I was thinking that someone must know how to do this.
> 
> Again, I know this had probably come across the mailing list 
> before, so any help (or a pointer to another mailing list 
> thread that might yield the answer) would be greatly appreciated.

I believe that in the current nightly builds, this is fixed thanks to
Jesse Glick - but I don't know what's required to get it working.

As far as I remember, your options are:
1) Specify a "lib" directory on the command line
2) Put junit.jar into the lib directory
3) Take ant-junit.jar out of the lib directory

Jon


Clearswift monitors, controls and protects all its messaging traffic in 
compliance with its corporate email policy using Clearswift products.
Find out more about Clearswift, its solutions and services at 
http://www.clearswift.com

This communication is confidential and may contain privileged information 
intended solely for the named addressee(s). It may not be used or disclosed 
except for the purpose for which it has been sent. If you are not the intended 
recipient, you must not copy, distribute or take any action in reliance on it. 
Unless expressly stated, opinions in this message are those of the individual 
sender and not of Clearswift. If you have received this communication in error, 
please notify Clearswift by emailing [EMAIL PROTECTED] quoting the sender and 
delete the message and any attached documents. Clearswift accepts no liability 
or responsibility for any onward transmission or use of emails and attachments 
having left the Clearswift domain.

This footnote confirms that this email message has been swept by MIMEsweeper 
for Content Security threats, including computer viruses.

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