maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1225833 - in /maven/core-integration-testing/trunk/core-it-suite/src: site/apt/index.apt site/apt/index.apt.vm test/java/org/apache/maven/it/IntegrationTestSuite.java
Date Fri, 30 Dec 2011 14:24:47 GMT
Author: hboutemy
Date: Fri Dec 30 14:24:47 2011
New Revision: 1225833

URL: http://svn.apache.org/viewvc?rev=1225833&view=rev
Log:
display environment used to run ITs in published site

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt.vm
      - copied, changed from r1225821, maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt
Removed:
    maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Copied: maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt.vm (from
r1225821, maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt)
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt.vm?p2=maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt.vm&p1=maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt&r1=1225821&r2=1225833&rev=1225833&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/site/apt/index.apt.vm Fri Dec 30
14:24:47 2011
@@ -30,6 +30,8 @@ Maven Core Integration Tests
 
   This module provides the {{{./testapidocs/org/apache/maven/it/package-summary.html}effective
Integration Tests suite}}.
 
+* Running the ITs
+
   By default, the project just packages the tests in an artifact. To actually run them, activate
the <<<run-its>>> profile:
   
 +----
@@ -60,3 +62,15 @@ mvn clean test -Prun-its -DmavenVersion=
   If you're behind a proxy, use the <<<proxy.host>>>, <<<proxy.port>>>,
<<<proxy.user>>> and <<<proxy.pass>>> system properties
   to specify the required proxy setup for the ITs. Alternatively, set the <<<maven.it.central>>>
system property to a URL of a local
   repository manager that proxies the required artifacts.
+
+* Results
+
+  ITs results are displayed on the console and can be published in the site through Surefire
Report.
+
++----
+mvn -Preporting site
++----
+
+  Currently deployed {{{./surefire-report.html}Surefire Report}} was generated with following
environment:
+
+%{snippet|file=${project.build.directory}/surefire-reports/info.txt}

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=1225833&r1=1225832&r2=1225833&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
(original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Fri Dec 30 14:24:47 2011
@@ -19,20 +19,34 @@ package org.apache.maven.it;
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.PrintStream;
 
+import org.codehaus.plexus.util.IOUtil;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+/**
+ * The Core IT suite.
+ */
 public class IntegrationTestSuite
     extends TestCase
 {
     private static PrintStream out = System.out;
 
+    private static void infoProperty( PrintStream info, String property )
+    {
+        info.println( property + ": " + System.getProperty( property ) );
+    }
+
     public static Test suite()
-        throws VerificationException
+        throws VerificationException, FileNotFoundException
     {
+        PrintStream info = null;
         Verifier verifier = null;
         try
         {
@@ -41,10 +55,18 @@ public class IntegrationTestSuite
 
             String executable = verifier.getExecutable();
 
-            out.println( "Running integration tests for Maven " + mavenVersion + "\n\tusing
Maven executable: " +
-                executable );
+            out.println( "Running integration tests for Maven " + mavenVersion );
+            out.println( "\tusing Maven executable: " + executable );
 
             System.setProperty( "maven.version", mavenVersion );
+
+            String basedir = System.getProperty( "basedir" );
+            info = new PrintStream( new FileOutputStream( new File( basedir, "target/surefire-reports/info.txt"
) ) );
+
+            infoProperty( info, "maven.version" );
+            infoProperty( info, "java.version" );
+            infoProperty( info, "os.name" );
+            infoProperty( info, "os.version" );
         }
         finally
         {
@@ -52,6 +74,7 @@ public class IntegrationTestSuite
             {
                 verifier.resetStreams();
             }
+            IOUtil.close( info );
         }
 
         TestSuite suite = new TestSuite();



Mime
View raw message