All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.qytera.qtaf.testng.QtafTestNGRunner Maven / Gradle / Ivy

There is a newer version: 0.2.23
Show newest version
package de.qytera.qtaf.testng;

import de.qytera.qtaf.core.guice.QtafModule;
import de.qytera.qtaf.testng.event_listener.TestNGEventListener;
import de.qytera.qtaf.testng.test_factory.TestNGFactory;
import org.testng.TestNG;
import org.testng.annotations.Guice;

import java.util.Collections;

/**
 * Main class for running TestNG tests.
 */
@Guice(modules = {QtafModule.class})
public class QtafTestNGRunner {
    /**
     * Main method for running TestNG tests.
     *
     * @param args (command line) arguments
     */
    public static void main(String[] args) {
        // Create TestNG instance
        TestNG testNG = new TestNG();

        // Add listener
        testNG.setListenerClasses(Collections.singletonList(TestNGEventListener.class));

        // Add test classes
        testNG.setTestClasses(new Class[]{
                TestNGFactory.class
        });

        // Run tests
        testNG.run();

        // Exit after tests
        System.exit(0);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy