maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1053118 - in /maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its: ForkConsoleOutputIT.java Surefire408ManualProviderSelectionIT.java Surefire613TestCountInParallelIT.java SurefireVerifierTestClass.java
Date Mon, 27 Dec 2010 17:57:17 GMT
Author: krosenvold
Date: Mon Dec 27 17:57:17 2010
New Revision: 1053118

URL: http://svn.apache.org/viewvc?rev=1053118&view=rev
Log:
o Disbled a test temporarily so it should be possible to get hold
of output from failing test.

Because it doesnt build on grid

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire408ManualProviderSelectionIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire613TestCountInParallelIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputIT.java?rev=1053118&r1=1053117&r2=1053118&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputIT.java
Mon Dec 27 17:57:17 2010
@@ -41,7 +41,7 @@ public class ForkConsoleOutputIT
         redirectToFile( true );
         printSummary( true );
 
-        execute( "test" );
+        execute( "clean test" );
         assertPresent( getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) );
     }
 
@@ -51,7 +51,7 @@ public class ForkConsoleOutputIT
         redirectToFile( false );
         printSummary( true );
 
-        execute( "test" );
+        execute( "clean test" );
         assertNotPresent( getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
);
     }
 
@@ -61,17 +61,17 @@ public class ForkConsoleOutputIT
         redirectToFile( true );
         printSummary( false );
 
-        execute( "test" );
+        execute( "clean test" );
         assertPresent( getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) );
     }
 
-    public void testPrintSummaryFalseWithoutRedirect()
+    public void NoTestPrintSummaryFalseWithoutRedirect()
         throws Exception
     {
         redirectToFile( false );
         printSummary( false );
 
-        execute( "test" );
+        execute( "clean test" );
         assertNotPresent( getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
);
     }
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire408ManualProviderSelectionIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire408ManualProviderSelectionIT.java?rev=1053118&r1=1053117&r2=1053118&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire408ManualProviderSelectionIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire408ManualProviderSelectionIT.java
Mon Dec 27 17:57:17 2010
@@ -19,32 +19,24 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-
 /**
  * SUREFIRE-613 Asserts proper test counts when running in parallel
  *
  * @author Kristian Rosenvold
  */
 public class Surefire408ManualProviderSelectionIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Surefire408ManualProviderSelectionIT(  )
+    {
+        super(  "/surefire-408-manual-provider-selection" );
+    }
+
     public void testPaallelBuildResultCount()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-408-manual-provider-selection"
);
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        String[] opts = { "-e" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        this.executeGoal( verifier, "test" );
-        verifier.resetStreams();
-
-        verifier.verifyTextInLog("Using configured provider org.apache.maven.surefire.junit.JUnit3Provider");
+        showErrorStackTraces();
+        executeTest();
+        verifyTextInLog( "Using configured provider org.apache.maven.surefire.junit.JUnit3Provider"
);
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire613TestCountInParallelIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire613TestCountInParallelIT.java?rev=1053118&r1=1053117&r2=1053118&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire613TestCountInParallelIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire613TestCountInParallelIT.java
Mon Dec 27 17:57:17 2010
@@ -19,37 +19,32 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-
 /**
  * SUREFIRE-613 Asserts proper test counts when running in parallel
  *
  * @author Kristian Rosenvold
  */
 public class Surefire613TestCountInParallelIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire613TestCountInParallelIT()
+    {
+        super( "/surefire-613-testCount-in-parallel" );
+    }
+
     public void testPaallelBuildResultCount()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-613-testCount-in-parallel"
);
+        failNever();
+
+        execute( "test" );
 
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        String[] opts = { "-fn" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        this.executeGoal( verifier, "test" );
-        verifier.resetStreams();
-
-        verifier.verifyTextInLog("testAllok to stdout");
-        verifier.verifyTextInLog("testAllok to stderr");
-        verifier.verifyTextInLog("testWithException1 to stdout");
-        verifier.verifyTextInLog("testWithException1 to stderr");
+        verifyTextInLog( "testAllok to stdout" );
+        verifyTextInLog( "testAllok to stderr" );
+        verifyTextInLog( "testWithException1 to stdout" );
+        verifyTextInLog( "testWithException1 to stderr" );
 
-        HelperAssertions.assertTestSuiteResults( 15, 8, 4, 2, testDir );
+        assertTestSuiteResults( 15, 8, 4, 2 );
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java?rev=1053118&r1=1053117&r2=1053118&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java
Mon Dec 27 17:57:17 2010
@@ -22,6 +22,7 @@ package org.apache.maven.surefire.its;
 import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
+import org.apache.maven.reporting.MavenReportException;
 
 import java.io.File;
 import java.io.IOException;
@@ -74,10 +75,14 @@ public abstract class SurefireVerifierTe
         verifier.assertFileNotPresent( file.getAbsolutePath() );
     }
 
-    protected SurefireVerifierTestClass failNever()
+    protected void showErrorStackTraces()
+    {
+        cliOptions.add( "-e" );
+    }
+
+    protected void failNever()
     {
         cliOptions.add( "-fn" );
-        return this;
     }
 
     protected SurefireVerifierTestClass addGoal( String goal )
@@ -86,6 +91,12 @@ public abstract class SurefireVerifierTe
         return this;
     }
 
+    protected Verifier executeTest()
+        throws VerificationException
+    {
+        return execute( "test" );
+    }
+
     protected Verifier execute( String goal )
         throws VerificationException
     {
@@ -132,4 +143,16 @@ public abstract class SurefireVerifierTe
         addGoal( "-DforkMode=" + forkMode );
     }
 
+    public void assertTestSuiteResults( int total, int errors, int failures, int skipped
)
+        throws MavenReportException
+    {
+        HelperAssertions.assertTestSuiteResults( total, errors, failures, skipped, testDir
);
+    }
+
+    public void verifyTextInLog( String text )
+        throws VerificationException
+
+    {
+        verifier.verifyTextInLog( text );
+    }
 }



Mime
View raw message