I have some TestNG
based LeanFT
test cases and try to generate jar
file. I use IntelliJ IDEA
to set artifact's details under File -> Project Structure -> Project Settings -> Artifacts -> Jar -> From modules with dependencies
. I select classname, but get error, that is not acceptable.
UPDATE 2018.05.03. I created main method in a new class, but got same error message.
import org.testng.TestNG;
import org.testng.xml.Parser;
import org.testng.xml.XmlSuite;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.util.List;
public class LeanFTest {
public void main() throws IOException, SAXException, ParserConfigurationException {
TestNG testNG = new TestNG();
String xmlFileName = "testng.xml";
List<XmlSuite> suite = (List<XmlSuite>)(new Parser(xmlFileName).parse());
testNG.setXmlSuites(suite);
testNG.run();
}
}