continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r678639 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/ continuum-api/src/main/java/org/apache/continuum/configuration/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-base/continuum-...
Date Tue, 22 Jul 2008 05:04:28 GMT
Author: evenisse
Date: Mon Jul 21 22:04:26 2008
New Revision: 678639

URL: http://svn.apache.org/viewvc?rev=678639&view=rev
Log:
Enable continuum-configuration

Added:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/ContinuumConfiguration.java
      - copied unchanged from r678344, continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ContinuumConfiguration.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/ContinuumConfigurationException.java
      - copied unchanged from r677275, continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ContinuumConfigurationException.java
    continuum/trunk/continuum-commons/src/main/resources/
    continuum/trunk/continuum-commons/src/main/resources/META-INF/
    continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml   (with props)
    continuum/trunk/continuum-commons/src/test/resources/META-INF/
    continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/
    continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml   (with props)
    continuum/trunk/continuum-commons/src/test/resources/conf/
    continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml   (with props)
    continuum/trunk/continuum-commons/src/test/resources/log4j.xml   (with props)
    continuum/trunk/continuum-release/src/test/resources/
    continuum/trunk/continuum-release/src/test/resources/META-INF/
    continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/
    continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml   (with props)
Removed:
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ContinuumConfigurationException.java
    continuum/trunk/continuum-commons/src/test/resources/configuration.xml
Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    continuum/trunk/continuum-base/continuum-configuration/pom.xml
    continuum/trunk/continuum-commons/pom.xml
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
    continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/configuration/ConfigurationServiceTest.xml
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
    continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml
    continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
    continuum/trunk/continuum-release/pom.xml
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
    continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java Mon Jul 21 22:04:26 2008
@@ -19,11 +19,12 @@
  * under the License.
  */
 
-import java.io.File;
-
+import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
+import java.io.File;
+
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -33,7 +34,7 @@
     String ROLE = ConfigurationService.class.getName();
 
     public static final String DEFAULT_SCHEDULE_NAME = "DEFAULT_SCHEDULE";
-    
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -83,12 +84,12 @@
 
     boolean isLoaded();
 
-    void load()
-        throws ConfigurationLoadingException;
+    void reload()
+        throws ConfigurationLoadingException, ContinuumConfigurationException;
 
     void store()
-        throws ConfigurationStoringException;
-    
+        throws ConfigurationStoringException, ContinuumConfigurationException;
+
     Schedule getDefaultSchedule()
-        throws ContinuumStoreException, ConfigurationLoadingException;
+        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException;
 }

Modified: continuum/trunk/continuum-base/continuum-configuration/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/pom.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/pom.xml (original)
+++ continuum/trunk/continuum-base/continuum-configuration/pom.xml Mon Jul 21 22:04:26 2008
@@ -48,6 +48,10 @@
   </build>
   <dependencies>
     <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-api</artifactId>
+    </dependency>
+    <dependency>
       <groupId>commons-configuration</groupId>
       <artifactId>commons-configuration</artifactId>
     </dependency>

Modified: continuum/trunk/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/pom.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/pom.xml (original)
+++ continuum/trunk/continuum-commons/pom.xml Mon Jul 21 22:04:26 2008
@@ -35,6 +35,10 @@
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-store</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-configuration</artifactId>
+    </dependency>
     <!-- === Testing Dependencies === -->
     <dependency>
       <groupId>hsqldb</groupId>
@@ -60,6 +64,22 @@
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>appserver.base</name>
+              <value>${basedir}/target/test-classes/</value>
+            </property>
+            <property>
+              <name>user.home</name>
+              <value>${basedir}/target/test-classes/</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-maven-plugin</artifactId>
         <executions>

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=678639&r1=678638&r2=678639&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 Mon Jul 21 22:04:26 2008
@@ -19,25 +19,29 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-
+import org.apache.continuum.configuration.ContinuumConfiguration;
+import org.apache.continuum.configuration.ContinuumConfigurationException;
+import org.apache.continuum.configuration.GeneralConfiguration;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
- * @plexus.component role="org.apache.maven.continuum.configuration.ConfigurationService"
  */
 public class DefaultConfigurationService
-    extends AbstractLogEnabled
     implements ConfigurationService
 {
+    private Logger log = LoggerFactory.getLogger( this.getClass() );
 
     // when adding requirement the template in application.xml must be updated CONTINUUM-1207
 
@@ -46,12 +50,18 @@
      */
     private File applicationHome;
 
-
     /**
      * @plexus.requirement role-hint="jdo"
      */
     private ContinuumStore store;
 
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumConfiguration configuration;
+
+    private GeneralConfiguration generalConfiguration;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -59,14 +69,16 @@
     private SystemConfiguration systemConf;
 
     private boolean loaded = false;
-    
 
-    
-    
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
+    public void initialize()
+        throws ConfigurationLoadingException, ContinuumConfigurationException
+    {
+        loadData();
+    }
 
     public void setStore( ContinuumStore store )
     {
@@ -78,11 +90,26 @@
         return store;
     }
 
+    public ContinuumConfiguration getConfiguration()
+    {
+        return configuration;
+    }
+
+    public void setConfiguration( ContinuumConfiguration configuration )
+    {
+        this.configuration = configuration;
+    }
+
     public File getApplicationHome()
     {
         return applicationHome;
     }
 
+    public void setApplicationHome( File applicationHome )
+    {
+        this.applicationHome = applicationHome;
+    }
+
     public void setInitialized( boolean initialized )
     {
         systemConf.setInitialized( initialized );
@@ -95,24 +122,29 @@
 
     public String getUrl()
     {
-        if ( systemConf.getBaseUrl() != null )
-        {
-            return systemConf.getBaseUrl();
-        }
-        else
+        String baseUrl = generalConfiguration.getBaseUrl();
+        if ( StringUtils.isEmpty( baseUrl ) )
         {
-            return "";
+            baseUrl = systemConf.getBaseUrl();
+            setUrl( baseUrl );
         }
+        return baseUrl != null ? baseUrl : "";
     }
 
     public void setUrl( String url )
     {
-        systemConf.setBaseUrl( url );
+        generalConfiguration.setBaseUrl( url );
     }
 
     public File getBuildOutputDirectory()
     {
-        return getFile( systemConf.getBuildOutputDirectory() );
+        File buildOutputDirectory = generalConfiguration.getBuildOutputDirectory();
+        if ( buildOutputDirectory == null )
+        {
+            buildOutputDirectory = getFile( systemConf.getBuildOutputDirectory() );
+            setBuildOutputDirectory( buildOutputDirectory );
+        }
+        return buildOutputDirectory;
     }
 
     public void setBuildOutputDirectory( File buildOutputDirectory )
@@ -125,12 +157,18 @@
         catch ( IOException e )
         {
         }
-        systemConf.setBuildOutputDirectory( f.getAbsolutePath() );
+        generalConfiguration.setBuildOutputDirectory( f );
     }
 
     public File getWorkingDirectory()
     {
-        return getFile( systemConf.getWorkingDirectory() );
+        File workingDirectory = generalConfiguration.getWorkingDirectory();
+        if ( workingDirectory == null )
+        {
+            workingDirectory = getFile( systemConf.getWorkingDirectory() );
+            setWorkingDirectory( workingDirectory );
+        }
+        return workingDirectory;
     }
 
     public void setWorkingDirectory( File workingDirectory )
@@ -144,18 +182,23 @@
         {
         }
 
-        systemConf.setWorkingDirectory( f.getAbsolutePath() );
+        generalConfiguration.setWorkingDirectory( f );
     }
 
     public File getDeploymentRepositoryDirectory()
     {
-        return getFile( systemConf.getDeploymentRepositoryDirectory() );
+        File deploymentDirectory = generalConfiguration.getDeploymentRepositoryDirectory();
+        if ( deploymentDirectory == null )
+        {
+            deploymentDirectory = getFile( systemConf.getDeploymentRepositoryDirectory() );
+            setDeploymentRepositoryDirectory( deploymentDirectory );
+        }
+        return deploymentDirectory;
     }
 
     public void setDeploymentRepositoryDirectory( File deploymentRepositoryDirectory )
     {
-        systemConf.setDeploymentRepositoryDirectory(
-            deploymentRepositoryDirectory != null ? deploymentRepositoryDirectory.getAbsolutePath() : null );
+        generalConfiguration.setDeploymentRepositoryDirectory( deploymentRepositoryDirectory );
     }
 
     public String getBuildOutput( int buildId, int projectId )
@@ -176,7 +219,7 @@
         }
         catch ( IOException e )
         {
-            getLogger().warn( "Error reading build output for build '" + buildId + "'.", e );
+            log.warn( "Error reading build output for build '" + buildId + "'.", e );
 
             return null;
         }
@@ -268,9 +311,12 @@
         return loaded;
     }
 
-    public void load()
-        throws ConfigurationLoadingException
+
+    private void loadData()
+        throws ConfigurationLoadingException, ContinuumConfigurationException
     {
+        generalConfiguration = configuration.getGeneralConfiguration();
+
         try
         {
             systemConf = getStore().getSystemConfiguration();
@@ -290,9 +336,18 @@
         }
     }
 
+    public void reload()
+        throws ConfigurationLoadingException, ContinuumConfigurationException
+    {
+        configuration.reload();
+        loadData();
+    }
+
     public void store()
-        throws ConfigurationStoringException
+        throws ConfigurationStoringException, ContinuumConfigurationException
     {
+        configuration.setGeneralConfiguration( generalConfiguration );
+        configuration.save();
         try
         {
             getStore().updateSystemConfiguration( systemConf );
@@ -302,9 +357,9 @@
             throw new ConfigurationStoringException( "Error writting configuration to database.", e );
         }
     }
-    
+
     public Schedule getDefaultSchedule()
-        throws ContinuumStoreException, ConfigurationLoadingException
+        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException
     {
         // Schedule
         Schedule defaultSchedule = getStore().getScheduleByName( DEFAULT_SCHEDULE_NAME );
@@ -324,18 +379,19 @@
     // ----------------------------------------------------------------------
 
     private Schedule createDefaultSchedule()
-        throws ConfigurationLoadingException
+        throws ConfigurationLoadingException, ContinuumConfigurationException
     {
-        
-        getLogger().info( "create Default Schedule" );
-        
+
+        log.info( "create Default Schedule" );
+
         Schedule schedule = new Schedule();
 
         schedule.setName( DEFAULT_SCHEDULE_NAME );
 
+        //It shouldn't be possible
         if ( systemConf == null )
         {
-            this.load();
+            this.reload();
         }
 
         schedule.setDescription( systemConf.getDefaultScheduleDescription() );

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=678639&r1=678638&r2=678639&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 Mon Jul 21 22:04:26 2008
@@ -28,8 +28,6 @@
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
- * @plexus.component role="org.apache.maven.continuum.utils.WorkingDirectoryService"
- * role-hint="default"
  */
 public class DefaultWorkingDirectoryService
     extends AbstractLogEnabled

Added: continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml?rev=678639&view=auto
==============================================================================
--- continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml (added)
+++ continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml Mon Jul 21 22:04:26 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="configurationService" class="org.apache.maven.continuum.configuration.DefaultConfigurationService"
+        init-method="initialize">
+    <property name="applicationHome" value="target"/>
+    <property name="store" ref="continuumStore#jdo"/>
+    <property name="configuration" ref="continuumConfiguration"/>
+  </bean>
+  <bean id="workingDirectoryService" class="org.apache.maven.continuum.utils.DefaultWorkingDirectoryService">
+    <property name="configurationService" ref="configurationService"/>
+  </bean>
+</beans>
\ No newline at end of file

Propchange: continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java Mon Jul 21 22:04:26 2008
@@ -19,8 +19,10 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.AbstractContinuumTest;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
 
@@ -29,37 +31,72 @@
  * @version $Id$
  */
 public class ConfigurationServiceTest
-    extends AbstractContinuumTest
+    extends PlexusInSpringTestCase
 {
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    private String confFile = "target/test-classes/conf/continuum.xml";
+
+    @Override
     protected void setUp()
         throws Exception
     {
-        super.setUp();
+        File originalConf = new File( getBasedir(), "src/test/resources/conf/continuum.xml" );
 
-        File templateConfiguration = new File( getBasedir(), "src/test/resources/configuration.xml" );
+        File confUsed = new File( getBasedir(), confFile );
+        if ( confUsed.exists() )
+        {
+            confUsed.delete();
+        }
+        FileUtils.copyFile( originalConf, confUsed );
+        super.setUp();
+    }
 
-        File testConfiguration = new File( getBasedir(), "target/configuration.xml" );
+    public void testLoad()
+        throws Exception
+    {
+        ConfigurationService service = (ConfigurationService) lookup( "configurationService" );
+        assertNotNull( service );
 
-        FileUtils.copyFile( templateConfiguration, testConfiguration );
+        assertNotNull( service.getUrl() );
+        assertEquals( "http://test", service.getUrl() );
+        log.info( service.getFile( "myBuildOutputDir" ).getAbsolutePath() );
+        log.info( service.getBuildOutputDirectory().getAbsolutePath() );
+        assertEquals( service.getFile( "myBuildOutputDir" ).getAbsolutePath(),
+                      service.getBuildOutputDirectory().getAbsolutePath() );
     }
 
     public void testConfigurationService()
         throws Exception
     {
-        ConfigurationService service = (ConfigurationService) lookup( ConfigurationService.ROLE );
+        File conf = new File( getBasedir(), confFile );
+        if ( conf.exists() )
+        {
+            conf.delete();
+        }
+
+        ConfigurationService service = (ConfigurationService) lookup( "configurationService" );
+
+        assertNotNull( service );
 
-        service.load();
+//        service.load();
 
-        assertEquals( "build-output", service.getBuildOutputDirectory().getName() );
+//        assertEquals( "http://test", service.getUrl() );
 
-        assertEquals( "working-directory", service.getWorkingDirectory().getName() );
+//        assertEquals( "build-output-directory", service.getBuildOutputDirectory().getName() );
+
+//        assertEquals( "working-directory", service.getWorkingDirectory().getName() );
+
+        service.setUrl( "http://test/zloug" );
+        service.setBuildOutputDirectory( new File( "testBuildOutputDir" ) );
 
         service.store();
 
-        // ----------------------------------------------------------------------
-        //
-        // ----------------------------------------------------------------------
+        String contents = FileUtils.fileRead( conf );
+        //assertTrue( contents.indexOf( "http://test/zloug" ) > 0 );
+
+        service.reload();
 
-        service.load();
+        assertEquals( "http://test/zloug", service.getUrl() );
     }
 }

Added: continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml?rev=678639&view=auto
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml (added)
+++ continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml Mon Jul 21 22:04:26 2008
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <system/>
+  <jndi prefix="java:comp/env" config-optional="true"/>  
+  <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum"/>
+  <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum.user"/>  
+</configuration>

Propchange: continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml?rev=678639&view=auto
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml (added)
+++ continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml Mon Jul 21 22:04:26 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <continuum>
+    <baseUrl>http://test</baseUrl>
+    <buildOutputDirectory>target/myBuildOutputDir</buildOutputDirectory>
+  </continuum>
+</configuration>
\ No newline at end of file

Propchange: continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-commons/src/test/resources/conf/continuum.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/trunk/continuum-commons/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/log4j.xml?rev=678639&view=auto
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/log4j.xml (added)
+++ continuum/trunk/continuum-commons/src/test/resources/log4j.xml Mon Jul 21 22:04:26 2008
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!-- ===================================================================== -->
+<!-- Log4j Configuration -->
+<!-- ===================================================================== -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+  debug="false">
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d %-5p [%c{1}.%M](%L) %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- quiet spring loading :-) -->
+  <category name="org.springframework">
+    <priority value="ERROR"/>
+  </category>
+  <category name="org.codehaus.plexus">
+    <priority value="ERROR"/>
+  </category>
+  <category name="org.apache.continuum.configuration">
+    <priority value="DEBUG"/>
+  </category>
+
+  <category name="org.apache.commons.configuration">
+    <priority value="DEBUG"/>
+  </category>
+
+  <!-- JPOX -->
+  <category name="JPOX">
+    <priority value="WARN"/>
+  </category>
+  <category name="JPOX.RDBMS">
+    <priority value="ERROR"/>
+  </category>
+
+  <root>
+    <priority value="INFO"/>
+    <appender-ref ref="CONSOLE"/>
+  </root>
+
+</log4j:configuration>

Propchange: continuum/trunk/continuum-commons/src/test/resources/log4j.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-commons/src/test/resources/log4j.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/configuration/ConfigurationServiceTest.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/configuration/ConfigurationServiceTest.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/configuration/ConfigurationServiceTest.xml (original)
+++ continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/configuration/ConfigurationServiceTest.xml Mon Jul 21 22:04:26 2008
@@ -17,20 +17,4 @@
   ~ under the License.
   -->
 
-<plexus>
-  <components>
-    <component>
-      <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-      <implementation>org.apache.maven.continuum.configuration.DefaultConfigurationService</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-          <role-hint>jdo</role-hint>
-        </requirement>
-      </requirements>
-      <configuration>
-        <application-home>${basedir}/target/continuum</application-home>
-      </configuration>
-    </component>
-  </components>
-</plexus>
\ No newline at end of file
+<plexus/>
\ No newline at end of file

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon Jul 21 22:04:26 2008
@@ -20,6 +20,7 @@
  */
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.build.settings.SchedulesActivator;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -28,7 +29,6 @@
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.core.action.CreateProjectsFromMetadataAction;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -181,7 +181,7 @@
      * @plexus.requirement
      */
     private BuildExecutorManager executorManager;
-    
+
     private PlexusContainer container;
 
 
@@ -549,7 +549,7 @@
             throw new ContinuumException( "Error while getting the checkout queue.", e );
         }
     }
-    
+
     public TaskQueueExecutor getBuildTaskQueueExecutor()
         throws ContinuumException
     {
@@ -575,8 +575,8 @@
             }
         }
         return -1;
-    }    
-    
+    }
+
     public boolean removeFromBuildingQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
         throws ContinuumException
     {
@@ -744,9 +744,9 @@
             {
                 removeProjectFromBuildingQueue( projectId );
             }
-            
+
             // cancel it if currently building
-            
+
             if ( getCurrentProjectIdBuilding() == projectId )
             {
                 Task currentTask = getBuildTaskQueueExecutor().getCurrentTask();
@@ -791,7 +791,7 @@
         }
     }
 
-    /** 
+    /**
      * @see org.apache.maven.continuum.Continuum#checkoutProject(int)
      */
     public void checkoutProject( int projectId )
@@ -1539,7 +1539,7 @@
     // Shell projects
     // ----------------------------------------------------------------------
 
-    /** 
+    /**
      * @see org.apache.maven.continuum.Continuum#addProject(org.apache.maven.continuum.model.project.Project, java.lang.String)
      */
     public int addProject( Project project, String executorId )
@@ -1554,7 +1554,7 @@
         return addProject( project, executorId, groupId, -1 );
     }
 
-    /** 
+    /**
      * @see org.apache.maven.continuum.Continuum#addProject(org.apache.maven.continuum.model.project.Project, java.lang.String, int, int)
      */
     public int addProject( Project project, String executorId, int groupId, int buildDefintionTemplateId )
@@ -1633,7 +1633,7 @@
         context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
 
         context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( projectGroup.getId() ) );
-        
+
         executeAction( "validate-project", context );
 
         executeAction( "store-project", context );
@@ -1656,16 +1656,17 @@
                                                        false, false, buildDefintionTemplateId );
     }
 
-    
+
     protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
                                                                                      String projectBuilderId,
                                                                                      int projectGroupId,
                                                                                      boolean checkProtocol,
                                                                                      boolean useCredentialsCache,
                                                                                      boolean loadRecursiveProjects,
-                                                                                     int buildDefintionTemplateId, boolean addAssignableRoles )
-          throws ContinuumException
-      {
+                                                                                     int buildDefintionTemplateId,
+                                                                                     boolean addAssignableRoles )
+        throws ContinuumException
+    {
         if ( checkProtocol )
         {
             try
@@ -1807,11 +1808,11 @@
 
         String scmUserName = null;
         String scmPassword = null;
-        
+
         for ( Project project : projects )
         {
             project.setScmUseCache( useCredentialsCache );
-            
+
             // values backup for first checkout
             scmUserName = project.getScmUsername();
             scmPassword = project.getScmPassword();
@@ -1821,11 +1822,10 @@
                 project.setScmUsername( null );
                 project.setScmPassword( null );
             }
-    
+
             projectGroup.addProject( project );
         }
 
-
         try
         {
             store.updateProjectGroup( projectGroup );
@@ -1855,7 +1855,7 @@
                 // FIXME
                 // olamy  : read again the project to have values because store.updateProjectGroup( projectGroup ); 
                 // remove object data -> we don't display the project name in the build queue
-                context.put( AbstractContinuumAction.KEY_PROJECT, store.getProject( project.getId() )  );
+                context.put( AbstractContinuumAction.KEY_PROJECT, store.getProject( project.getId() ) );
                 executeAction( "add-project-to-checkout-queue", context );
             }
         }
@@ -1871,15 +1871,15 @@
             executeAction( "add-assignable-roles", context );
         }
         return result;
-      }
-    
+    }
+
     protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
-                                                                                   String projectBuilderId,
-                                                                                   int projectGroupId,
-                                                                                   boolean checkProtocol,
-                                                                                   boolean useCredentialsCache,
-                                                                                   boolean loadRecursiveProjects,
-                                                                                   int buildDefintionTemplateId )
+                                                                                     String projectBuilderId,
+                                                                                     int projectGroupId,
+                                                                                     boolean checkProtocol,
+                                                                                     boolean useCredentialsCache,
+                                                                                     boolean loadRecursiveProjects,
+                                                                                     int buildDefintionTemplateId )
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
@@ -2197,7 +2197,7 @@
         {
             if ( bd.getId() == buildDefinitionId )
             {
-            	buildDefinition = bd;
+                buildDefinition = bd;
                 break;
             }
         }
@@ -2690,7 +2690,7 @@
 
             configurationService.store();
         }
-        catch ( ConfigurationStoringException e )
+        catch ( Exception e )
         {
             throw new ContinuumException( "Can't store configuration.", e );
         }
@@ -2701,9 +2701,9 @@
     {
         try
         {
-            configurationService.load();
+            configurationService.reload();
         }
-        catch ( ConfigurationLoadingException e )
+        catch ( Exception e )
         {
             throw new ContinuumException( "Can't reload configuration.", e );
         }
@@ -2741,7 +2741,7 @@
 
         for ( Project project : store.getAllProjectsByNameWithBuildDetails() )
         {
-            for ( ProjectNotifier notifier : (List<ProjectNotifier>)project.getNotifiers() )
+            for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers() )
             {
                 if ( StringUtils.isEmpty( notifier.getType() ) )
                 {
@@ -2791,7 +2791,7 @@
                 project.getExecutorId() );
         }
     }
-    
+
     // --------------------------------
     //  Plexus Lifecycle
     // --------------------------------
@@ -2812,12 +2812,16 @@
         {
             initializer.initialize();
 
-            configurationService.load();
+            configurationService.reload();
         }
         catch ( ConfigurationLoadingException e )
         {
             throw new StartingException( "Error loading the Continuum configuration.", e );
         }
+        catch ( ContinuumConfigurationException e )
+        {
+            throw new StartingException( "Error loading the Continuum configuration.", e );
+        }
         catch ( ContinuumInitializationException e )
         {
             throw new StartingException( "Cannot initializing Continuum for the first time.", e );
@@ -2836,7 +2840,7 @@
             getLogger().error( "Error activating schedules.", e );
         }
     }
-    
+
     public void stop()
         throws StoppingException
     {
@@ -2852,7 +2856,6 @@
     }
 
 
-
     public void startup()
         throws ContinuumException
     {
@@ -2881,7 +2884,7 @@
                 configurationService.store();
             }
         }
-        catch ( ConfigurationStoringException e )
+        catch ( Exception e )
         {
             getLogger().info( "Error storing the Continuum configuration.", e );
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java Mon Jul 21 22:04:26 2008
@@ -18,10 +18,7 @@
  */
 package org.apache.maven.continuum.builddefinition;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
+import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -37,12 +34,16 @@
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
- * @since 15 sept. 07
  * @version $Id$
  * @plexus.component role="org.apache.maven.continuum.builddefinition.BuildDefinitionService"
  * @TODO some cache mechanism ?
+ * @since 15 sept. 07
  */
 public class DefaultBuildDefinitionService
     extends AbstractLogEnabled
@@ -78,19 +79,17 @@
      * @plexus.configuration default-value="--batch-mode --non-recursive"
      */
     private String defaultM2Arguments;
-    
-    
-    
+
+
     /**
      * @plexus.requirement role-hint="jdo"
      */
     private ContinuumStore store;
-    
+
     /**
      * @plexus.requirement role-hint="default"
-     */    
+     */
     private ConfigurationService configurationService;
-    
 
     // -----------------------------------------------
     //  Plexus Lifecycle
@@ -107,8 +106,8 @@
         {
             throw new InitializationException( e.getMessage(), e );
         }
-    } 
-    
+    }
+
     private void initializeDefaultContinuumBuildDefintions()
         throws BuildDefinitionServiceException
     {
@@ -116,8 +115,8 @@
         this.getDefaultMavenOneBuildDefinitionTemplate();
         this.getDefaultMavenTwoBuildDefinitionTemplate();
         this.getDefaultShellBuildDefinitionTemplate();
-    }        
-    
+    }
+
     public BuildDefinition getBuildDefinition( int buildDefinitionId )
         throws BuildDefinitionServiceException
     {
@@ -148,7 +147,7 @@
         }
     }
 
-    
+
     public void removeBuildDefinition( BuildDefinition buildDefinition )
         throws BuildDefinitionServiceException
     {
@@ -199,8 +198,8 @@
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
     }
-    
-    
+
+
     public List<BuildDefinition> getAllTemplates()
         throws BuildDefinitionServiceException
     {
@@ -211,10 +210,10 @@
         catch ( ContinuumStoreException e )
         {
             throw new BuildDefinitionServiceException( e.getMessage(), e );
-        }        
+        }
     }
 
-    /** 
+    /**
      * @see org.apache.maven.continuum.builddefinition.BuildDefinitionService#cloneBuildDefinition(org.apache.maven.continuum.model.project.BuildDefinition)
      */
     public BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition )
@@ -233,8 +232,7 @@
         cloned.setTemplate( buildDefinition.isTemplate() );
         return cloned;
     }
-    
-    
+
 
     public BuildDefinitionTemplate getContinuumDefaultWithType( String type )
         throws BuildDefinitionServiceException
@@ -252,7 +250,8 @@
     public BuildDefinitionTemplate getDefaultAntBuildDefinitionTemplate()
         throws BuildDefinitionServiceException
     {
-        BuildDefinitionTemplate template = getContinuumDefaultWithType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
+        BuildDefinitionTemplate template =
+            getContinuumDefaultWithType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
         if ( template != null )
         {
             return template;
@@ -261,7 +260,7 @@
         template = new BuildDefinitionTemplate();
         template.setContinuumDefault( true );
         template.setName( "Default Ant Template" );
-        template.setType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR  );
+        template.setType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
 
         template = addBuildDefinitionTemplate( template );
 
@@ -278,9 +277,9 @@
         bd.setSchedule( getDefaultSchedule() );
 
         bd.setDescription( "Default Ant Build Definition" );
-        
+
         bd.setTemplate( true );
-        
+
         bd.setType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
         return addBuildDefinitionInTemplate( template, bd, true );
     }
@@ -288,7 +287,8 @@
     public BuildDefinitionTemplate getDefaultMavenOneBuildDefinitionTemplate()
         throws BuildDefinitionServiceException
     {
-        BuildDefinitionTemplate template = getContinuumDefaultWithType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
+        BuildDefinitionTemplate template =
+            getContinuumDefaultWithType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
         if ( template != null )
         {
             getLogger().debug( "found default maven template " + template.getType() );
@@ -298,10 +298,10 @@
         template = new BuildDefinitionTemplate();
         template.setContinuumDefault( true );
         template.setName( "Default Maven 1 Template" );
-        template.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR  );
-        
+        template.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
+
         template = addBuildDefinitionTemplate( template );
-        
+
         BuildDefinition bd = new BuildDefinition();
 
         bd.setDefaultForProject( true );
@@ -317,16 +317,17 @@
         bd.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
 
         bd.setDescription( "Default Maven 1 Build Definition" );
-        
+
         bd.setTemplate( true );
-        
+
         return addBuildDefinitionInTemplate( template, bd, true );
     }
 
     public BuildDefinitionTemplate getDefaultMavenTwoBuildDefinitionTemplate()
-        throws  BuildDefinitionServiceException
+        throws BuildDefinitionServiceException
     {
-        BuildDefinitionTemplate template = getContinuumDefaultWithType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
+        BuildDefinitionTemplate template =
+            getContinuumDefaultWithType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
         if ( template != null )
         {
             return template;
@@ -335,10 +336,10 @@
         template = new BuildDefinitionTemplate();
         template.setContinuumDefault( true );
         template.setName( "Default Maven 2 Template" );
-        template.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR  );
-        
-        template = addBuildDefinitionTemplate( template );        
-        
+        template.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
+
+        template = addBuildDefinitionTemplate( template );
+
         BuildDefinition bd = new BuildDefinition();
 
         bd.setDefaultForProject( true );
@@ -354,16 +355,17 @@
         bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
 
         bd.setDescription( "Default Maven 2 Build Definition" );
-        
+
         bd.setTemplate( true );
-        
+
         return addBuildDefinitionInTemplate( template, bd, true );
     }
 
     public BuildDefinitionTemplate getDefaultShellBuildDefinitionTemplate()
         throws BuildDefinitionServiceException
     {
-        BuildDefinitionTemplate template = getContinuumDefaultWithType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
+        BuildDefinitionTemplate template =
+            getContinuumDefaultWithType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
         if ( template != null )
         {
             return template;
@@ -372,10 +374,10 @@
         template = new BuildDefinitionTemplate();
         template.setContinuumDefault( true );
         template.setName( "Default Shell Template" );
-        template.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR  );
-        
-        template = addBuildDefinitionTemplate( template );        
-        
+        template.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
+
+        template = addBuildDefinitionTemplate( template );
+
         BuildDefinition bd = new BuildDefinition();
 
         bd.setDefaultForProject( true );
@@ -385,12 +387,12 @@
         bd.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
 
         bd.setTemplate( true );
-        
+
         bd.setDescription( "Default Shell Build Definition" );
-        
+
         return addBuildDefinitionInTemplate( template, bd, true );
     }
-    
+
     private Schedule getDefaultSchedule()
         throws BuildDefinitionServiceException
     {
@@ -406,9 +408,12 @@
         {
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
+        catch ( ContinuumConfigurationException e )
+        {
+            throw new BuildDefinitionServiceException( e.getMessage(), e );
+        }
     }
 
-    
     // ------------------------------------------------------
     //  BuildDefinitionTemplate
     // ------------------------------------------------------    
@@ -484,7 +489,7 @@
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
     }
-    
+
     public BuildDefinitionTemplate addBuildDefinitionInTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
                                                                  BuildDefinition buildDefinition, boolean template )
         throws BuildDefinitionServiceException
@@ -494,7 +499,7 @@
             BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
             stored.setName( buildDefinitionTemplate.getName() );
             BuildDefinition storedBuildDefinition = getBuildDefinition( buildDefinition.getId() );
-            if (storedBuildDefinition != null)
+            if ( storedBuildDefinition != null )
             {
                 buildDefinition = storedBuildDefinition;
             }
@@ -507,7 +512,7 @@
         {
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
-    }    
+    }
 
     public BuildDefinitionTemplate removeBuildDefinitionFromTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
                                                                       BuildDefinition buildDefinition )
@@ -518,13 +523,13 @@
             BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
             stored.setName( buildDefinitionTemplate.getName() );
             List<BuildDefinition> buildDefinitions = new ArrayList<BuildDefinition>();
-            for (int i = 0,size = stored.getBuildDefinitions().size();i<size;i++)
+            for ( int i = 0, size = stored.getBuildDefinitions().size(); i < size; i++ )
             {
                 BuildDefinition buildDef = (BuildDefinition) stored.getBuildDefinitions().get( i );
                 if ( buildDef.getId() != buildDefinition.getId() )
                 {
                     buildDefinitions.add( getBuildDefinition( buildDef.getId() ) );
-                }                
+                }
             }
             stored.setBuildDefinitions( buildDefinitions );
             return store.updateBuildDefinitionTemplate( stored );
@@ -565,8 +570,7 @@
         }
     }
 
-    public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId,
-                                                                             BuildDefinitionTemplate template )
+    public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId, BuildDefinitionTemplate template )
         throws BuildDefinitionServiceException, ContinuumObjectNotFoundException
     {
         try
@@ -592,7 +596,7 @@
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
     }
-    
+
     public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String type )
         throws BuildDefinitionServiceException
     {

Modified: continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml (original)
+++ continuum/trunk/continuum-core/src/main/resources/META-INF/spring-context.xml Mon Jul 21 22:04:26 2008
@@ -26,8 +26,6 @@
          class="org.apache.maven.continuum.execution.shell.ShellBuildExecutor" autowire="byName">
   </bean>
 
-  <bean id="workingDirectoryService" class="org.apache.maven.continuum.utils.DefaultWorkingDirectoryService" autowire="byName"/>
-
   <bean id="notifierManager"
     class="org.apache.maven.continuum.notification.manager.DefaultNotifierManager">
     <property name="notifiers">

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java (original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java Mon Jul 21 22:04:26 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
@@ -100,7 +101,7 @@
         {
             if ( !configurationService.isLoaded() )
             {
-                configurationService.load();
+                configurationService.reload();
             }
 
             StringBuffer buf = new StringBuffer( configurationService.getUrl() );
@@ -122,6 +123,10 @@
         {
             throw new ContinuumException( "Can't obtain the base url from configuration.", e );
         }
+        catch ( ContinuumConfigurationException e )
+        {
+            throw new ContinuumException( "Can't obtain the base url from configuration.", e );
+        }
     }
 
     /**

Modified: continuum/trunk/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/pom.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-release/pom.xml (original)
+++ continuum/trunk/continuum-release/pom.xml Mon Jul 21 22:04:26 2008
@@ -146,6 +146,9 @@
   <build>
     <testResources>
       <testResource>
+        <directory>src/test/resources</directory>
+      </testResource>
+      <testResource>
         <directory>src/test/scm</directory>
         <targetPath>../scm-src</targetPath>
       </testResource>

Added: continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml?rev=678639&view=auto
==============================================================================
--- continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml (added)
+++ continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml Mon Jul 21 22:04:26 2008
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <system/>
+  <jndi prefix="java:comp/env" config-optional="true"/>  
+  <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum"/>
+  <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum.user"/>  
+</configuration>

Propchange: continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/trunk/continuum-release/src/test/resources/META-INF/continuum/continuum-configuration.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

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=678639&r1=678638&r2=678639&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 Mon Jul 21 22:04:26 2008
@@ -57,6 +57,7 @@
     //
     // ----------------------------------------------------------------------
 
+    @Override
     protected void setUp()
         throws Exception
     {
@@ -64,7 +65,7 @@
 
         getStore();
 
-        setUpConfigurationService( (ConfigurationService) lookup( ConfigurationService.ROLE ) );
+        setUpConfigurationService( (ConfigurationService) lookup( "configurationService" ) );
 
         Collection<ProjectGroup> projectGroups = store.getAllProjectGroupsWithProjects();
 
@@ -78,6 +79,14 @@
         assertEquals( 1, projectGroups.size() );
     }
 
+    @Override
+    protected void tearDown()
+        throws Exception
+    {
+        store.eraseDatabase();
+        super.tearDown();
+    }
+
     protected void createDefaultProjectGroup()
         throws Exception
     {
@@ -104,8 +113,6 @@
     public static void setUpConfigurationService( ConfigurationService configurationService )
         throws Exception
     {
-        configurationService.load();
-
         configurationService.setBuildOutputDirectory( getTestFile( "target/build-output" ) );
 
         configurationService.setWorkingDirectory( getTestFile( "target/working-directory" ) );

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java (original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java Mon Jul 21 22:04:26 2008
@@ -19,16 +19,12 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Map;
-
-import org.apache.maven.continuum.configuration.ConfigurationException;
-import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
-import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
+import java.io.File;
+import java.util.Map;
+
 /**
  * Mock class for testing WagonContinuumNotifier's call to ConfigurationService.getBuildOutputFile()
  *
@@ -182,7 +178,7 @@
         return false;
     }
 
-    public void load()
+    public void reload()
         throws ConfigurationLoadingException
     {
     }
@@ -208,7 +204,7 @@
     public void setChrootJailDirectory( File chrootJailDirectory )
     {
         // TODO Auto-generated method stub
-        
+
     }
 
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java Mon Jul 21 22:04:26 2008
@@ -28,6 +28,7 @@
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
 import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
@@ -93,7 +94,7 @@
     }
 
     public String save()
-        throws ConfigurationStoringException, ContinuumStoreException
+        throws ConfigurationStoringException, ContinuumStoreException, ContinuumConfigurationException
     {
         ConfigurationService configuration = getContinuum().getConfiguration();
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java Mon Jul 21 22:04:26 2008
@@ -80,7 +80,7 @@
             return invocation.invoke();
         }
 
-        configuration.load();
+        configuration.reload();
 
         if ( configuration.isInitialized() )
         {

Modified: continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml Mon Jul 21 22:04:26 2008
@@ -18,34 +18,6 @@
   ~ under the License.
   -->
 <plexus>
-  <!-- 
-    Not supported with plexus-spring
-  <load-on-start>
-    <component>
-      <role>org.apache.maven.continuum.Continuum</role>
-    </component>
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>build-project</role-hint>
-    </component>
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>check-out-project</role-hint>
-    </component>
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>prepare-release</role-hint>
-    </component>
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>perform-release</role-hint>
-    </component>
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>rollback-release</role-hint>
-    </component>
-  </load-on-start>
-  -->
   <components>
     <component>
       <role>org.codehaus.plexus.registry.Registry</role>
@@ -55,32 +27,11 @@
         <properties>
           <system/>
           <jndi prefix="java:comp/env" config-optional="true"/>
-          <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
-               config-at="org.apache.maven.continuum" config-forceCreate="true"/>
           <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
                config-name="org.apache.maven.shared.app.user" config-at="org.apache.maven.shared.app"
                config-forceCreate="true"/>
-          <xml fileName="${appserver.base}/conf/shared.xml" config-optional="true"
-               config-name="org.apache.maven.shared.app.base" config-at="org.apache.maven.shared.app"/>
-          <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
           <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
                       config-at="org.codehaus.plexus.redback"/>
-          <xml fileName="${appserver.home}/conf/continuum.xml" config-optional="true"
-               config-at="org.apache.maven.continuum" config-name="org.apache.maven.continuum.user"
-               config-forceCreate="true"/>
-          <xml fileName="${appserver.home}/conf/shared.xml" config-optional="true"
-               config-at="org.apache.maven.shared.app" />
-          <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
-          <properties fileName="${appserver.home}/conf/security.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <!-- Previous settings, deprecated -->
-          <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true" 
-               config-at="org.apache.maven.continuum" />
-          <xml fileName="${user.home}/.m2/shared.xml" config-optional="true"/>
-          <properties fileName="${user.home}/.m2/security.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
-          <properties fileName="${user.home}/.m2/continuum.properties" config-optional="true"
-                      config-at="org.codehaus.plexus.redback"/>
           <!-- Defaults -->
           <properties fileName="org/apache/maven/continuum/security.properties" config-at="org.codehaus.plexus.redback"/>
         </properties>
@@ -418,8 +369,8 @@
           </property>
         </properties>
       </configuration>
-    </component>    
-    
+    </component>
+
     <!--
      | Logger manager
      -->

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml?rev=678639&r1=678638&r2=678639&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml Mon Jul 21 22:04:26 2008
@@ -51,7 +51,7 @@
   </bean>
   <bean id="workingDirectoryService" class="org.apache.maven.continuum.utils.ChrootJailWorkingDirectoryService" autowire="byName"/>
   -->
-  
+
   <bean id="scmManager"
     class="org.apache.continuum.scm.manager.ScmManager">
     <property name="scmLogger" ref="scmLogger" />
@@ -59,5 +59,4 @@
       <bean class="org.apache.continuum.scm.manager.spring.ScmProviderFactoryBean"/>
     </property>
   </bean>
-  
 </beans>



Mime
View raw message