private static String getConfiguratorName( ArtifactVersion version )
throws MojoExecutionException
{
try
{
VersionRange range = VersionRange.createFromVersionSpec( "[4.7,5.1]" );
if ( range.containsVersion( version ) )
{
return "org.apache.maven.surefire.testng.conf.TestNG4751Configurator";
}
range = VersionRange.createFromVersionSpec( "[5.2]" );
if ( range.containsVersion( version ) )
{
return "org.apache.maven.surefire.testng.conf.TestNG52Configurator";
}
range = VersionRange.createFromVersionSpec( "[5.3,6.4]" );
if ( range.containsVersion( version ) )
{
return "org.apache.maven.surefire.testng.conf.TestNGMapConfigurator";
}
range = VersionRange.createFromVersionSpec( "[6.5,)" );
if ( range.containsVersion( version ) )
{
return "org.apache.maven.surefire.testng.conf.TestNG652Configurator";
}
throw new MojoExecutionException( "Unknown TestNG version " + version );