public static void run( Class[] testClasses, String testSourceDirectory, Map options, RunListener reportManager,
TestNgTestSuite suite, File reportsDirectory, final String methodNamePattern )
throws TestSetFailedException
{
TestNG testng = new TestNG( true );
applyGroupMatching( testng, options );
if ( !StringUtils.isBlank( methodNamePattern ) )
{
applyMethodNameFiltering( testng, methodNamePattern );
}
Configurator configurator = getConfigurator( (String) options.get("testng.configurator" ) );
System.out.println( "Configuring TestNG with: " + configurator.getClass().getSimpleName() );
configurator.configure( testng, options );
postConfigure( testng, testSourceDirectory, reportManager, suite, reportsDirectory );
testng.setTestClasses( testClasses );
testng.run();
}