continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1672525 [2/2] - in /continuum/trunk: continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/ continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ continuum-buildagen...
Date Fri, 10 Apr 2015 00:02:32 GMT
Modified: continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
(original)
+++ continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Fri Apr 10 00:02:31 2015
@@ -20,6 +20,7 @@ package org.apache.maven.continuum.relea
  */
 
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
@@ -36,7 +37,6 @@ import org.codehaus.plexus.spring.Plexus
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
-import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
@@ -62,6 +62,8 @@ public class ReleaseTaskExecutorTest
 
     private ContinuumReleaseManager releaseManager;
 
+    private FileSystemManager fsManager;
+
     protected void setUp()
         throws Exception
     {
@@ -91,9 +93,15 @@ public class ReleaseTaskExecutorTest
         {
             releaseManager = (ContinuumReleaseManager) lookup( ContinuumReleaseManager.ROLE
);
         }
+
+        if ( fsManager == null )
+        {
+            fsManager = (FileSystemManager) lookup( FileSystemManager.class );
+        }
+
         File scmPath = new File( getBasedir(), "target/scm-src" ).getAbsoluteFile();
         File scmTargetPath = new File( getBasedir(), "target/scm-test" ).getAbsoluteFile();
-        FileUtils.copyDirectoryStructure( scmPath, scmTargetPath );
+        fsManager.copyDir( scmPath, scmTargetPath );
     }
 
     public void releaseSimpleProject()
@@ -101,9 +109,9 @@ public class ReleaseTaskExecutorTest
     {
         String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -114,19 +122,19 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/test-artifact-1.0"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>1.0</version>"
) > 0 );
     }
 
@@ -146,9 +154,9 @@ public class ReleaseTaskExecutorTest
     {
         String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -161,19 +169,19 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>2.1-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/test-artifact-2.0"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>2.0</version>"
) > 0 );
 
 /* CONTINUUM-2559
@@ -193,9 +201,9 @@ public class ReleaseTaskExecutorTest
     {
         String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -206,24 +214,24 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.2-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/test-artifact-1.1"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>1.1</version>"
) > 0 );
 
         rollbackExec.executeTask( new RollbackReleaseProjectTask( "testRelease", descriptor,
null ) );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test rollback version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
         assertFalse( "Test that release.properties has been cleaned", new File( workDir,
@@ -238,9 +246,9 @@ public class ReleaseTaskExecutorTest
     {
         String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -251,19 +259,19 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>2.1-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>2.2-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/test-artifact-2.1"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>2.1</version>"
) > 0 );
 
         File file = new File( descriptor.getWorkingDirectory(), "release.properties" );
@@ -309,9 +317,9 @@ public class ReleaseTaskExecutorTest
         String scmPath = new File( getBasedir(), "target/scm-test/continuum-1814" ).getAbsolutePath().replace(
'\\',
                                                                                         
                      '/' );
         File workDir = new File( getBasedir(), "target/test-classes/continuum-1814" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -322,19 +330,19 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.6-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.7-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/continuum-1814-1.6"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>1.6</version>"
) > 0 );
 
 /* CONTINUUM-2559
@@ -356,9 +364,9 @@ public class ReleaseTaskExecutorTest
         String scmPath = new File( getBasedir(), "target/scm-test/continuum-2610" ).getAbsolutePath().replace(
'\\',
                                                                                         
                      '/' );
         File workDir = new File( getBasedir(), "target/test-classes/continuum-2610" );
-        FileUtils.deleteDirectory( workDir );
+        fsManager.removeDir( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
-        FileUtils.deleteDirectory( testDir );
+        fsManager.removeDir( testDir );
 
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
@@ -370,31 +378,31 @@ public class ReleaseTaskExecutorTest
         ScmFileSet fileSet = new ScmFileSet( workDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        String pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test root dev version", pom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
-        String moduleAPom = FileUtils.fileRead( new File( workDir, "module-A/pom.xml" ) );
+        String moduleAPom = fsManager.fileContents( new File( workDir, "module-A/pom.xml"
) );
         assertTrue( "Test module A dev version", moduleAPom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
-        String moduleBPom = FileUtils.fileRead( new File( workDir, "module-B/pom.xml" ) );
+        String moduleBPom = fsManager.fileContents( new File( workDir, "module-B/pom.xml"
) );
         assertTrue( "Test module B dev version", moduleBPom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
 
         doPrepareWithNoError( descriptor );
 
-        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( workDir, "pom.xml" ) );
         assertTrue( "Test root version increment", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
-        moduleAPom = FileUtils.fileRead( new File( workDir, "module-A/pom.xml" ) );
+        moduleAPom = fsManager.fileContents( new File( workDir, "module-A/pom.xml" ) );
         assertTrue( "Test module A version increment", moduleAPom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
-        moduleBPom = FileUtils.fileRead( new File( workDir, "module-B/pom.xml" ) );
+        moduleBPom = fsManager.fileContents( new File( workDir, "module-B/pom.xml" ) );
         assertTrue( "Test module B version increment", moduleBPom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
         repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/continuum-2610-1.0"
);
         fileSet = new ScmFileSet( testDir );
         scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion)
null );
 
-        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
+        pom = fsManager.fileContents( new File( testDir, "pom.xml" ) );
         assertTrue( "Test root released version", pom.indexOf( "<version>1.0</version>"
) > 0 );
-        moduleAPom = FileUtils.fileRead( new File( testDir, "module-A/pom.xml" ) );
+        moduleAPom = fsManager.fileContents( new File( testDir, "module-A/pom.xml" ) );
         assertTrue( "Test module A released version", moduleAPom.indexOf( "<version>1.0</version>"
) > 0 );
-        moduleBPom = FileUtils.fileRead( new File( testDir, "module-B/pom.xml" ) );
+        moduleBPom = fsManager.fileContents( new File( testDir, "module-B/pom.xml" ) );
         assertTrue( "Test module B released version", moduleBPom.indexOf( "<version>1.0</version>"
) > 0 );
     }
 

Modified: continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
(original)
+++ continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
Fri Apr 10 00:02:31 2015
@@ -20,18 +20,22 @@ package org.apache.maven.continuum.relea
  */
 
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.release.phase.ReleasePhase;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
-import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
 
 public class UpdateWorkingCopyPhaseTest
     extends PlexusInSpringTestCase
 {
+    private FileSystemManager fsManager;
+
     private UpdateWorkingCopyPhase phase;
+
     private ContinuumReleaseDescriptor releaseDescriptor;
+
     private File workingDirectory;
 
     protected void setUp()
@@ -39,6 +43,8 @@ public class UpdateWorkingCopyPhaseTest
     {
         super.setUp();
 
+        fsManager = (FileSystemManager) lookup( FileSystemManager.class );
+
         phase = (UpdateWorkingCopyPhase) lookup( ReleasePhase.ROLE, "update-working-copy"
);
         assertNotNull( phase );
 
@@ -47,13 +53,13 @@ public class UpdateWorkingCopyPhaseTest
         workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
 
         // Ensure every test method starts with no working dir
-        FileUtils.deleteDirectory( workingDirectory );
+        fsManager.removeDir( workingDirectory );
         assertFalse( workingDirectory.exists() );
 
         // set up project scm
         File scmPathFile = new File( getBasedir(), "target/scm-src" ).getAbsoluteFile();
         File scmTargetPathFile = new File( getBasedir(), "/target/scm-test" ).getAbsoluteFile();
-        FileUtils.copyDirectoryStructure( scmPathFile, scmTargetPathFile );
+        fsManager.copyDir( scmPathFile, scmTargetPathFile );
     }
 
     public void testWorkingDirDoesNotExist()

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Fri Apr 10 00:02:31 2015
@@ -24,6 +24,7 @@ import org.apache.continuum.dao.ProjectD
 import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.dao.ScheduleDao;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -40,14 +41,14 @@ import org.codehaus.plexus.jdo.JdoFactor
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jpox.SchemaTool;
 
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -65,6 +66,8 @@ public abstract class AbstractContinuumT
 
     private ProjectScmRootDao projectScmRootDao;
 
+    private FileSystemManager fsManager;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -85,6 +88,8 @@ public abstract class AbstractContinuumT
 
         getProjectScmRootDao();
 
+        getFileSystemManager();
+
         setUpConfigurationService( (ConfigurationService) lookup( "configurationService"
) );
 
         Collection<ProjectGroup> projectGroups = projectGroupDao.getAllProjectGroupsWithProjects();
@@ -174,26 +179,12 @@ public abstract class AbstractContinuumT
 
         MemoryJdoFactory jdoFactory = (MemoryJdoFactory) o;
 
-//        jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl"
);
-//
-//        jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
-
         String url = "jdbc:hsqldb:mem:" + getClass().getName() + "." + getName();
 
         jdoFactory.setUrl( url );
 
         jdoFactory.reconfigure();
 
-//        jdoFactory.setUserName( "sa" );
-//
-//        jdoFactory.setPassword( "" );
-//
-//        jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_UNCOMMITTED" );
-//
-//        jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_UNCOMMITTED"
);
-//
-//        jdoFactory.setProperty( "org.jpox.autoCreateTables", "true" );
-
         // ----------------------------------------------------------------------
         // Check the configuration
         // ----------------------------------------------------------------------
@@ -219,7 +210,8 @@ public abstract class AbstractContinuumT
             System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
         }
 
-        SchemaTool.createSchemaTables( new URL[]{getClass().getResource( "/package.jdo" )},
new URL[]{}, null, false,
+        SchemaTool.createSchemaTables( new URL[] { getClass().getResource( "/package.jdo"
) }, new URL[] {}, null,
+                                       false,
                                        null );
 
         // ----------------------------------------------------------------------
@@ -265,6 +257,15 @@ public abstract class AbstractContinuumT
         return projectScmRootDao;
     }
 
+    public FileSystemManager getFileSystemManager()
+    {
+        if ( fsManager == null )
+        {
+            fsManager = (FileSystemManager) lookup( FileSystemManager.class );
+        }
+        return fsManager;
+    }
+
     // ----------------------------------------------------------------------
     // Build Executor
     // ----------------------------------------------------------------------
@@ -410,8 +411,6 @@ public abstract class AbstractContinuumT
     {
         assertEquals( "project.name", name, actual.getName() );
 
-//        assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
-
         if ( notifiers != null )
         {
             assertNotNull( "project.notifiers", actual.getNotifiers() );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
Fri Apr 10 00:02:31 2015
@@ -21,6 +21,7 @@ package org.apache.continuum.web.action;
 
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.model.release.ContinuumReleaseResult;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -28,7 +29,7 @@ import org.apache.maven.continuum.web.ac
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.shared.release.ReleaseResult;
 import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,6 +46,9 @@ public class ReleaseResultAction
 {
     private static final Logger logger = LoggerFactory.getLogger( ReleaseResultAction.class
);
 
+    @Requirement
+    private FileSystemManager fsManager;
+
     private int projectGroupId;
 
     private int releaseResultId;
@@ -155,7 +159,7 @@ public class ReleaseResultAction
 
             if ( releaseOutputFile.exists() )
             {
-                String str = StringEscapeUtils.escapeHtml( FileUtils.fileRead( releaseOutputFile
) );
+                String str = StringEscapeUtils.escapeHtml( fsManager.fileContents( releaseOutputFile
) );
                 result.appendOutput( str );
             }
         }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Fri Apr 10 00:02:31 2015
@@ -25,7 +25,7 @@ import com.opensymphony.xwork2.config.pr
 import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
-import org.apache.commons.io.FileUtils;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
@@ -33,8 +33,10 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.struts2.interceptor.ServletRequestAware;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -44,7 +46,6 @@ import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import javax.servlet.http.HttpServletRequest;
 
 /**
  * Action to add a Maven project to Continuum, either Maven 1 or Maven 2.
@@ -59,6 +60,9 @@ public abstract class AddMavenProjectAct
 
     private static final int DEFINED_BY_POM_GROUP_ID = -1;
 
+    @Requirement
+    private FileSystemManager fsManager;
+
     private String pomUrl;
 
     private File pomFile;
@@ -189,7 +193,7 @@ public abstract class AddMavenProjectAct
                     // CONTINUUM-1897
                     // File.c copyFile to tmp one
                     File tmpPom = File.createTempFile( "continuum_tmp", "tmp" );
-                    FileUtils.copyFile( pomFile, tmpPom );
+                    fsManager.copyFile( pomFile, tmpPom );
                     pom = tmpPom.toURL().toString();
                 }
                 catch ( MalformedURLException e )

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=1672525&r1=1672524&r2=1672525&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
Fri Apr 10 00:02:31 2015
@@ -23,6 +23,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.builder.utils.ContinuumBuildConstant;
 import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.utils.file.FileSystemManager;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
@@ -37,7 +38,6 @@ import org.apache.maven.continuum.web.ut
 import org.apache.struts2.ServletActionContext;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,6 +58,9 @@ public class BuildResultAction
     private static Logger log = LoggerFactory.getLogger( BuildResultAction.class );
 
     @Requirement
+    private FileSystemManager fsManager;
+
+    @Requirement
     private DistributedBuildManager distributedBuildManager;
 
     private Project project;
@@ -251,7 +254,7 @@ public class BuildResultAction
 
         if ( buildOutputFile.exists() )
         {
-            return FileUtils.fileRead( buildOutputFile );
+            return fsManager.fileContents( buildOutputFile );
         }
         return null;
     }



Mime
View raw message