public class RunTests {
public static void main(String[] args) {
TestNG testNG = new TestNG();
List<String> suites = Lists.newArrayList();
File xml = new File("xml.xml");
suites.add(xml.getAbsolutePath());
testNG.setTestSuites(suites);
testNG.run();
}
}
My Java project has the default src folder, and a separate folder I created called "config". config holds a package called "pkg" with the java class "RunClass" as well as xml files that run tries to refer to.
ProjectName
src
config
pkg
RunClass
file.xml
I added config to the list of sources in the build path, yet RunClass still complains about not being able to find the file.
It gives:
java.io.FileNotFoundException: C:\Users\asdf\eclipse-workspace\NG\xml.xml (The system cannot find the file specified)