title: Run TestNG XML suite from runnable jar with test classes in specific folder
body: <p>So I have a TestNG xml file  which looks like this:  </p>
  
  <pre><code>&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt;
  &lt;suite name="Test-class Suite" parallel="classes" thread-count="4" &gt;
     &lt;listeners&gt;
        &lt;listener class-name="ExtentReporterNG" /&gt;
     &lt;/listeners&gt;
     &lt;test name="Test-class test" allow-return-values="true"&gt;
        &lt;classes&gt;
           &lt;class name="tests.TestCase1" /&gt;
           &lt;class name="tests.TestCase2" /&gt;
           &lt;!-- more classes --&gt;
        &lt;/classes&gt;
     &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>This test suite is started programmatically with the following java code:  </p>
  
  <pre><code>TestListenerAdapter tla = new TestListenerAdapter();
  TestNG testng = new TestNG();
  List&lt;String&gt; testFilesList = new ArrayList&lt;String&gt;();
  testFilesList.add("./testng.xml");
  testng.setTestSuites(testFilesList);
  testng.setUseDefaultListeners(false);
  testng.addListener(tla); 
  testng.run();
  </code></pre>
  
  <p>If I now add a new test file e.g. <code>TestCase3</code> to the package <code>tests</code> I only have to add the respective line <code>&lt;class name="tests.TestCase2" /&gt;</code> to the xml file (this step will be automated later) and if I run my java program again the new test will also be executed.  </p>
  
  <p>However, if I export it as runnable jar, the test execution still works but I loose the ability to just drop new test cases in the package folder, since the <code>test</code> package obviously gets packed together with all the librarys into the .jar file and isn't represented by a folder anymore.  </p>
  
  <p>Is there a way to specify a path to a file in the <code>&lt;class&gt;</code> tag within the testng.xml file, like: <code>&lt;class name="/path/to/folder/TestCaseXY" /&gt;</code>, so I can just drop test files in that folder and run the .jar?<br>
  If not, is there another way to accomplish this?  </p>
  
  <p>Thanks for your help</p>