continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r649746 - /continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
Date Sat, 19 Apr 2008 03:12:36 GMT
Author: carlos
Date: Fri Apr 18 20:12:35 2008
New Revision: 649746

URL: http://svn.apache.org/viewvc?rev=649746&view=rev
Log:
Encapsulate field for testing

Modified:
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java?rev=649746&r1=649745&r2=649746&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
Fri Apr 18 20:12:35 2008
@@ -40,6 +40,16 @@
      */
     private ConfigurationService configurationService;
 
+    public void setConfigurationService( ConfigurationService configurationService )
+    {
+        this.configurationService = configurationService;
+    }
+
+    public ConfigurationService getConfigurationService()
+    {
+        return configurationService;
+    }
+
     // ----------------------------------------------------------------------
     // WorkingDirectoryService Implementation
     // ----------------------------------------------------------------------
@@ -63,10 +73,10 @@
         {
             // clean the project working directory path if it's a subdirectory of the global
working directory
             if ( projectWorkingDirectory.getAbsolutePath().startsWith(
-                configurationService.getWorkingDirectory().getAbsolutePath() ) )
+                getConfigurationService().getWorkingDirectory().getAbsolutePath() ) )
             {
                 String pwd = projectWorkingDirectory.getAbsolutePath().substring(
-                    configurationService.getWorkingDirectory().getAbsolutePath().length()
);
+                    getConfigurationService().getWorkingDirectory().getAbsolutePath().length()
);
                 if ( pwd.startsWith( "/" ) || pwd.startsWith( "\\" ) )
                 {
                     pwd = pwd.substring( 1 );
@@ -78,7 +88,7 @@
         }
         else
         {
-            workDir = new File( configurationService.getWorkingDirectory(), project.getWorkingDirectory()
);
+            workDir = new File( getConfigurationService().getWorkingDirectory(), project.getWorkingDirectory()
);
         }
         return workDir;
     }



Mime
View raw message