title: Change working directory in ant junit task
body: <p>I have a ant file that runs JUnits tests. These tests rely on a relative path to certain configuration files. I've tried to set the working directory for the batch test, but fail.</p>
  
  <p>I want the working directory to be <code>${plugins.dir}/${name}</code></p>
  
  <p>The JUnit part of the ant script:</p>
  
  <pre><code>&lt;junit haltonfailure="no" printsummary="on" fork="true" showoutput="true" dir="${plugins.dir}/${name}"&gt;
      &lt;jvmarg value="-Duser.dir=${plugins.dir}/${name}"/&gt;
      &lt;classpath&gt; 
          &lt;path refid="project.classpath"/&gt;
          &lt;pathelement location="${plugins.dir}/${dependency}/@dot/"/&gt;
          &lt;pathelement location="${plugins.dir}/${name}/" /&gt;
      &lt;/classpath&gt;
      &lt;formatter type="xml" /&gt;
      &lt;sysproperty key="basedir" value="${plugins.dir}/${name}"/&gt;
      &lt;sysproperty key="dir" value="${plugins.dir}/${name}"/&gt;
      &lt;batchtest todir="${junit.output}"&gt;
          &lt;fileset dir="${dir}"&gt; 
              &lt;include name="**\*AllTests.class" /&gt;
          &lt;/fileset&gt;
      &lt;/batchtest&gt;
  &lt;/junit&gt;
  </code></pre>
  
  <p>I've googled and searched but the workarounds I've found have been to set the "dir", "sysproperty" or "jvmarg". As you can see I've tried them all :)</p>
  
  <p>Is there a way to print the current dir in the  tag? It doesnt support . That would allow me to verify if the dir is actually changed and to what. </p>
  
  <p>One wildcard in this equation is that this is being run in Hudson that starts upp an eclipse process that starts antrunner. This is so we can run both junit and eclipse plugin junit tests. Shouldn't have anything to do with the problem I think. </p>