maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r598025 - in /maven/surefire/trunk: surefire-api/src/main/java/org/apache/maven/surefire/suite/ surefire-api/src/main/java/org/apache/maven/surefire/testset/ surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ surefire-i...
Date Sun, 25 Nov 2007 18:40:48 GMT
Author: dfabulich
Date: Sun Nov 25 10:40:47 2007
New Revision: 598025

URL: http://svn.apache.org/viewvc?rev=598025&view=rev
Log:
[SUREFIRE-47] suite was getting called twice, once during getTestCount.  But getTestCount
was useless, so I just deleted it.

Modified:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/SurefireTestSet.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestFailIfNoTestsForkMode.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/default-configuration/src/test/java/BasicTest.java
    maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
    maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4TestSet.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/suite/AbstractDirectoryTestSuite.java
Sun Nov 25 10:40:47 2007
@@ -103,7 +103,7 @@
                 }
                 testSets.put( testSet.getName(), testSet );
 
-                totalTests += testSet.getTestCount();
+                totalTests++;
             }
         }
 

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/PojoTestSet.java
Sun Nov 25 10:40:47 2007
@@ -246,14 +246,6 @@
     {
     }
 
-    public int getTestCount()
-        throws TestSetFailedException
-    {
-        discoverTestMethods();
-
-        return testMethods.size();
-    }
-
     private void discoverTestMethods()
     {
         if ( testMethods == null )

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/SurefireTestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/SurefireTestSet.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/SurefireTestSet.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/SurefireTestSet.java
Sun Nov 25 10:40:47 2007
@@ -26,9 +26,6 @@
     void execute( ReporterManager reportManager, ClassLoader loader )
         throws TestSetFailedException;
 
-    int getTestCount()
-        throws TestSetFailedException;
-
     String getName();
 
     Class getTestClass();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestFailIfNoTestsForkMode.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestFailIfNoTestsForkMode.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestFailIfNoTestsForkMode.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestFailIfNoTestsForkMode.java
Sun Nov 25 10:40:47 2007
@@ -76,8 +76,7 @@
         else
         {
             verifier.verifyErrorFreeLog();
-            File reportsDir = new File( testDir, "target/surefire-reports" );
-            assertFalse ( "Unexpected reports directory", reportsDir.exists() );
+            HelperAssertions.assertTestSuiteResults( 0, 0, 0, 0, testDir );
         }
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/resources/default-configuration/src/test/java/BasicTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/default-configuration/src/test/java/BasicTest.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/default-configuration/src/test/java/BasicTest.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/default-configuration/src/test/java/BasicTest.java
Sun Nov 25 10:40:47 2007
@@ -18,6 +18,7 @@
 
     public static Test suite()
     {
+        System.out.println("suite");
         TestSuite suite = new TestSuite();
         Test test = new BasicTest( "testSetUp", "dummy" );
         suite.addTest( test );

Modified: maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
Sun Nov 25 10:40:47 2007
@@ -238,44 +238,6 @@
         }
     }
 
-    public int getTestCount()
-        throws TestSetFailedException
-    {
-        Class testClass = getTestClass();
-        try
-        {
-            Object testObject = constructTestObject( testClass );
-
-            Integer integer = (Integer) countTestCasesMethod.invoke( testObject, EMPTY_CLASS_ARRAY
);
-
-            return integer.intValue();
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new TestSetFailedException( testClass.getName(), e );
-        }
-        catch ( IllegalArgumentException e )
-        {
-            throw new TestSetFailedException( testClass.getName(), e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            throw new TestSetFailedException( testClass.getName(), e.getTargetException()
);
-        }
-        catch ( InstantiationException e )
-        {
-            throw new TestSetFailedException( testClass.getName(), e );
-        }
-        catch ( ClassNotFoundException e )
-        {
-            throw new TestSetFailedException( "JUnit classes not available", e );
-        }
-        catch ( NoSuchMethodException e )
-        {
-            throw new TestSetFailedException( "Class is not a JUnit TestCase", e );
-        }
-    }
-
     private static Constructor getTestConstructor( Class testClass )
         throws NoSuchMethodException
     {

Modified: maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4TestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4TestSet.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4TestSet.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4TestSet.java
Sun Nov 25 10:40:47 2007
@@ -67,14 +67,4 @@
         }
     }
 
-    /**
-     * Returns the number of tests to be run in this class.
-     *
-     * @see org.apache.maven.surefire.testset.SurefireTestSet#getTestCount()
-     */
-    public int getTestCount()
-        throws TestSetFailedException
-    {
-        return junitTestRunner.testCount();
-    }
 }

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java?rev=598025&r1=598024&r2=598025&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java
Sun Nov 25 10:40:47 2007
@@ -41,13 +41,6 @@
         super( testClass );
     }
 
-    public int getTestCount()
-        throws TestSetFailedException
-    {
-        // TODO: need to get this from TestNG somehow
-        return 1;
-    }
-
     public void execute( ReporterManager reportManager, ClassLoader loader )
     {
         throw new UnsupportedOperationException(



Mime
View raw message