Hi everybody!

The test environment of the tool we develop consist of 20+ build files (one for each module) and growing fast. All of the with 1 or 2 or more junit invocations, and all of them must follow some conventions:
1) formatter
2) haltonerror
3) maxmemory
4) timeouts
5) jvm (we hacked junit because the JUnitRunner must run inside an app wrapper of our own and changing the executable was not enough)
6) fork
7) FYI the inheritAntProperties="true" is another hack to pass the ant environment to the junit runner (I know it is done in 1.6, but right now we are in 1.5.3)


this is a sample invocation:
<junit printsummary="yes" fork="yes" jvm="fuego" maxmemory="256m" dir="${build.dir}" showoutput="on" inheritAntProperties="true"
haltonfailure="false" failureproperty="test-basic.failure" haltonerror="false" errorproperty="test-basic.error">
<classpath refid="junit.class.path"/>
<formatter classname="${junit.formatter.classname}" extension=".xml"/>
<!-- tests that will be run -->
<test name="fuego.directory.test.SchemaCreationTest" todir="${run.dir}" />
</junit>



Now, I just want to gather opinions regarding the following: would it be better for this case to be able to specify most of these things a properties instead of having to type a really long junit tast each time?


I mean, you know copy/paste programming is error prone and is really difficult to maintain, let's say I want to raise maxmemory to 512m, I should have to change ALL the junit invocations (ok, I've got global search/replace, but it's also error prone)

It would be really easy to read something like this:

<junit dir="${build.dir}">
<classpath refid="junit.class.path"/>
<test name="fuego.directory.test.SchemaCreationTest" todir="${run.dir}" />
</junit>


and have the rest of static definitions taken from properties I define somewhere else globally. I do not mean to remove the attributes, I just would like a way to overwrite default values in case they are not defined in the task.

Well, I just want opinions, and if there are good practices the ant group is promoting in either direction I would really like to hear them.

Thanks for your time,
MAriano

Fuego Labs.
www.fuego.com



Reply via email to