continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1041189 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/configuration/ continuum-base/continuum-configuration/ continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ continuum-base/...
Date Wed, 01 Dec 2010 22:14:29 GMT
Author: ctan
Date: Wed Dec  1 22:14:28 2010
New Revision: 1041189

URL: http://svn.apache.org/viewvc?rev=1041189&view=rev
Log:
[CONTINUUM-2587] added ability to enable/disable distributed builds from continuum.xml

Submitted By: Gwen Harold Autencio 

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/pom.xml
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
    continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/test/resources/conf/continuum.xml
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
Wed Dec  1 22:14:28 2010
@@ -48,6 +48,8 @@ public class GeneralConfiguration
     private List<BuildAgentConfiguration> buildAgents;
     
     private List<BuildAgentGroupConfiguration> buildAgentGroups;
+    
+    private boolean distributedBuildEnabled;
 
     public GeneralConfiguration()
     {
@@ -149,4 +151,14 @@ public class GeneralConfiguration
     {
         this.buildAgentGroups = buildAgentGroups;
     }
+
+    public boolean isDistributedBuildEnabled()
+    {
+        return distributedBuildEnabled;
+    }
+
+    public void setDistributedBuildEnabled( boolean distributedBuildEnabled )
+    {
+        this.distributedBuildEnabled = distributedBuildEnabled;
+    }
 }

Modified: continuum/trunk/continuum-base/continuum-configuration/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/pom.xml?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/pom.xml (original)
+++ continuum/trunk/continuum-base/continuum-configuration/pom.xml Wed Dec  1 22:14:28 2010
@@ -35,7 +35,7 @@ under the License.
           <models>
             <model>src/main/mdo/continuum-configuration.xml</model>
           </models>
-          <version>1.1.1</version>
+          <version>1.4.1</version>
           <useJava5>true</useJava5>
         </configuration>
         <executions>

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
Wed Dec  1 22:14:28 2010
@@ -126,6 +126,7 @@ public class DefaultContinuumConfigurati
 
             this.generalConfiguration.setNumberOfBuildsInParallel( configuration.getNumberOfBuildsInParallel()
);
             this.generalConfiguration.setBaseUrl( configuration.getBaseUrl() );
+            
             if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
             {
                 // TODO take care if file exists ?
@@ -158,6 +159,10 @@ public class DefaultContinuumConfigurati
                 this.generalConfiguration.setReleaseOutputDirectory(
                     new File( configuration.getReleaseOutputDirectory() ) );
             }
+            
+            // set the configuration for diistributedBuildEnabled
+            this.generalConfiguration.setDistributedBuildEnabled( configuration.isDistributedBuildEnabled()
);
+            
             if ( configuration.getBuildAgents() != null )
             {
                 List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
@@ -261,6 +266,10 @@ public class DefaultContinuumConfigurati
                 configurationModel.setReleaseOutputDirectory(
                     this.generalConfiguration.getReleaseOutputDirectory().getPath() );
             }
+            
+            // set configuration for distributedBuildEnabled.
+            configurationModel.setDistributedBuildEnabled( this.generalConfiguration.isDistributedBuildEnabled()
);
+            
             if ( this.generalConfiguration.getBuildAgents() != null )
             {
                 List<org.apache.continuum.configuration.model.BuildAgentConfiguration>
buildAgents =

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
Wed Dec  1 22:14:28 2010
@@ -72,6 +72,11 @@
           <type>int</type>
         </field>
         <field>
+          <name>distributedBuildEnabled</name>
+          <version>1.4.1+</version>
+          <type>boolean</type>
+        </field>
+        <field>
           <name>buildAgents</name>
           <version>1.1.0+</version>
           <association>

Modified: continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
Wed Dec  1 22:14:28 2010
@@ -69,13 +69,14 @@ public class TestDefaultContinuumConfigu
         assertNotNull( generalConfiguration.getBaseUrl() );
         assertEquals( "http://test", generalConfiguration.getBaseUrl() );
         assertEquals( new File( "myBuildOutputDir" ), generalConfiguration.getBuildOutputDirectory()
);
+        assertTrue( generalConfiguration.isDistributedBuildEnabled() );
         assertNotNull( generalConfiguration.getBuildAgents() );
         org.apache.continuum.configuration.BuildAgentConfiguration buildAgentConfig =
             generalConfiguration.getBuildAgents().get( 0 );
         assertEquals( "http://buildagent/xmlrpc", buildAgentConfig.getUrl() );
         assertEquals( "linux", buildAgentConfig.getDescription() );
         assertTrue( buildAgentConfig.isEnabled() );
-
+        
         // agent group tests        
         assertNotNull( "agent group", generalConfiguration.getBuildAgentGroups() );
         BuildAgentGroupConfiguration buildAgentGroupConfig = generalConfiguration.getBuildAgentGroups().get(
0 );
@@ -123,6 +124,7 @@ public class TestDefaultContinuumConfigu
         List<BuildAgentGroupConfiguration> buildAgentGroups = new ArrayList<BuildAgentGroupConfiguration>();
         buildAgentGroups.add( buildAgentGroupConfiguration );
 
+        generalConfiguration.setDistributedBuildEnabled( false );
         generalConfiguration.setBuildAgents( buildAgents );
         generalConfiguration.setBuildAgentGroups( buildAgentGroups );
         configuration.setGeneralConfiguration( generalConfiguration );
@@ -159,6 +161,7 @@ public class TestDefaultContinuumConfigu
         assertEquals( "http://buildagent-node-2/test",
                       configuration.getGeneralConfiguration().getBuildAgentGroups().get(
0 ).getBuildAgents().get(
                           1 ).getUrl() );
+        assertFalse( configuration.getGeneralConfiguration().isDistributedBuildEnabled()
);
         log.info( "generalConfiguration " + configuration.getGeneralConfiguration().toString()
);
     }
 }

Modified: continuum/trunk/continuum-base/continuum-configuration/src/test/resources/conf/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/test/resources/conf/continuum.xml?rev=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/test/resources/conf/continuum.xml
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/test/resources/conf/continuum.xml
Wed Dec  1 22:14:28 2010
@@ -2,6 +2,7 @@
 <continuum-configuration>
   <baseUrl>http://test</baseUrl>
   <buildOutputDirectory>myBuildOutputDir</buildOutputDirectory>
+  <distributedBuildEnabled>true</distributedBuildEnabled>
   <buildAgents>
     <buildAgent>
       <url>http://buildagent/xmlrpc</url>

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=1041189&r1=1041188&r2=1041189&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Wed Dec  1 22:14:28 2010
@@ -353,13 +353,14 @@ public class DefaultConfigurationService
     }
 
     public boolean isDistributedBuildEnabled()
-    {
-        return systemConf.isDistributedBuildEnabled();
+    {   
+        return generalConfiguration.isDistributedBuildEnabled();
     }
 
     public void setDistributedBuildEnabled( boolean distributedBuildEnabled )
     {
         systemConf.setDistributedBuildEnabled( distributedBuildEnabled );
+        generalConfiguration.setDistributedBuildEnabled( distributedBuildEnabled );
     }
 
     public void addBuildAgentGroup( BuildAgentGroupConfiguration buildAgentGroup )
@@ -709,10 +710,9 @@ public class DefaultConfigurationService
             if ( systemConf == null )
             {
                 systemConf = new SystemConfiguration();
-
                 systemConf = getSystemConfigurationDao().addSystemConfiguration( systemConf
);
             }
-
+            
             loaded = true;
         }
         catch ( ContinuumStoreException e )
@@ -732,6 +732,7 @@ public class DefaultConfigurationService
         throws ConfigurationStoringException, ContinuumConfigurationException
     {
         configuration.setGeneralConfiguration( generalConfiguration );
+        
         configuration.save();
         try
         {



Mime
View raw message