Put it before the <junit>
element:
<target name="junit-tests" depends="clean, compile-tests">
<echo message="${test.dist.dir}"/>
<junit fork="true" showoutput= ...>...
There is no point to move it inside since the value of the variable can't change.