Author: sebb
Date: Mon Jan 24 19:07:57 2011
New Revision: 1062924

URL: http://svn.apache.org/viewvc?rev=1062924&view=rev
Log:
Allow a single test to be run

Modified:
    
commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/FastMathStrictComparisonTest.java

Modified: 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/FastMathStrictComparisonTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/FastMathStrictComparisonTest.java?rev=1062924&r1=1062923&r2=1062924&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/FastMathStrictComparisonTest.java
 (original)
+++ 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/FastMathStrictComparisonTest.java
 Mon Jan 24 19:07:57 2011
@@ -32,6 +32,11 @@ import org.junit.runners.Parameterized.P
 
 /**
  * Test to compare FastMath results against StrictMath results for boundary 
values.
+ * <p>
+ * Running all tests independently: <br/>
+ * {@code mvn test -Dtest=FastMathStrictComparisonTest}<br/>
+ * or just run tests against a single method (e.g. scalb):<br/>
+ * {@code mvn test -Dtest=FastMathStrictComparisonTest 
-DargLine="-DtestMethod=scalb"}
  */
 @RunWith(Parameterized.class)
 public class FastMathStrictComparisonTest {
@@ -184,6 +189,7 @@ public class FastMathStrictComparisonTes
 
     @Parameters
     public static List<Object[]> data() throws Exception {
+        String singleMethod = System.getProperty("testMethod");
         List<Object[]> list = new ArrayList<Object[]>();
         for(Method mathMethod : StrictMath.class.getDeclaredMethods()) {
             method:
@@ -194,6 +200,9 @@ public class FastMathStrictComparisonTes
                         // Get the corresponding FastMath method
                         Method fastMethod = 
FastMath.class.getDeclaredMethod(mathMethod.getName(), (Class[]) types);
                         if (Modifier.isPublic(fastMethod.getModifiers())) { // 
It must be public too
+                            if (singleMethod != null && 
!fastMethod.getName().equals(singleMethod)) {
+                                break method;
+                            }
                             Object [][] values = new Object[types.length][];
                             int index = 0;
                             for(Type t : types) {


Reply via email to