title: Set output directory of TestNG before test
body: <p>I am running some TestNG tests with Eclipse, using XML files (right click, run as TestNG suite). I use maven only for dependencies, not for running tests. Is there a way to set the output directory in the code? </p>
  
  <p>For example</p>
  
  <pre><code>System.out.println(ctx.getOutputDirectory());
  </code></pre>
  
  <p>prints the current output directory, which by default, is test-output. But why isn't there a setOutputDirectory? I would like to set the output directory in the @BeforeTest method to a folder that I set in the testng.xml file.</p>