Java Code Examples for org.testng.TestNG#setOutputDirectory()

The following examples show how to use org.testng.TestNG#setOutputDirectory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestNgExecutor.java    From testgrid with Apache License 2.0 5 votes vote down vote up
@Override
public void execute(String jarFilePath, DeploymentCreationResult deploymentCreationResult) {
    File jarFile = new File(jarFilePath);
    String jarName = jarFile.getName().substring(0, jarFile.getName().lastIndexOf("."));

    loadJarToClasspath(jarFile);

    TestNG testng = new TestNG();
    testng.setTestJar(jarFilePath);
    testng.setOutputDirectory(Paths.get(testsLocation, "Results", "TestNG" + jarName).toString());
    testng.run();
}
 
Example 2
Source File: AbstractConfigurationReader.java    From xframium-java with GNU General Public License v3.0 5 votes vote down vote up
protected void runTest( String outputFolder, Class theTest, SuiteContainer sC )
{
    int threadCount = Integer.parseInt( System.getProperty( "xF-ThreadCount", "10" ) );
    int verboseLevel = Integer.parseInt( System.getProperty( "xF-VerboseLevel", "10" ) );
    
    TestNG testNg = new TestNG( true );
    testNg.setVerbose( verboseLevel );
    testNg.setThreadCount( threadCount );
    testNg.setDataProviderThreadCount( threadCount );
    testNg.setOutputDirectory( outputFolder + System.getProperty( "file.separator" ) + "testNg" );
    testNg.setTestClasses( new Class[] { theTest } );
    testNg.run();

}
 
Example 3
Source File: TestNGMainClass.java    From journaldev with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	TestNG testSuite = new TestNG();
	testSuite.setTestClasses(new Class[] { Test5.class });
	testSuite.addListener(new Test5SuiteListener());
	testSuite.setDefaultSuiteName("My Test Suite");
	testSuite.setDefaultTestName("My Test");
	testSuite.setOutputDirectory("/Users/pankaj/temp/testng-output");
	testSuite.run();
}
 
Example 4
Source File: CobarTestNGTestsRunner.java    From cobarclient with Apache License 2.0 5 votes vote down vote up
/**
 * @param args
 */
public static void main(String[] args) {
    BasicConfigurator.configure();
    Logger.getRootLogger().setLevel(Level.INFO);

    TestNG testng = new TestNG();

    List<String> suites = new ArrayList<String>();
    suites.add("src/test/resources/testng.xml");
    testng.setTestSuites(suites);
    testng.setOutputDirectory("target/test-output");
    testng.run();
}