« Return to Thread: Repeated setting of sysproperties in junit

Repeated setting of sysproperties in junit

by Jim Jay :: Rate this Message:

Reply to Author | View in Thread

Hi, I'm fairly new to Ant and would appreciate some advice:

I have targets in a number of build files that all set the same group of system properties for different junit tests. The values set will always be the same as the system properties are set from ant properties loaded from a properties file.

Obviously I don't really want to copy-and-paste identical blocks into each target like:
<property file="foo.properties">
<sysproperty key="sprop" key="${antprop.from.file}>
<sysproperty key="sprop2" key="${antprop2.from.file}>
...

I can't create a seperate target and use antcall as this isn't supported inside the junit tag. Equally well it doesn't seem to support macros created using macrodef.

Any suggestions?

Thanks a lot.

J.

 « Return to Thread: Repeated setting of sysproperties in junit