continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1660710 - in /continuum/trunk: continuum-commons/src/main/java/org/apache/maven/continuum/configuration/ continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/ continuum-core/src/main/java/org/apache/maven/continuum/executi...
Date Wed, 18 Feb 2015 19:52:53 GMT
Author: batkinson
Date: Wed Feb 18 19:52:53 2015
New Revision: 1660710

URL: http://svn.apache.org/r1660710
Log:
Moved test directory creation into configuration service.

Modified:
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=1660710&r1=1660709&r2=1660710&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Wed Feb 18 19:52:53 2015
@@ -561,11 +561,15 @@ public class DefaultConfigurationService
     public File getTestReportsDirectory( int buildId, int projectId )
         throws ConfigurationException
     {
-        File ouputDirectory = getBuildOutputDirectory( projectId );
-
-        return new File(
-            ouputDirectory.getPath() + File.separatorChar + buildId + File.separatorChar
+ "surefire-reports" );
-
+        File outputDirectory = getBuildOutputDirectory( projectId );
+        File testDir = new File( outputDirectory.getPath() + File.separator + buildId + File.separator
+
+                                     "surefire-reports" );
+        if ( !testDir.exists() && !testDir.mkdirs() )
+        {
+            throw new ConfigurationException(
+                String.format( "Could not make the test reports directory: '%s'.", testDir.getAbsolutePath()
) );
+        }
+        return testDir;
     }
 
     public File getBuildOutputFile( int buildId, int projectId )

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=1660710&r1=1660709&r2=1660710&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
Wed Feb 18 19:52:53 2015
@@ -163,10 +163,6 @@ public class AntBuildExecutor
         try
         {
             File backupDirectory = configurationService.getTestReportsDirectory( buildId,
project.getId() );
-            if ( !backupDirectory.exists() )
-            {
-                backupDirectory.mkdirs();
-            }
             testReportArchiver.archiveReports(
                 getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot
),
                 backupDirectory );

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=1660710&r1=1660709&r2=1660710&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Wed Feb 18 19:52:53 2015
@@ -349,10 +349,6 @@ public class MavenTwoBuildExecutor
         try
         {
             backupDirectory = configurationService.getTestReportsDirectory( buildId, project.getId()
);
-            if ( !backupDirectory.exists() )
-            {
-                backupDirectory.mkdirs();
-            }
             testReportArchiver.archiveReports(
                 getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot
),
                 backupDirectory );



Mime
View raw message