You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ds...@apache.org on 2010/08/11 17:40:28 UTC

svn commit: r984448 - /felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java

Author: dsavage
Date: Wed Aug 11 15:40:28 2010
New Revision: 984448

URL: http://svn.apache.org/viewvc?rev=984448&view=rev
Log:
override runTests vs run(TestResult) so test counting works as expected

Modified:
    felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java

Modified: felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java?rev=984448&r1=984447&r2=984448&view=diff
==============================================================================
--- felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java (original)
+++ felix/trunk/sigil/gogo/junit/src/org/apache/felix/sigil/gogo/junit/SigilTestAdapter.java Wed Aug 11 15:40:28 2010
@@ -22,10 +22,8 @@ package org.apache.felix.sigil.gogo.juni
 import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 
-import junit.framework.AssertionFailedError;
 import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestResult;
 import junit.framework.TestSuite;
 
 import org.osgi.service.command.CommandSession;
@@ -38,13 +36,7 @@ public class SigilTestAdapter
     {
         return new TestCase( name )
         {
-            public int countTestCases()
-            {
-                return 1;
-            }
-
-
-            public void run( TestResult result )
+            public void runTest() throws Throwable
             {
                 try
                 {
@@ -52,23 +44,7 @@ public class SigilTestAdapter
                 }
                 catch ( InvocationTargetException e )
                 {
-                    Throwable c = e.getCause();
-                    if ( c instanceof AssertionFailedError )
-                    {
-                        result.addFailure( this, ( AssertionFailedError ) c );
-                    }
-                    else
-                    {
-                        result.addError( this, c );
-                    }
-                }
-                catch ( AssertionFailedError e )
-                {
-                    result.addFailure( this, e );
-                }
-                catch ( Throwable t )
-                {
-                    result.addError( this, t );
+                    throw e.getCause();
                 }
             }
         };