You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2012/08/11 21:21:13 UTC
svn commit: r1372000 - in
/maven/surefire/trunk/surefire-providers/surefire-testng/src:
main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java
Author: krosenvold
Date: Sat Aug 11 19:21:13 2012
New Revision: 1372000
URL: http://svn.apache.org/viewvc?rev=1372000&view=rev
Log:
[SUREFIRE-899] Support TestNG order-by-instances property
Modified:
maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
maven/surefire/trunk/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java
Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java?rev=1372000&r1=1371999&r2=1372000&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java Sat Aug 11 19:21:13 2012
@@ -89,6 +89,10 @@ public class TestNGMapConfigurator
{
val = convert( val, Boolean.class );
}
+ else if ( "group-by-instances".equals( key ) )
+ {
+ val = convert( val, Boolean.class );
+ }
else if ( ProviderParameterNames.THREADCOUNT_PROP.equals( key ) )
{
val = convert( val, String.class );
Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java?rev=1372000&r1=1371999&r2=1372000&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java Sat Aug 11 19:21:13 2012
@@ -22,6 +22,8 @@ package org.apache.maven.surefire.testng
import java.util.HashMap;
import java.util.Map;
+import org.apache.maven.surefire.testset.TestSetFailedException;
+
import junit.framework.TestCase;
/**
@@ -33,12 +35,25 @@ public class TestNGMapConfiguratorTest
public void testGetConvertedOptions()
throws Exception
{
- TestNGMapConfigurator testNGMapConfigurator = new TestNGMapConfigurator();
- Map raw = new HashMap();
- raw.put( "mixed", "true" );
- Map convertedOptions = testNGMapConfigurator.getConvertedOptions( raw );
+ Map convertedOptions = getConvertedOptions( "mixed", "true" );
Boolean bool = (Boolean) convertedOptions.get( "-mixed" );
assertTrue( bool.booleanValue() );
+ }
+
+ public void testGroupByInstances()
+ throws Exception
+ {
+ Map convertedOptions = getConvertedOptions( "group-by-instances", "true" );
+ Boolean bool = (Boolean) convertedOptions.get( "-group-by-instances" );
+ assertTrue( bool.booleanValue() );
+ }
+ private Map getConvertedOptions( String key, String value )
+ throws TestSetFailedException
+ {
+ TestNGMapConfigurator testNGMapConfigurator = new TestNGMapConfigurator();
+ Map raw = new HashMap();
+ raw.put( key, value );
+ return testNGMapConfigurator.getConvertedOptions( raw );
}
}