update branch of what's currently in trunk; will need to bring back the changes for flat multi-module support
git-svn-id: https://svn.apache.org/repos/asf/continuum/branches/continuum-flat-multi-module@941625 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/Continuum.sonarj b/Continuum.sonarj
new file mode 100644
index 0000000..4987146
--- /dev/null
+++ b/Continuum.sonarj
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<context version="4.1.0.304">
+ <scope name="Continuum" type="Project">
+ <architecture>
+ <element name="Web Application" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="XMLRPC" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Core API" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Core" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Notifiers" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Data Management" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Store" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Model" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Builder API" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="REST" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Builder" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Configuration" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Build Queue" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Results" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Checkout" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ <element name="Release" type="Layer">
+ <element name="Assignment" type="TypeFilter"/>
+ <stereotype name="Unrestricted"/>
+ </element>
+ </architecture>
+ </scope>
+ <scope name="External" type="External">
+ <element name="Filter" type="TypeFilter">
+ <element name="**" type="IncludeTypePattern"/>
+ </element>
+ </scope>
+ <scope name="Global" type="Global">
+ <element name="Configuration" type="Configuration">
+ <element name="CycleAnalysisAsymmetrical" type="ConfigurationSwitchDisabled"/>
+ <element name="CycleAnalysisDepthSourceFile" type="ConfigurationSwitchDisabled"/>
+ </element>
+ <element name="Filter" type="TypeFilter">
+ <element name="**" type="IncludeTypePattern"/>
+ </element>
+ </scope>
+</context>
diff --git a/continuum-api/pom.xml b/continuum-api/pom.xml
index 607fcbe..0e27ae8 100644
--- a/continuum-api/pom.xml
+++ b/continuum-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-api</artifactId>
@@ -32,6 +32,10 @@
<artifactId>continuum-model</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-buildagent-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
diff --git a/continuum-api/src/main/java/org/apache/continuum/builder/distributed/DistributedBuildService.java b/continuum-api/src/main/java/org/apache/continuum/builder/distributed/DistributedBuildService.java
new file mode 100644
index 0000000..99e073d
--- /dev/null
+++ b/continuum-api/src/main/java/org/apache/continuum/builder/distributed/DistributedBuildService.java
@@ -0,0 +1,30 @@
+package org.apache.continuum.builder.distributed;
+
+import java.util.Map;
+
+import org.apache.maven.continuum.ContinuumException;
+
+public interface DistributedBuildService
+{
+ String ROLE = DistributedBuildService.class.getName();
+
+ void prepareBuildFinished( Map<String, Object> context )
+ throws ContinuumException;
+
+ boolean shouldBuild( Map<String, Object> context );
+
+ void startPrepareBuild( Map<String, Object> context )
+ throws ContinuumException;
+
+ void startProjectBuild( int projectId )
+ throws ContinuumException;
+
+ void updateBuildResult( Map<String, Object> context )
+ throws ContinuumException;
+
+ void updateProject( Map<String, Object> context )
+ throws ContinuumException;
+
+ Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+ throws ContinuumException;
+}
diff --git a/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java b/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
index 0eb0ce6..5c92bf9 100644
--- a/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
+++ b/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
@@ -22,8 +22,12 @@
import java.util.List;
import java.util.Map;
-import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
+import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.system.Installation;
@@ -31,25 +35,13 @@
{
String ROLE = DistributedBuildManager.class.getName();
- void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, String scmRootAddress )
- throws ContinuumException;
-
- void updateBuildResult( Map<String, Object> context )
- throws ContinuumException;
-
- void prepareBuildFinished( Map<String, Object> context )
- throws ContinuumException;
-
- void startProjectBuild( int projectId )
- throws ContinuumException;
-
- void startPrepareBuild( Map<String, Object> context )
+ void cancelDistributedBuild( String buildAgentUrl )
throws ContinuumException;
void reload()
throws ContinuumException;
- void removeAgentFromTaskQueueExecutor( String buildAgentUrl )
+ void removeDistributedBuildQueueOfAgent( String buildAgentUrl )
throws ContinuumException;
boolean isBuildAgentBusy( String buildAgentUrl );
@@ -57,24 +49,55 @@
List<Installation> getAvailableInstallations( String buildAgentUrl )
throws ContinuumException;
- Map<String, PrepareBuildProjectsTask> getDistributedBuildProjects();
+ Map<String, List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue()
+ throws ContinuumException;
+
+ Map<String, List<BuildProjectTask>> getProjectsInBuildQueue()
+ throws ContinuumException;
Map<String, Object> getBuildResult( int projectId )
throws ContinuumException;
- Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
- throws ContinuumException;
-
- void updateProject( Map<String, Object> context )
- throws ContinuumException;
-
- boolean shouldBuild( Map<String, Object> context );
-
- Map<String, DistributedBuildTaskQueueExecutor> getTaskQueueExecutors();
-
String generateWorkingCopyContent( int projectId, String directory, String baseUrl, String imagesBaseUrl )
throws ContinuumException;
String getFileContent( int projectId, String directory, String filename )
throws ContinuumException;
-}
+
+ void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId,
+ String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
+
+ Map<String, PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
+ throws ContinuumException;
+
+ Map<String, BuildProjectTask> getProjectsCurrentlyBuilding()
+ throws ContinuumException;
+
+ void removeFromPrepareBuildQueue( String buildAgnetUrl, int projectGroupId, int scmRootId )
+ throws ContinuumException;
+
+ void removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws ContinuumException;
+
+ void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId )
+ throws ContinuumException;
+
+ void removeFromBuildQueue( List<String> hashCodes )
+ throws ContinuumException;
+
+ boolean isAgentAvailable( String buildAgentUrl )
+ throws ContinuumException;
+
+ boolean isProjectInAnyPrepareBuildQueue( int projectId, int buildDefinitionId )
+ throws ContinuumException;
+
+ boolean isProjectInAnyBuildQueue( int projectId, int buildDefinitionId )
+ throws ContinuumException;
+
+ boolean isProjectCurrentlyPreparingBuild( int projectId, int buildDefinitionId )
+ throws ContinuumException;
+
+ boolean isProjectCurrentlyBuilding( int projectId, int buildDefinitionId )
+ throws ContinuumException;
+}
\ No newline at end of file
diff --git a/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java b/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
index f06f20d..c0150cd 100644
--- a/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
+++ b/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
@@ -25,6 +25,8 @@
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.CheckOutTask;
+import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildQueue;
import org.apache.maven.continuum.model.project.Project;
@@ -43,12 +45,13 @@
*
* @param projects
* @param projectsBuildDefinitionsMap
- * @param trigger
+ * @param buildTrigger
* @param scmResultMap TODO
+ * @param projectGroupId
* @throws BuildManagerException
*/
- void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap, int trigger,
- Map<Integer, ScmResult> scmResultMap )
+ void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap,
+ BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId )
throws BuildManagerException;
/**
@@ -59,25 +62,27 @@
* @param projectId
* @param buildDefinition
* @param projectName
- * @param trigger
+ * @param buildTrigger
* @param scmResult TODO
+ * @param projectGroupId
* @throws BuildManagerException
*/
- void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger,
- ScmResult scmResult )
+ void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger,
+ ScmResult scmResult, int projectGroupId )
throws BuildManagerException;
/**
* Adds the projects in the prepare-build-queue.
*
* @param projectsBuildDefinitionsMap
- * @param trigger
+ * @param buildTrigger
* @param projectGroupId TODO
* @param scmRootAddress TODO
+ * @param scmRootId
* @throws BuildManagerException
*/
- void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId,
- String projectGroupName, String scmRootAddress, int scmRootId )
+ void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
+ int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId )
throws BuildManagerException;
/**
@@ -87,15 +92,13 @@
* @param projectId
* @param projectName
* @param workingDirectory
- * @param scmRootUrl TODO
* @param scmUsername
* @param scmPassword
* @param defaultBuildDefinition
- * @param subProjects TODO
* @throws BuildManagerException
*/
- void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
- String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects )
+ void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
+ String scmPassword, BuildDefinition defaultBuildDefinition )
throws BuildManagerException;
/**
@@ -161,11 +164,13 @@
*
* @param projectId
* @param buildDefinitionId
- * @param trigger
+ * @param buildTrigger
* @param projectName
+ * @param projectGroupId
* @throws BuildManagerException
*/
- void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
+ void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+ String projectName, int projectGroupId )
throws BuildManagerException;
// TODO: should we throw an exception when one of the projects cannot be removed?
@@ -340,4 +345,68 @@
* @return
*/
boolean isBuildInProgress();
+
+ /**
+ * Checks if at least one of the projects is currently building.
+ * @param projectIds
+ * @return
+ * @throws BuildManagerException
+ */
+ boolean isAnyProjectCurrentlyBuilding( int[] projectIds )
+ throws BuildManagerException;
+
+ /**
+ * Checks whether project is currently being checked out.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
+ boolean isProjectCurrentlyBeingCheckedOut( int projectId )
+ throws BuildManagerException;
+
+ /**
+ * Checks whether project is currently preparing build
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
+ boolean isProjectCurrentlyPreparingBuild( int projectId )
+ throws BuildManagerException;
+
+ /**
+ * Return currently preparing build project.
+ * @return
+ * @throws BuildManagerException
+ */
+ PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+ throws BuildManagerException;
+
+ /**
+ * Return all projects in prepare build queue.
+ * @return
+ * @throws BuildManagerException
+ */
+ List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+ throws BuildManagerException;
+
+ /**
+ * Remove a project from a prepare build queue.
+ * @param projectGroupId
+ * @param scmRootId
+ * @return
+ * @throws BuildManagerException
+ */
+ boolean removeProjectFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws BuildManagerException;
+
+ /**
+ * Removes a set of projects using the specified hashcodes from the prepare build queues.
+ *
+ * @param hashcodes
+ * @throws BuildManagerException
+ */
+ void removeProjectsFromPrepareBuildQueueWithHashCodes( int[] hashCodes )
+ throws BuildManagerException;
}
diff --git a/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java b/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
index 50da030..0b36ed2 100644
--- a/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
+++ b/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
@@ -19,13 +19,13 @@
* under the License.
*/
+import java.util.List;
+import java.util.Map;
+
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.store.ContinuumStoreException;
-import java.util.List;
-import java.util.Map;
-
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id$
@@ -45,30 +45,52 @@
BuildResult getLatestBuildResultForProject( int projectId );
+ BuildResult getLatestBuildResultForProjectWithDetails( int projectId );
+
BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId );
- List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate );
+ BuildResult getLatestBuildResultInSuccess( int projectId );
+
+ BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+ throws ContinuumStoreException;
long getNbBuildResultsForProject( int projectId );
+ /**
+ * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId
+ *
+ * @param projectId The project id
+ * @param fromDate the from date
+ * @param tobuildResultId the build result id
+ * @return the list of build results
+ */
+ List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId );
+
+ /**
+ * Returns the number of build results in success since fromDate
+ *
+ * @param projectId The project id
+ * @param fromDate The from date
+ * @return the number of build results
+ */
+ long getNbBuildResultsInSuccessForProject( int projectId, long fromDate );
+
List<BuildResult> getBuildResultsForProject( int projectId );
List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
/**
- * @since 1.2
* @param projectId
- * @param startIndex
+ * @param startId
* @return the returned list will contains all BuildResult for this project after the startId
+ * @since 1.2
*/
List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
- throws ContinuumStoreException;
-
- List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
+ throws ContinuumStoreException;
Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
- Map<Integer, BuildResult> getLatestBuildResults();
+ Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
@@ -77,9 +99,5 @@
List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex,
long endIndex );
- Map<Integer, BuildResult> getBuildResultsInSuccess();
-
- Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
-
List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
}
diff --git a/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java b/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
index 609d1a9..93826f8 100644
--- a/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
+++ b/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
@@ -34,6 +34,8 @@
List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int scheduleId );
+ List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId );
+
List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location );
List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByType( String type );
diff --git a/continuum-api/src/main/java/org/apache/continuum/dao/ProjectDao.java b/continuum-api/src/main/java/org/apache/continuum/dao/ProjectDao.java
index 1079700..af16504 100644
--- a/continuum-api/src/main/java/org/apache/continuum/dao/ProjectDao.java
+++ b/continuum-api/src/main/java/org/apache/continuum/dao/ProjectDao.java
@@ -19,12 +19,14 @@
* under the License.
*/
+import org.apache.continuum.model.project.ProjectGroupSummary;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
import org.apache.maven.continuum.store.ContinuumStoreException;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -63,8 +65,6 @@
List<Project> getProjectsInGroupWithDependencies( int projectGroupId )
throws ContinuumStoreException;
- List<Project> getAllProjectsWithAllDetails();
-
Project getProjectWithAllDetails( int projectId )
throws ContinuumStoreException;
@@ -79,4 +79,6 @@
Project getProjectWithDependencies( int projectId )
throws ContinuumStoreException;
+
+ Map<Integer, ProjectGroupSummary> getProjectsSummary();
}
diff --git a/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java b/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
index dbb3c86..a252347 100644
--- a/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
+++ b/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
@@ -33,6 +33,8 @@
List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations();
List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule( int scheduleId );
+
+ List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId );
List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByLocalRepository( int repositoryId );
diff --git a/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java b/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
index 834e7d7..5015e87 100644
--- a/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
+++ b/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
@@ -60,6 +60,8 @@
List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule( int scheduleId );
+ List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId );
+
List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository( int repositoryId );
List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations();
@@ -80,6 +82,8 @@
List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int scheduleId );
+ List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId );
+
List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location );
List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations();
diff --git a/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java b/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
index 5f8648e..7d4f0c8 100644
--- a/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
+++ b/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
@@ -38,7 +38,7 @@
throws ContinuumReleaseException, BuildAgentConfigurationException;
String releasePrepare( Project project, Properties releaseProperties, Map<String, String> releaseVersion,
- Map<String, String> developmentVersion, Map<String, String> environments )
+ Map<String, String> developmentVersion, Map<String, String> environments, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException;
ReleaseResult getReleaseResult( String releaseId )
@@ -53,11 +53,11 @@
String getPreparedReleaseName( String releaseId )
throws ContinuumReleaseException;
- void releasePerform( int projectId, String releaseId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository )
+ void releasePerform( int projectId, String releaseId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException;
- void releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository,
- String scmUrl, String scmUsername, String scmPassword, String scmTag, String scmTagBase, Map environments )
+ String releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository,
+ String scmUrl, String scmUsername, String scmPassword, String scmTag, String scmTagBase, Map environments, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException;
void releaseRollback( String releaseId, int projectId )
@@ -68,4 +68,6 @@
List<Map<String, Object>> getAllReleasesInProgress()
throws ContinuumReleaseException, BuildAgentConfigurationException;
+
+ String getDefaultBuildagent( int projectId );
}
\ No newline at end of file
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
index 8e6fc76..25fb946 100644
--- a/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
@@ -21,6 +21,7 @@
import java.io.Serializable;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.scm.ScmResult;
import org.codehaus.plexus.taskqueue.Task;
@@ -39,7 +40,7 @@
private final long timestamp;
- private final int trigger;
+ private BuildTrigger buildTrigger;
private long maxExecutionTime;
@@ -49,8 +50,10 @@
private ScmResult scmResult;
- public BuildProjectTask( int projectId, int buildDefinitionId, int trigger, String projectName,
- String buildDefinitionLabel, ScmResult scmResult )
+ int projectGroupId;
+
+ public BuildProjectTask( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, String projectName,
+ String buildDefinitionLabel, ScmResult scmResult, int projectGroupId )
{
this.projectId = projectId;
@@ -58,13 +61,15 @@
this.timestamp = System.currentTimeMillis();
- this.trigger = trigger;
+ this.buildTrigger = buildTrigger;
this.projectName = projectName;
this.buildDefinitionLabel = buildDefinitionLabel;
this.scmResult = scmResult;
+
+ this.projectGroupId = projectGroupId;
}
public int getProjectId()
@@ -82,9 +87,14 @@
return timestamp;
}
- public int getTrigger()
+ public BuildTrigger getBuildTrigger()
{
- return trigger;
+ return buildTrigger;
+ }
+
+ public void setBuildTrigger( BuildTrigger buildTrigger )
+ {
+ this.buildTrigger = buildTrigger;
}
public void setMaxExecutionTime( long maxExecutionTime )
@@ -112,6 +122,11 @@
return scmResult;
}
+ public int getProjectGroupId()
+ {
+ return projectGroupId;
+ }
+
public boolean equals( Object obj )
{
if ( obj == null )
@@ -129,12 +144,12 @@
BuildProjectTask buildProjectTask = (BuildProjectTask) obj;
return buildProjectTask.getBuildDefinitionId() == this.getBuildDefinitionId() &&
buildProjectTask.getProjectId() == this.getProjectId() &&
- buildProjectTask.getTrigger() == this.getTrigger();
+ buildProjectTask.getBuildTrigger().getTrigger() == this.buildTrigger.getTrigger();
}
public int hashCode()
{
- return this.getBuildDefinitionId() + this.getProjectId() + this.getTrigger();
+ return this.getBuildDefinitionId() + this.getProjectId() + this.buildTrigger.getTrigger();
}
public int getHashCode()
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
index a60ea12..e72f3b3 100644
--- a/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
@@ -20,9 +20,7 @@
*/
import java.io.File;
-import java.util.List;
-import org.apache.maven.continuum.model.project.Project;
import org.codehaus.plexus.taskqueue.Task;
/**
@@ -41,13 +39,9 @@
private final String scmUserName;
private final String scmPassword;
-
- private final String scmRootUrl;
-
- private final List<Project> projectsWithCommonScmRoot;
public CheckOutTask( int projectId, File workingDirectory, String projectName, String scmUserName,
- String scmPassword, String scmRootUrl, List<Project> projectsWithCommonScmRoot )
+ String scmPassword )
{
this.projectId = projectId;
@@ -58,10 +52,6 @@
this.scmUserName = scmUserName;
this.scmPassword = scmPassword;
-
- this.scmRootUrl = scmRootUrl;
-
- this.projectsWithCommonScmRoot = projectsWithCommonScmRoot;
}
public int getProjectId()
@@ -100,14 +90,4 @@
{
return this.hashCode();
}
-
- public String getScmRootUrl()
- {
- return scmRootUrl;
- }
-
- public List<Project> getProjectsWithCommonScmRoot()
- {
- return projectsWithCommonScmRoot;
- }
}
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
index 4dcd1f9..f2b4a83 100644
--- a/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
@@ -21,6 +21,7 @@
import java.util.List;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.codehaus.plexus.taskqueue.TaskQueue;
import org.codehaus.plexus.taskqueue.TaskQueueException;
import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
@@ -213,12 +214,14 @@
*
* @param projectId
* @param buildDefinitionId
- * @param trigger
+ * @param buildTrigger
* @param projectName
+ * @param projectGroupId
* @return
* @throws TaskQueueException TODO
*/
- boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
+ boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+ String projectName, int projectGroupId )
throws TaskQueueException;
/**
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallDistributedBuildQueue.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallDistributedBuildQueue.java
new file mode 100644
index 0000000..96e827b
--- /dev/null
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallDistributedBuildQueue.java
@@ -0,0 +1,37 @@
+package org.apache.continuum.taskqueue;
+
+import java.util.List;
+
+import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.taskqueue.TaskQueueException;
+
+public interface OverallDistributedBuildQueue
+{
+ String getBuildAgentUrl();
+
+ void setBuildAgentUrl( String buildAgentUrl );
+
+ TaskQueue getDistributedBuildQueue();
+
+ void addToDistributedBuildQueue( Task distributedBuildTask )
+ throws TaskQueueException;
+
+ List<PrepareBuildProjectsTask> getProjectsInQueue()
+ throws TaskQueueException;
+
+ boolean isInDistributedBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueException;
+
+ void removeFromDistributedBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueException;
+
+ void removeFromDistributedBuildQueue( int[] hashCodes )
+ throws TaskQueueException;
+
+ void removeFromDistributedBuildQueueByHashCode( int hashCode )
+ throws TaskQueueException;
+
+ DistributedBuildTaskQueueExecutor getDistributedBuildTaskQueueExecutor();
+}
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
index 0c378f9..d0386b9 100644
--- a/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
@@ -21,6 +21,7 @@
import java.util.Map;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.codehaus.plexus.taskqueue.Task;
public class PrepareBuildProjectsTask
@@ -28,7 +29,7 @@
{
private final Map<Integer, Integer> projectsBuildDefinitionsMap;
- private final int trigger;
+ private BuildTrigger buildTrigger;
private final int projectGroupId;
@@ -38,11 +39,11 @@
private final int projectScmRootId;
- public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId,
+ public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId,
String projectGroupName, String scmRootAddress, int projectScmRootId )
{
this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap;
- this.trigger = trigger;
+ this.buildTrigger = buildTrigger;
this.projectGroupId = projectGroupId;
this.projectGroupName = projectGroupName;
this.scmRootAddress = scmRootAddress;
@@ -60,9 +61,9 @@
return projectsBuildDefinitionsMap;
}
- public int getTrigger()
+ public BuildTrigger getBuildTrigger()
{
- return trigger;
+ return buildTrigger;
}
public int getHashCode()
@@ -85,8 +86,13 @@
return scmRootAddress;
}
+ public int getProjectScmRootId()
+ {
+ return projectScmRootId;
+ }
+
public int hashCode()
{
- return this.projectGroupId + this.projectScmRootId + this.trigger;
+ return this.projectGroupId + this.projectScmRootId + this.buildTrigger.getTrigger();
}
}
diff --git a/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java b/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
index 1c8e31c..54c98f7 100644
--- a/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
+++ b/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
@@ -19,9 +19,6 @@
* under the License.
*/
-import java.util.List;
-
-import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.codehaus.plexus.taskqueue.TaskQueue;;
/**
@@ -31,16 +28,8 @@
{
String ROLE = TaskQueueManager.class.getName();
- TaskQueue getDistributedBuildQueue();
-
- List<PrepareBuildProjectsTask> getDistributedBuildProjectsInQueue()
- throws TaskQueueManagerException;
-
TaskQueue getPurgeQueue();
- boolean isInDistributedBuildQueue( int projectGroupId, String scmRootAddress )
- throws TaskQueueManagerException;
-
boolean isInPurgeQueue( int purgeConfigurationId )
throws TaskQueueManagerException;
@@ -77,9 +66,6 @@
boolean releaseInProgress()
throws TaskQueueManagerException;
- void removeFromDistributedBuildQueue( int projectGroupId, String scmRootAddress )
- throws TaskQueueManagerException;
-
/**
* Remove local repository from the purge queue
*
@@ -108,7 +94,4 @@
*/
void removeRepositoryFromPurgeQueue( int repositoryId )
throws TaskQueueManagerException;
-
- void removeTasksFromDistributedBuildQueueWithHashCodes( int[] hashCodes )
- throws TaskQueueManagerException;
}
diff --git a/continuum-commons/src/main/java/org/apache/continuum/utils/ProjectSorter.java b/continuum-api/src/main/java/org/apache/continuum/utils/ProjectSorter.java
similarity index 90%
rename from continuum-commons/src/main/java/org/apache/continuum/utils/ProjectSorter.java
rename to continuum-api/src/main/java/org/apache/continuum/utils/ProjectSorter.java
index 8388def..1f04c0d 100644
--- a/continuum-commons/src/main/java/org/apache/continuum/utils/ProjectSorter.java
+++ b/continuum-api/src/main/java/org/apache/continuum/utils/ProjectSorter.java
@@ -36,7 +36,7 @@
* Sort projects by dependencies.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id$
+ * @version $Id: ProjectSorter.java 777411 2009-05-22 07:13:37Z ctan $
*/
public class ProjectSorter
{
@@ -68,7 +68,7 @@
if ( dag.getVertex( id ) != null )
{
- logger.warn( "Project '" + id + "' is duplicated in the reactor" );
+ logger.warn( "Project '" + id + "' is duplicated in the reactor." );
}
dag.addVertex( id );
@@ -79,13 +79,15 @@
for ( Project project : projects )
{
String id = getProjectId( project );
+
+ String projectGroupId = "[" + project.getProjectGroup().getId() + "]";
// Dependencies
for ( Object o : project.getDependencies() )
{
ProjectDependency dependency = (ProjectDependency) o;
- String dependencyId = getDependencyId( dependency );
+ String dependencyId = projectGroupId + ":" + getDependencyId( dependency );
if ( dag.getVertex( dependencyId ) != null )
{
@@ -105,7 +107,7 @@
if ( parent != null )
{
- String parentId = getDependencyId( parent );
+ String parentId = projectGroupId + ":" + getDependencyId( parent );
if ( dag.getVertex( parentId ) != null )
{
@@ -161,8 +163,10 @@
{
artifactId = project.getArtifactId();
}
+
+ String projectGroupId = "[" + project.getProjectGroup().getId() + "]";
- return groupId + ":" + artifactId + ":" + project.getVersion();
+ return projectGroupId + ":" + groupId + ":" + artifactId + ":" + project.getVersion();
}
private static String getDependencyId( ProjectDependency project )
diff --git a/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java b/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java
new file mode 100644
index 0000000..2c8262b
--- /dev/null
+++ b/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java
@@ -0,0 +1,69 @@
+package org.apache.continuum.utils.build;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author Jevica Arianne B. Zurbano
+ * @version $Id: BuildTrigger.java
+ * @since 19 jun 09
+ */
+public class BuildTrigger
+{
+ private int trigger;
+
+ private String username;
+
+ public BuildTrigger( int trigger )
+ {
+ this.trigger = trigger;
+ }
+
+ public BuildTrigger( String username )
+ {
+ this.username = username;
+ }
+
+ public BuildTrigger( int trigger, String username )
+ {
+ this.trigger = trigger;
+ this.username = username;
+ }
+
+ public void setTrigger( int trigger )
+ {
+ this.trigger = trigger;
+ }
+
+ public int getTrigger()
+ {
+ return this.trigger;
+ }
+
+ public void setUsername( String username )
+ {
+ this.username = username;
+ }
+
+ public String getUsername()
+ {
+ return this.username;
+ }
+}
+
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java b/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
index c3bff4c..828ec0b 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
@@ -24,8 +24,11 @@
import java.util.List;
import java.util.Map;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.continuum.model.project.ProjectGroupSummary;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.purge.ContinuumPurgeManager;
@@ -33,6 +36,7 @@
import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.installation.InstallationService;
@@ -64,13 +68,6 @@
public ProjectGroup getProjectGroup( int projectGroupId )
throws ContinuumException;
- /**
- * Get all {@link ProjectGroup}s and their {@link Project}s
- *
- * @return {@link Collection} <{@link ProjectGroup}>
- */
- public Collection<ProjectGroup> getAllProjectGroupsWithProjects();
-
public List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
public List<ProjectGroup> getAllProjectGroups();
@@ -117,6 +114,7 @@
* @throws ContinuumException
* @deprecated
*/
+ @Deprecated
void checkoutProject( int projectId )
throws ContinuumException;
@@ -126,11 +124,6 @@
Project getProjectWithBuildDetails( int projectId )
throws ContinuumException;
- List<Project> getAllProjectsWithAllDetails( int start, int end );
-
- Collection<Project> getAllProjects( int start, int end )
- throws ContinuumException;
-
Collection<Project> getProjects()
throws ContinuumException;
@@ -141,19 +134,14 @@
Map<Integer, BuildResult> getLatestBuildResults( int projectGroupId );
- Map<Integer, BuildResult> getLatestBuildResults();
-
Map<Integer, BuildResult> getBuildResultsInSuccess( int projectGroupId );
- Map<Integer, BuildResult> getBuildResultsInSuccess();
+ Map<Integer, ProjectGroupSummary> getProjectsSummaryByGroups();
// ----------------------------------------------------------------------
// Building
// ----------------------------------------------------------------------
- List<Project> getProjectsInBuildOrder()
- throws ContinuumException;
-
/**
* take a collection of projects and sort for order
*
@@ -162,44 +150,41 @@
*/
List<Project> getProjectsInBuildOrder( Collection<Project> projects );
- void buildProjects()
- throws ContinuumException;
-
- void buildProjectsWithBuildDefinition( int buildDefinitionId )
- throws ContinuumException;
+ void buildProjects( String username )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
- throws ContinuumException;
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
void buildProjectsWithBuildDefinition( List<Project> projects, int buildDefinitionId )
- throws ContinuumException;
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- void buildProjects( int trigger )
- throws ContinuumException;
+ void buildProjects( BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- void buildProjects( int trigger, int buildDefinitionId )
- throws ContinuumException;
+ void buildProjects( BuildTrigger buildTrigger, int buildDefinitionId )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
void buildProjects( Schedule schedule )
throws ContinuumException;
- void buildProject( int projectId )
- throws ContinuumException;
+ void buildProject( int projectId, String username )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- void buildProject( int projectId, int trigger )
- throws ContinuumException;
+ void buildProject( int projectId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId )
- throws ContinuumException;
+ void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- void buildProject( int projectId, int buildDefinitionId, int trigger )
- throws ContinuumException;
+ void buildProject( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- public void buildProjectGroup( int projectGroupId )
- throws ContinuumException;
+ public void buildProjectGroup( int projectGroupId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
- public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId )
- throws ContinuumException;
+ public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
// ----------------------------------------------------------------------
// Build information
@@ -337,14 +322,13 @@
* @param useCredentialsCache whether to use cached scm account credentials or not
* @param loadRecursiveProjects if multi modules project record all projects (if false only root project added)
* @param buildDefintionTemplateId buildDefintionTemplateId
- * @param checkoutInSingleDirector if multi module project, check out the entire project in a single directory (handle flat multi-modules)
* @return a holder with the projects, project groups and errors occurred during the project adding
* @throws ContinuumException
*/
public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
boolean checkProtocol, boolean useCredentialsCache,
boolean loadRecursiveProjects,
- int buildDefintionTemplateId, boolean checkoutInSingleDirectory )
+ int buildDefintionTemplateId )
throws ContinuumException;
/**
@@ -438,18 +422,21 @@
/**
* @deprecated
*/
+ @Deprecated
List<BuildDefinition> getBuildDefinitions( int projectId )
throws ContinuumException;
/**
* @deprecated
*/
+ @Deprecated
BuildDefinition getBuildDefinition( int projectId, int buildDefinitionId )
throws ContinuumException;
/**
* @deprecated
*/
+ @Deprecated
void removeBuildDefinition( int projectId, int buildDefinitionId )
throws ContinuumException;
@@ -527,6 +514,10 @@
void removeSchedule( int scheduleId )
throws ContinuumException;
+ void activePurgeSchedule( Schedule schedule );
+
+ void activeBuildDefinitionSchedule( Schedule schedule );
+
// ----------------------------------------------------------------------
// Working copy
// ----------------------------------------------------------------------
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivator.java b/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivator.java
index abf14af..9a3520e 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivator.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivator.java
@@ -48,6 +48,22 @@
*/
void activateSchedule( Schedule schedule, Continuum continuum )
throws SchedulesActivationException;
+
+ /**
+ * Activate schedule only for PurgeConfiguration associated.
+ *
+ * @throws SchedulesActivationException
+ */
+ void activatePurgeSchedule( Schedule schedule, Continuum continuum )
+ throws SchedulesActivationException;
+
+ /**
+ * Activate schedule only for BuildDefinitions associated.
+ *
+ * @throws SchedulesActivationException
+ */
+ void activateBuildSchedule( Schedule schedule, Continuum continuum )
+ throws SchedulesActivationException;
/**
* Unactivate schedule by looking at the scheduling information contained within.
@@ -56,4 +72,18 @@
*/
void unactivateSchedule( Schedule schedule, Continuum continuum )
throws SchedulesActivationException;
+
+ /**
+ * Unactivate schedule purgeConfigurations if it is not in a purgeConfiguration.
+ */
+ void unactivateOrphanPurgeSchedule( Schedule schedule )
+ throws SchedulesActivationException;
+
+ /**
+ * Unactivate schedule buildDefinitions if it is not in a buildDefinition.
+ *
+ * @throws SchedulesActivationException
+ */
+ void unactivateOrphanBuildSchedule( Schedule schedule )
+ throws SchedulesActivationException;
}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java b/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionUpdatePolicyConstants.java
similarity index 61%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
copy to continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionUpdatePolicyConstants.java
index c829c6d..6b47d27 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionUpdatePolicyConstants.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.maven.continuum.builddefinition;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -9,7 +9,7 @@
* "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
+ * 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
@@ -19,20 +19,16 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-
/**
- * Goal which add a Shell Project.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @author Jose Morales Martinez
* @version $Id$
- * @goal add-shell-project
*/
-public class AddShellProject
- extends AbstractAddProject
+public class BuildDefinitionUpdatePolicyConstants
{
- protected String getProjectType()
- {
- return ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
- }
+
+ public static final int UPDATE_DESCRIPTION_ALWAYS = 0;
+
+ public static final int UPDATE_DESCRIPTION_NEVER = 1;
+
+ public static final int UPDATE_DESCRIPTION_ONLY_FOR_NEW_POM = 2;
}
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java b/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
index fb96c23..368768c 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
@@ -23,9 +23,11 @@
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.scm.ScmResult;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -40,7 +42,8 @@
throws ContinuumBuildExecutorException;
// TODO: rename to be clearer
- void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
+ void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException;
boolean isBuilding( Project project );
@@ -52,7 +55,7 @@
throws ContinuumBuildExecutorException;
//TODO: Move as a plugin
- void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot );
+ void backupTestFiles( Project project, int buildId );
boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory,
BuildDefinition buildDefinition )
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java b/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
index b07c112..1caa092 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
@@ -35,12 +35,12 @@
throws ContinuumProjectBuilderException;
ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
- boolean recursiveProjects, boolean checkoutInSingleDirectory )
+ boolean recursiveProjects )
throws ContinuumProjectBuilderException;
ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
boolean recursiveProjects,
- BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+ BuildDefinitionTemplate buildDefinitionTemplate )
throws ContinuumProjectBuilderException;
BuildDefinitionTemplate getDefaultBuildDefinitionTemplate()
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java b/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
index 09123a0..362980b 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
@@ -83,6 +83,8 @@
public static final String ERROR_UNKNOWN = "add.project.unknown.error";
+ public static final String ERROR_DUPLICATE_PROJECTS = "add.project.duplicate.error";
+
private final List<Project> projects = new ArrayList<Project>();
private final List<ProjectGroup> projectGroups = new ArrayList<ProjectGroup>();
@@ -90,9 +92,7 @@
private final Map<String, String> errors = new HashMap<String, String>();
private static final String LS = System.getProperty( "line.separator" );
-
- private Project rootProject;
-
+
public void addProject( Project project )
{
projects.add( project );
@@ -222,14 +222,4 @@
}
return message.toString();
}
-
- public Project getRootProject()
- {
- return rootProject;
- }
-
- public void setRootProject( Project rootProject )
- {
- this.rootProject = rootProject;
- }
}
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java b/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
index 892ef04..2ef33c1 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
@@ -81,6 +81,7 @@
* @param buildDirectory
* @param goals
* @param useReleaseProfile
+ * @param listener
* @throws ContinuumReleaseException
*/
void perform( String releaseId, File buildDirectory, String goals, String arguments, boolean useReleaseProfile,
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java b/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
index a9610c4..54a168d 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
@@ -40,4 +40,8 @@
String getError();
int getState();
+
+ String getUsername();
+
+ void setUsername( String username );
}
diff --git a/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java b/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
index f364d53..5caa5ba 100644
--- a/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
+++ b/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
@@ -22,7 +22,6 @@
import org.apache.maven.continuum.model.project.Project;
import java.io.File;
-import java.util.List;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -33,6 +32,4 @@
String ROLE = WorkingDirectoryService.class.getName();
File getWorkingDirectory( Project project );
-
- File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project> projects );
}
diff --git a/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java b/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
new file mode 100644
index 0000000..0d90709
--- /dev/null
+++ b/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
@@ -0,0 +1,227 @@
+package org.apache.continuum.utils;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDependency;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:jmcconnell@apache.org">Jesse McConnell</a>
+ * @version $Id:$
+ */
+public class ProjectSorterTest
+ extends TestCase
+{
+
+ /**
+ * test basic three project tree (really a line in this case)
+ */
+ public void testBasicNestedProjectStructure()
+ throws Exception
+ {
+ List<Project> list = new ArrayList<Project>();
+
+ Project top = getNewProject( "top" );
+ list.add( top );
+
+ Project c1 = getNewProject( "c1" );
+ c1.setParent( generateProjectDependency( top ) );
+ list.add( c1 );
+
+ Project c2 = getNewProject( "c2" );
+ c2.setParent( generateProjectDependency( top ) );
+ c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) ) );
+ list.add( c2 );
+
+ List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
+
+ assertNotNull( sortedList );
+
+ Project p1 = sortedList.get( 0 );
+ assertEquals( top.getArtifactId(), p1.getArtifactId() );
+ Project p2 = sortedList.get( 1 );
+ assertEquals( c1.getArtifactId(), p2.getArtifactId() );
+ Project p3 = sortedList.get( 2 );
+ assertEquals( c2.getArtifactId(), p3.getArtifactId() );
+ }
+
+ public void testNestedProjectStructureWithoutModulesDefinedInParentPom()
+ throws Exception
+ {
+ Project top = getNewProject( "top" );
+
+ Project war1 = getNewProject( "war1" );
+ war1.setParent( generateProjectDependency( top ) );
+
+ Project war2 = getNewProject( "war2" );
+ war2.setParent( generateProjectDependency( top ) );
+
+ Project ear1 = getNewProject( "ear1" );
+ ear1.setParent( generateProjectDependency( top ) );
+ List<ProjectDependency> deps = new ArrayList<ProjectDependency>();
+ deps.add( generateProjectDependency( war1 ) );
+ deps.add( generateProjectDependency( war2 ) );
+ ear1.setDependencies( deps );
+
+ List<Project> list = new ArrayList<Project>();
+
+ // We add projects in a random order to really check the project orter
+ list.add( top );
+ list.add( ear1 );
+ list.add( war1 );
+ list.add( war2 );
+
+ List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
+
+ assertNotNull( sortedList );
+
+ Project p1 = sortedList.get( 0 ); //top project must be the first
+ assertEquals( top.getArtifactId(), p1.getArtifactId() );
+ Project p4 = sortedList.get( 3 ); //ear1 project must be the latest
+ assertEquals( ear1.getArtifactId(), p4.getArtifactId() );
+ }
+
+ /**
+ * test project build order
+ * build order: B -> A -> D -> C -> E
+ *
+ * @throws Exception
+ */
+ public void testProjectBuildOrder()
+ throws Exception
+ {
+ List<Project> list = new ArrayList<Project>();
+
+ Project projectA = getNewProject( "A" );
+ Project projectB = getNewProject( "B" );
+ Project projectC = getNewProject( "C" );
+ Project projectD = getNewProject( "D" );
+ Project projectE = getNewProject( "E" );
+
+ projectA.setParent( generateProjectDependency( projectB ) );
+ projectE.setParent( generateProjectDependency( projectB ) );
+ projectC.setParent( generateProjectDependency( projectA ) );
+ projectC.setDependencies( Collections.singletonList( generateProjectDependency( projectD ) ) );
+ projectD.setParent( generateProjectDependency( projectA ) );
+
+ list.add( projectA );
+ list.add( projectB );
+ list.add( projectC );
+ list.add( projectD );
+ list.add( projectE );
+
+ List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
+ assertNotNull( sortedList );
+
+ List<Project> expectedList = new ArrayList<Project>();
+
+ expectedList.add( projectB );
+ expectedList.add( projectA );
+ expectedList.add( projectD );
+ expectedList.add( projectC );
+ expectedList.add( projectE );
+
+ for ( int i = 0; i < sortedList.size(); i++ )
+ {
+ Project sorted = sortedList.get( i );
+ Project expected = expectedList.get( i );
+ assertEquals( sorted.getArtifactId(), expected.getArtifactId() );
+ }
+ }
+
+ /**
+ * test one of the child projects not having the artifactId or groupId empty and working off the
+ * name instead
+ */
+ public void testIncompleteNestedProjectStructure()
+ throws Exception
+ {
+ List<Project> list = new ArrayList<Project>();
+
+ Project top = getNewProject( "top" );
+ list.add( top );
+
+ Project c1 = getIncompleteProject( "c1" );
+ c1.setParent( generateProjectDependency( top ) );
+ list.add( c1 );
+
+ Project c2 = getNewProject( "c2" );
+ c2.setParent( generateProjectDependency( top ) );
+ c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) ) );
+ list.add( c2 );
+
+ List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
+
+ assertNotNull( sortedList );
+
+ Project p1 = sortedList.get( 0 );
+ assertEquals( top.getArtifactId(), p1.getArtifactId() );
+ Project p2 = sortedList.get( 1 );
+ assertEquals( c1.getArtifactId(), p2.getArtifactId() );
+ Project p3 = sortedList.get( 2 );
+ assertEquals( c2.getArtifactId(), p3.getArtifactId() );
+ }
+
+ /**
+ * project sorter can work with name replacing the artifactid and groupId
+ *
+ * @param projectId The project id
+ * @return The generated Project
+ */
+ private Project getIncompleteProject( String projectId )
+ {
+ Project project = new Project();
+ project.setName( "foo" + projectId );
+ project.setVersion( "v" + projectId );
+ project.setProjectGroup( new ProjectGroup() );
+
+ return project;
+ }
+
+ private Project getNewProject( String projectId )
+ {
+ Project project = new Project();
+ project.setArtifactId( "a" + projectId );
+ project.setGroupId( "g" + projectId );
+ project.setVersion( "v" + projectId );
+ project.setName( "n" + projectId );
+ project.setProjectGroup( new ProjectGroup() );
+
+ return project;
+ }
+
+ private ProjectDependency generateProjectDependency( Project project )
+ {
+ ProjectDependency dep = new ProjectDependency();
+ dep.setArtifactId( project.getArtifactId() );
+ dep.setGroupId( project.getGroupId() );
+ dep.setVersion( project.getVersion() );
+
+ return dep;
+ }
+
+}
diff --git a/continuum-base/continuum-configuration/pom.xml b/continuum-base/continuum-configuration/pom.xml
index 4a5aec9..384df71 100644
--- a/continuum-base/continuum-configuration/pom.xml
+++ b/continuum-base/continuum-configuration/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-base</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-configuration</artifactId>
@@ -36,6 +36,7 @@
<model>src/main/mdo/continuum-configuration.xml</model>
</models>
<version>1.1.1</version>
+ <useJava5>true</useJava5>
</configuration>
<executions>
<execution>
diff --git a/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java b/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
index e18b254..fa85055 100644
--- a/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
+++ b/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
@@ -31,6 +31,7 @@
import org.apache.continuum.configuration.model.ContinuumConfigurationModel;
import org.apache.continuum.configuration.model.io.xpp3.ContinuumConfigurationModelXpp3Reader;
import org.apache.continuum.configuration.model.io.xpp3.ContinuumConfigurationModelXpp3Writer;
+import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -114,11 +115,12 @@
public void reload( File file )
throws ContinuumConfigurationException
{
+ FileInputStream fis = null;
try
{
+ fis = new FileInputStream( file );
ContinuumConfigurationModelXpp3Reader configurationXpp3Reader = new ContinuumConfigurationModelXpp3Reader();
- ContinuumConfigurationModel configuration =
- configurationXpp3Reader.read( new InputStreamReader( new FileInputStream( file ) ) );
+ ContinuumConfigurationModel configuration = configurationXpp3Reader.read( new InputStreamReader( fis ) );
this.generalConfiguration = new GeneralConfiguration();
@@ -208,7 +210,13 @@
log.error( e.getMessage(), e );
throw new RuntimeException( e.getMessage(), e );
}
-
+ finally
+ {
+ if ( fis != null )
+ {
+ IOUtil.close( fis );
+ }
+ }
}
public void save( File file )
@@ -308,6 +316,8 @@
ContinuumConfigurationModelXpp3Writer writer = new ContinuumConfigurationModelXpp3Writer();
FileWriter fileWriter = new FileWriter( file );
writer.write( fileWriter, configurationModel );
+ fileWriter.flush();
+ fileWriter.close();
}
catch ( IOException e )
{
diff --git a/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml b/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
index fd61fb5..87f7736 100644
--- a/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
+++ b/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
@@ -17,7 +17,7 @@
~ under the License.
-->
-<model>
+<model xsd.namespace="http://modello.codehaus.org/xsd/modello-1.0.0.xsd">
<id>continuum-configuration</id>
<name>ContinuumConfigurationModel</name>
<description>Continuum Configuration object model.</description>
diff --git a/continuum-base/continuum-scm/pom.xml b/continuum-base/continuum-scm/pom.xml
index 1276abc..a6d99d4 100644
--- a/continuum-base/continuum-scm/pom.xml
+++ b/continuum-base/continuum-scm/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-base</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-scm</artifactId>
diff --git a/continuum-base/pom.xml b/continuum-base/pom.xml
index 8de9cee..7a42cdd 100644
--- a/continuum-base/pom.xml
+++ b/continuum-base/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-base</artifactId>
diff --git a/continuum-buildagent/continuum-buildagent-api/pom.xml b/continuum-buildagent/continuum-buildagent-api/pom.xml
index ca48c3d..c8bf54b 100644
--- a/continuum-buildagent/continuum-buildagent-api/pom.xml
+++ b/continuum-buildagent/continuum-buildagent-api/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-buildagent</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-buildagent-api</artifactId>
@@ -37,7 +37,8 @@
<models>
<model>src/main/mdo/continuum-buildagent.xml</model>
</models>
- <version>1.0.0</version>
+ <useJava5>true</useJava5>
+ <version>1.1.0</version>
</configuration>
<executions>
<execution>
diff --git a/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
index ac80a07..8404f44 100644
--- a/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
+++ b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
@@ -33,7 +33,7 @@
Map<String, Object> getBuildResult( int projectId )
throws ContinuumBuildAgentException;
- int getProjectCurrentlyBuilding()
+ Map<String, Object> getProjectCurrentlyBuilding()
throws ContinuumBuildAgentException;
void cancelBuild()
@@ -52,7 +52,7 @@
throws ContinuumBuildAgentException;
String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
- Map<String, String> environments )
+ Map<String, String> environments, String username )
throws ContinuumBuildAgentException;
Map<String, Object> getReleaseResult( String releaseId )
@@ -67,12 +67,12 @@
String getPreparedReleaseName( String releaseId )
throws ContinuumBuildAgentException;
- void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository )
+ void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository, String username )
throws ContinuumBuildAgentException;
String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map<String, String> environments )
+ String scmTagBase, Map<String, String> environments, String username )
throws ContinuumBuildAgentException;
String releaseCleanup( String releaseId )
@@ -80,4 +80,44 @@
void releaseRollback( String releaseId, int projectId )
throws ContinuumBuildAgentException;
+
+ List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws ContinuumBuildAgentException;
+
+ List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws ContinuumBuildAgentException;
+
+ List<Map<String, Object>> getProjectsInBuildQueue()
+ throws ContinuumBuildAgentException;
+
+ int getBuildSizeOfAgent()
+ throws ContinuumBuildAgentException;
+
+ Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws ContinuumBuildAgentException;
+
+ List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws ContinuumBuildAgentException;
+
+ boolean isProjectGroupInQueue( int projectGroupId );
+
+ boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds );
+
+ boolean isProjectCurrentlyBuilding( int projectId );
+
+ boolean isProjectInBuildQueue( int projectId );
+
+ boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws ContinuumBuildAgentException;
+
+ void removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws ContinuumBuildAgentException;
+
+ boolean removeFromBuildQueue( int projectId, int builddefinitonId )
+ throws ContinuumBuildAgentException;
+
+ void removeFromBuildQueue( List<String> hashCodes )
+ throws ContinuumBuildAgentException;
+
+ boolean ping();
}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentException.java
similarity index 64%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
copy to continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentException.java
index c829c6d..610dd1d 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
+++ b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentException.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.continuum.buildagent;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,21 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-
-/**
- * Goal which add a Shell Project.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-shell-project
- */
-public class AddShellProject
- extends AbstractAddProject
+public class NoBuildAgentException
+ extends Exception
{
- protected String getProjectType()
+ public NoBuildAgentException( String message )
{
- return ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
+ super( message );
+ }
+
+ public NoBuildAgentException( Throwable cause )
+ {
+ super( cause );
+ }
+
+ public NoBuildAgentException( String message, Throwable cause )
+ {
+ super( message, cause );
}
}
diff --git a/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentInGroupException.java b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentInGroupException.java
new file mode 100644
index 0000000..c807f73
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/NoBuildAgentInGroupException.java
@@ -0,0 +1,20 @@
+package org.apache.continuum.buildagent;
+
+public class NoBuildAgentInGroupException
+ extends Exception
+{
+ public NoBuildAgentInGroupException( String message )
+ {
+ super( message );
+ }
+
+ public NoBuildAgentInGroupException( Throwable cause )
+ {
+ super( cause );
+ }
+
+ public NoBuildAgentInGroupException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml b/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
index 7706aba..5e8c452 100644
--- a/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
+++ b/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
@@ -16,7 +16,7 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-<model>
+<model xsd.namespace="http://modello.codehaus.org/xsd/modello-1.0.0.xsd">
<id>continuum-buildagent</id>
<name>ContinuumBuildAgentConfigurationModel</name>
<description>Continuum Build Agent object model.</description>
@@ -55,6 +55,14 @@
<multiplicity>*</multiplicity>
</association>
</field>
+ <field>
+ <name>localRepositories</name>
+ <version>1.1.0+</version>
+ <association>
+ <type>LocalRepository</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
</fields>
</class>
<class xml.tagName="buildagent-installation">
@@ -83,5 +91,35 @@
</field>
</fields>
</class>
+ <class>
+ <name>LocalRepository</name>
+ <version>1.1.0+</version>
+ <fields>
+ <field>
+ <name>name</name>
+ <version>1.1.0+</version>
+ <type>String</type>
+ <required>true</required>
+ </field>
+ <field>
+ <name>location</name>
+ <version>1.1.0+</version>
+ <type>String</type>
+ <required>true</required>
+ <description>
+ The file system location for this repository
+ </description>
+ </field>
+ <field>
+ <name>layout</name>
+ <version>1.1.0+</version>
+ <type>String</type>
+ <defaultValue>default</defaultValue>
+ <description>
+ The layout of the repository. Valid values are "default" and "legacy"
+ </description>
+ </field>
+ </fields>
+ </class>
</classes>
</model>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/pom.xml b/continuum-buildagent/continuum-buildagent-core/pom.xml
index 7b5bf12..ef18757 100644
--- a/continuum-buildagent/continuum-buildagent-core/pom.xml
+++ b/continuum-buildagent/continuum-buildagent-core/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-buildagent</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-buildagent-core</artifactId>
@@ -125,7 +125,39 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jmock</groupId>
+ <artifactId>jmock-junit3</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- dependency of jmock3 -->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- dependency of jmock3 -->
+ <dependency>
+ <groupId>org.objenesis</groupId>
+ <artifactId>objenesis</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -135,15 +167,24 @@
<executions>
<execution>
<id>generate</id>
+ <phase>generate-resources</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>merge</id>
+ <phase>process-resources</phase>
<goals>
<goal>merge-descriptors</goal>
</goals>
+ <configuration>
+ <descriptors>
+ <descriptor>${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml</descriptor>
+ <descriptor>${project.build.outputDirectory}/META-INF/plexus/components.xml</descriptor>
+ </descriptors>
+ <output>${project.build.outputDirectory}/META-INF/plexus/components.xml</output>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
index 3bd4180..f2b191b 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
@@ -30,6 +30,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.continuum.buildagent.buildcontext.BuildContext;
import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
@@ -40,7 +41,9 @@
import org.apache.continuum.buildagent.taskqueue.manager.BuildAgentTaskQueueManager;
import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
import org.apache.continuum.buildagent.utils.WorkingCopyContentGenerator;
+import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.scm.ChangeFile;
@@ -175,13 +178,25 @@
{
Map<String, Object> result = new HashMap<String, Object>();
- if ( projectId == getProjectCurrentlyBuilding() )
+ int currentBuildId = 0;
+
+ try
+ {
+ currentBuildId = buildAgentTaskQueueManager.getIdOfProjectCurrentlyBuilding();
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ throw new ContinuumBuildAgentException( e.getMessage(), e );
+ }
+
+ if ( projectId == currentBuildId )
{
BuildContext buildContext = buildContextManager.getBuildContext( projectId );
result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+ result.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
BuildResult buildResult = buildContext.getBuildResult();
@@ -235,19 +250,6 @@
return result;
}
- public int getProjectCurrentlyBuilding()
- throws ContinuumBuildAgentException
- {
- try
- {
- return buildAgentTaskQueueManager.getCurrentProjectInBuilding();
- }
- catch ( TaskQueueManagerException e )
- {
- throw new ContinuumBuildAgentException( e.getMessage(), e );
- }
- }
-
public void cancelBuild()
throws ContinuumBuildAgentException
{
@@ -476,13 +478,13 @@
}
public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
- Map<String, String> environments )
+ Map<String, String> environments, String username )
throws ContinuumBuildAgentException
{
try
{
return buildAgentReleaseManager.releasePrepare( project, properties, releaseVersion, developmentVersion,
- environments );
+ environments, username );
}
catch ( ContinuumReleaseException e )
{
@@ -521,12 +523,12 @@
}
public void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
- Map repository )
+ Map repository, String username )
throws ContinuumBuildAgentException
{
try
{
- buildAgentReleaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+ buildAgentReleaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
}
catch ( ContinuumReleaseException e )
{
@@ -536,14 +538,14 @@
public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map<String, String> environments )
+ String scmTagBase, Map<String, String> environments, String username )
throws ContinuumBuildAgentException
{
try
{
return buildAgentReleaseManager.releasePerformFromScm( goals, arguments, useReleaseProfile, repository,
scmUrl, scmUsername, scmPassword, scmTag, scmTagBase,
- environments );
+ environments, username );
}
catch ( ContinuumReleaseException e )
{
@@ -570,6 +572,409 @@
}
}
+ public int getBuildSizeOfAgent()
+ {
+ int size = 0;
+
+ try
+ {
+ if ( buildAgentTaskQueueManager.getCurrentProjectInBuilding() != null )
+ {
+ size++;
+ }
+
+ if ( buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild() != null )
+ {
+ size++;
+ }
+
+ size = size + buildAgentTaskQueueManager.getProjectsInBuildQueue().size();
+
+ size = size + buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue().size();
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while getting build size of agent" );
+ }
+
+ return size;
+ }
+
+ public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+ for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+ map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
+ map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
+ map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+ map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+
+ projects.add( map );
+ }
+
+ return projects;
+ }
+ catch( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving projects in prepare build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in prepare build queue", e );
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+ for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+ {
+ for ( BuildContext context : task.getBuildContexts() )
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
+ map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
+
+ projects.add( map );
+ }
+ }
+
+ return projects;
+ }
+ catch( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving projects in prepare build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in prepare build queue", e );
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsInBuildQueue()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+ for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
+ map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
+ map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+ map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+ map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
+
+ projects.add( map );
+ }
+
+ return projects;
+ }
+ catch( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving projects in build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in build queue", e );
+ }
+ }
+
+ public Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ Map<String, Object> project = new HashMap<String, Object>();
+
+ PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+ if ( task != null )
+ {
+ project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+ project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
+ project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
+ project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+ project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+ }
+
+ return project;
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving current project in prepare build", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving current project in prepare build", e );
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+ PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+ if ( task != null )
+ {
+ for ( BuildContext context : task.getBuildContexts() )
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
+ map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
+
+ projects.add( map );
+ }
+ }
+
+ return projects;
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving current projects in prepare build", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving current projects in prepare build", e );
+ }
+ }
+ public Map<String, Object> getProjectCurrentlyBuilding()
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ Map<String, Object> project = new HashMap<String, Object>();
+
+ BuildProjectTask task = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+ if ( task != null )
+ {
+ project.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
+ project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
+ project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+ project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+ project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+ project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
+ }
+
+ return project;
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while retrieving current project in building", e );
+ throw new ContinuumBuildAgentException( "Error occurred while retrieving current project in building", e );
+ }
+ }
+
+ public boolean isProjectGroupInQueue( int projectGroupId )
+ {
+ try
+ {
+ PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+ if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getProjectGroupId() == projectGroupId )
+ {
+ return true;
+ }
+
+ BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+ if ( currentBuildTask != null && currentBuildTask.getProjectGroupId() == projectGroupId )
+ {
+ return true;
+ }
+
+ for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+ {
+ if ( task.getProjectGroupId() == projectGroupId )
+ {
+ return true;
+ }
+ }
+
+ for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+ {
+ if ( task.getProjectGroupId() == projectGroupId )
+ {
+ return true;
+ }
+ }
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error while checking if project group " + projectGroupId + " is queued in agent", e);
+ }
+
+ return false;
+ }
+
+ public boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+ {
+ try
+ {
+ PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+ if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getScmRootId() == projectScmRootId )
+ {
+ return true;
+ }
+
+ BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+ if ( currentBuildTask != null )
+ {
+ int projectId = currentBuildTask.getProjectId();
+
+ for ( Integer pid : projectIds )
+ {
+ if ( pid == projectId )
+ {
+ return true;
+ }
+ }
+ }
+
+ for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+ {
+ if ( task.getScmRootId() == projectScmRootId )
+ {
+ return true;
+ }
+ }
+
+ for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+ {
+ int projectId = task.getProjectId();
+
+ for ( Integer pid : projectIds )
+ {
+ if ( pid == projectId )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error while checking if project scm root " + projectScmRootId + " is queued in agent", e);
+ }
+
+ return false;
+ }
+
+ public boolean isProjectCurrentlyBuilding( int projectId )
+ {
+ try
+ {
+ BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+ if ( currentBuildTask != null && currentBuildTask.getProjectId() == projectId )
+ {
+ return true;
+ }
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while checking if project " + projectId + " is currently building in agent", e );
+ }
+
+ return false;
+ }
+
+ public boolean isProjectInBuildQueue( int projectId )
+ {
+ try
+ {
+ List<BuildProjectTask> buildTasks = buildAgentTaskQueueManager.getProjectsInBuildQueue();
+
+ if ( buildTasks != null )
+ {
+ for ( BuildProjectTask task : buildTasks )
+ {
+ if ( task.getProjectId() == projectId )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while checking if project " + projectId + " is in build queue of agent", e );
+ }
+
+ return false;
+ }
+
+ public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ return buildAgentTaskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while removing projects from prepare build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+ }
+ }
+
+ public void removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ buildAgentTaskQueueManager.removeFromPrepareBuildQueue( listToIntArray( hashCodes ) );
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while removing projects from prepare build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+ }
+ }
+
+ public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ return buildAgentTaskQueueManager.removeFromBuildQueue( projectId, buildDefinitionId );
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while removing project from build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+ }
+ }
+
+ public void removeFromBuildQueue( List<String> hashCodes )
+ throws ContinuumBuildAgentException
+ {
+ try
+ {
+ buildAgentTaskQueueManager.removeFromBuildQueue( listToIntArray( hashCodes ) );
+ }
+ catch ( TaskQueueManagerException e )
+ {
+ log.error( "Error occurred while removing projects from build queue", e );
+ throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+ }
+ }
+
+ public boolean ping()
+ {
+ log.info( "Ping Ok" );
+
+ return Boolean.TRUE;
+ }
+
private void processProject( String workingDirectory, String pomFilename, boolean autoVersionSubmodules,
List<Map<String, String>> projects )
throws Exception
@@ -641,20 +1046,24 @@
context.setProjectGroupId( ContinuumBuildAgentUtil.getProjectGroupId( map ) );
context.setProjectGroupName( ContinuumBuildAgentUtil.getProjectGroupName( map ) );
context.setScmRootAddress( ContinuumBuildAgentUtil.getScmRootAddress( map ) );
+ context.setScmRootId( ContinuumBuildAgentUtil.getScmRootId( map ) );
context.setProjectName( ContinuumBuildAgentUtil.getProjectName( map ) );
context.setProjectState( ContinuumBuildAgentUtil.getProjectState( map ) );
context.setTrigger( ContinuumBuildAgentUtil.getTrigger( map ) );
+ context.setUsername( ContinuumBuildAgentUtil.getUsername( map ) );
context.setLocalRepository( ContinuumBuildAgentUtil.getLocalRepository( map ) );
context.setBuildNumber( ContinuumBuildAgentUtil.getBuildNumber( map ) );
context.setOldScmResult( getScmResult( ContinuumBuildAgentUtil.getOldScmChanges( map ) ) );
context.setLatestUpdateDate( ContinuumBuildAgentUtil.getLatestUpdateDate( map ) );
context.setBuildAgentUrl( ContinuumBuildAgentUtil.getBuildAgentUrl( map ) );
context.setMaxExecutionTime( ContinuumBuildAgentUtil.getMaxExecutionTime( map ) );
+ context.setBuildDefinitionLabel( ContinuumBuildAgentUtil.getBuildDefinitionLabel( map ) );
+ context.setScmTag( ContinuumBuildAgentUtil.getScmTag( map ) );
buildContext.add( context );
}
- buildContextManager.setBuildContextList( buildContext );
+ buildContextManager.addBuildContexts( buildContext );
return buildContext;
}
@@ -725,8 +1134,8 @@
if ( buildContexts != null && buildContexts.size() > 0 )
{
BuildContext context = buildContexts.get( 0 );
- return new PrepareBuildProjectsTask( buildContexts, context.getTrigger(), context.getProjectGroupId(),
- context.getScmRootAddress() );
+ return new PrepareBuildProjectsTask( buildContexts, new BuildTrigger( context.getTrigger(), context.getUsername() ),
+ context.getProjectGroupId(), context.getScmRootAddress(), context.getScmRootId() );
}
else
{
@@ -734,4 +1143,18 @@
return null;
}
}
+
+ private int[] listToIntArray( List<String> strings )
+ {
+ if ( strings == null || strings.isEmpty() )
+ {
+ return new int[0];
+ }
+ int[] array = new int[0];
+ for ( String intString : strings )
+ {
+ array = ArrayUtils.add( array, Integer.parseInt( intString ) );
+ }
+ return array;
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.java
index 2cab084..4666efc 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.java
@@ -1,5 +1,24 @@
package org.apache.continuum.buildagent.action;
+/*
+ * 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.
+ */
+
import java.io.File;
import java.util.Date;
import java.util.List;
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
index 6fb4c39..2cd70cf 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
@@ -27,6 +27,7 @@
import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.codehaus.plexus.action.AbstractAction;
import org.codehaus.plexus.taskqueue.TaskQueueException;
@@ -53,10 +54,12 @@
for ( BuildContext buildContext : buildContexts )
{
- BuildProjectTask buildProjectTask =
+ BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
+
+ BuildProjectTask buildProjectTask =
new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
- buildContext.getTrigger(), buildContext.getProjectName(), "",
- buildContext.getScmResult() );
+ buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
+ buildContext.getScmResult(), buildContext.getProjectGroupId() );
buildProjectTask.setMaxExecutionTime( buildContext.getMaxExecutionTime() * 1000 );
try
@@ -79,23 +82,6 @@
"Error while checking if project " + buildContext.getProjectId() + " is in build queue", e );
}
}
-
- try
- {
- boolean stop = false;
- while ( !stop )
- {
- if ( buildAgentTaskQueueManager.getCurrentProjectInBuilding() <= 0 &&
- !buildAgentTaskQueueManager.hasBuildTaskInQueue() )
- {
- stop = true;
- }
- }
- }
- catch ( TaskQueueManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
- }
}
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
index 2cfc56b..3b1693f 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
@@ -67,6 +67,8 @@
String localRepository = ContinuumBuildAgentUtil.getLocalRepository( context );
int trigger = ContinuumBuildAgentUtil.getTrigger( context );
+
+ String username = ContinuumBuildAgentUtil.getUsername( context );
ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() );
@@ -81,6 +83,8 @@
buildResult.setState( ContinuumProjectState.BUILDING );
buildResult.setTrigger( trigger );
+
+ buildResult.setUsername( username );
buildResult.setBuildDefinition( buildDefinition );
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.java
index 997f31f..3572d9c 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.java
@@ -1,5 +1,24 @@
package org.apache.continuum.buildagent.action;
+/*
+ * 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.
+ */
+
import java.io.File;
import java.util.Map;
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
index c65a7b3..b84c9f3 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
@@ -22,6 +22,7 @@
import java.util.Date;
import java.util.Map;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.scm.ScmResult;
@@ -39,6 +40,8 @@
private int buildDefinitionId;
+ private String buildDefinitionLabel;
+
private String buildFile;
private String goals;
@@ -53,7 +56,11 @@
private String scmPassword;
+ private String scmTag;
+
private int trigger;
+
+ private String username;
private boolean buildFresh;
@@ -63,6 +70,8 @@
private String scmRootAddress;
+ private int scmRootId;
+
private Map<String, Object> actionContext;
private ScmResult scmResult;
@@ -211,6 +220,16 @@
this.scmPassword = scmPassword;
}
+ public String getScmTag()
+ {
+ return scmTag;
+ }
+
+ public void setScmTag( String scmTag )
+ {
+ this.scmTag = scmTag;
+ }
+
public int getTrigger()
{
return trigger;
@@ -350,4 +369,34 @@
{
return maxExecutionTime;
}
+
+ public void setScmRootId( int scmRootId )
+ {
+ this.scmRootId = scmRootId;
+ }
+
+ public int getScmRootId()
+ {
+ return scmRootId;
+ }
+
+ public void setBuildDefinitionLabel( String buildDefinitionLabel )
+ {
+ this.buildDefinitionLabel = buildDefinitionLabel;
+ }
+
+ public String getBuildDefinitionLabel()
+ {
+ return buildDefinitionLabel;
+ }
+
+ public void setUsername( String username )
+ {
+ this.username = username;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
index 45f7e4b..51801dd 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
@@ -30,9 +30,11 @@
{
String ROLE = BuildContextManager.class.getName();
- public void setBuildContextList( List<BuildContext> buildContext );
+ public void addBuildContexts( List<BuildContext> buildContextList );
- public List<BuildContext> getBuildContextList();
+ public List<BuildContext> getBuildContexts();
public BuildContext getBuildContext( int projectId );
+
+ public void removeBuildContext( int projectId );
}
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
index 98caf52..8ca2eb7 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
@@ -19,7 +19,10 @@
* under the License.
*/
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.continuum.buildagent.buildcontext.BuildContext;
@@ -30,34 +33,50 @@
public class DefaultBuildContextManager
implements BuildContextManager
{
- public List<BuildContext> buildContexts;
+ public Map<Integer, BuildContext> buildContexts;
public BuildContext getBuildContext( int projectId )
{
- BuildContext context = null;
+ if ( buildContexts != null )
+ {
+ return buildContexts.get( projectId );
+ }
+
+ return null;
+ }
+
+ public List<BuildContext> getBuildContexts()
+ {
+ List<BuildContext> bContexts = new ArrayList<BuildContext>();
if ( buildContexts != null )
{
- for ( BuildContext item : buildContexts )
- {
- if (item.getProjectId() == projectId)
- {
- context = item;
- break;
- }
- }
+ bContexts.addAll( buildContexts.values() );
}
- return context;
+ return bContexts;
}
- public List<BuildContext> getBuildContextList()
+ public void addBuildContexts( List<BuildContext> buildContextList )
{
- return buildContexts;
+ if ( buildContexts == null )
+ {
+ buildContexts = new HashMap<Integer, BuildContext>();
+ }
+
+ for ( BuildContext buildContext : buildContextList )
+ {
+ buildContexts.put( buildContext.getProjectId(), buildContext );
+ }
}
- public void setBuildContextList( List<BuildContext> buildContexts )
+ public void removeBuildContext( int projectId )
{
- this.buildContexts = buildContexts;
+ BuildContext buildContext = getBuildContext( projectId );
+
+ if ( buildContext != null )
+ {
+ buildContexts.remove( buildContext );
+ }
}
}
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
index 7127d52..232489b 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
@@ -1,7 +1,5 @@
package org.apache.continuum.buildagent.configuration;
-import java.io.File;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +19,8 @@
* under the License.
*/
+import java.io.File;
+
public interface BuildAgentConfiguration
{
String ROLE = BuildAgentConfiguration.class.getName();
@@ -33,13 +33,13 @@
void save()
throws BuildAgentConfigurationException;
-
+
void save( File file )
throws BuildAgentConfigurationException;
-
- void reload( )
- throws BuildAgentConfigurationException;
-
+
+ void reload()
+ throws BuildAgentConfigurationException;
+
void reload( File file )
throws BuildAgentConfigurationException;
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
index e7267f1..326fb9d 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
@@ -23,6 +23,7 @@
import java.util.List;
import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
public interface BuildAgentConfigurationService
{
@@ -45,4 +46,6 @@
throws BuildAgentConfigurationException;
List<Installation> getAvailableInstallations();
+
+ List<LocalRepository> getLocalRepositories();
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
index 57a0be6..c821b1b 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
@@ -28,6 +28,7 @@
import org.apache.continuum.buildagent.model.ContinuumBuildAgentConfigurationModel;
import org.apache.continuum.buildagent.model.io.xpp3.ContinuumBuildAgentConfigurationModelXpp3Reader;
import org.apache.continuum.buildagent.model.io.xpp3.ContinuumBuildAgentConfigurationModelXpp3Writer;
+import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.slf4j.Logger;
@@ -82,12 +83,14 @@
public void reload( File file )
throws BuildAgentConfigurationException
{
+ FileInputStream fis = null;
try
{
+ fis = new FileInputStream( file );
ContinuumBuildAgentConfigurationModelXpp3Reader configurationXpp3Reader =
new ContinuumBuildAgentConfigurationModelXpp3Reader();
ContinuumBuildAgentConfigurationModel configuration =
- configurationXpp3Reader.read( new InputStreamReader( new FileInputStream( file ) ) );
+ configurationXpp3Reader.read( new InputStreamReader( fis ) );
this.generalBuildAgentConfiguration = new GeneralBuildAgentConfiguration();
if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
@@ -102,6 +105,7 @@
}
this.generalBuildAgentConfiguration.setContinuumServerUrl( configuration.getContinuumServerUrl() );
this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
+ this.generalBuildAgentConfiguration.setLocalRepositories( configuration.getLocalRepositories() );
}
catch ( IOException e )
{
@@ -113,6 +117,13 @@
log.error( e.getMessage(), e );
throw new BuildAgentConfigurationException( e.getMessage(), e );
}
+ finally
+ {
+ if ( fis != null )
+ {
+ IOUtil.close( fis );
+ }
+ }
}
public void save()
@@ -143,11 +154,14 @@
}
configurationModel.setContinuumServerUrl( this.generalBuildAgentConfiguration.getContinuumServerUrl() );
configurationModel.setInstallations( this.generalBuildAgentConfiguration.getInstallations() );
+ configurationModel.setLocalRepositories( this.generalBuildAgentConfiguration.getLocalRepositories() );
ContinuumBuildAgentConfigurationModelXpp3Writer writer =
new ContinuumBuildAgentConfigurationModelXpp3Writer();
FileWriter fileWriter = new FileWriter( file );
writer.write( fileWriter, configurationModel );
+ fileWriter.flush();
+ fileWriter.close();
}
catch ( IOException e )
{
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
index 7b14336..2fac7fa 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
@@ -1,5 +1,24 @@
package org.apache.continuum.buildagent.configuration;
+/*
+ * 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.
+ */
+
import java.io.File;
import java.io.IOException;
import java.util.List;
@@ -7,6 +26,7 @@
import javax.annotation.Resource;
import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
import org.codehaus.plexus.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -125,6 +145,11 @@
return generalBuildAgentConfiguration.getInstallations();
}
+ public List<LocalRepository> getLocalRepositories()
+ {
+ return generalBuildAgentConfiguration.getLocalRepositories();
+ }
+
private void loadData()
throws BuildAgentConfigurationException
{
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
index 7b2bf68..05fdd8b 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
@@ -23,6 +23,7 @@
import java.util.List;
import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
public class GeneralBuildAgentConfiguration
{
@@ -33,6 +34,8 @@
private String continuumServerUrl;
private List<Installation> installations;
+
+ private List<LocalRepository> localRepositories;
public File getWorkingDirectory()
{
@@ -73,4 +76,14 @@
{
this.installations = installations;
}
+
+ public List<LocalRepository> getLocalRepositories()
+ {
+ return localRepositories;
+ }
+
+ public void setLocalRepositories( List<LocalRepository> localRepositories )
+ {
+ this.localRepositories = localRepositories;
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
index a0b3c12..7f4f2a6 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java
@@ -30,7 +30,7 @@
String releasePrepare( Map<String, Object> project, Map<String, Object> properties,
Map<String, String> releaseVersion, Map<String, String> developmentVersion,
- Map<String, String> environments )
+ Map<String, String> environments, String username )
throws ContinuumReleaseException;
ReleaseResult getReleaseResult( String releaseId );
@@ -41,12 +41,12 @@
String getPreparedReleaseName( String releaseId );
- void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository )
+ void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository, String username )
throws ContinuumReleaseException;
String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map<String, String> environments )
+ String scmTagBase, Map<String, String> environments, String username )
throws ContinuumReleaseException;
String releaseCleanup( String releaseId );
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
index 40e6334..ee8a30f 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
@@ -21,6 +21,7 @@
import java.io.File;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -66,7 +67,7 @@
public String releasePrepare( Map<String, Object> projectMap, Map<String, Object> properties,
Map<String, String> releaseVersion, Map<String, String> developmentVersion,
- Map<String, String> environments )
+ Map<String, String> environments, String username )
throws ContinuumReleaseException
{
Project project = getProject( projectMap );
@@ -74,6 +75,8 @@
Properties releaseProperties = getReleaseProperties( properties );
ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+
+ listener.setUsername( username );
String workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ).getPath();
@@ -118,6 +121,9 @@
if ( listener != null )
{
map.put( ContinuumBuildAgentUtil.KEY_RELEASE_STATE, listener.getState() );
+
+ map.put( ContinuumBuildAgentUtil.KEY_USERNAME, listener.getUsername() );
+
if ( listener.getPhases() != null )
{
map.put( ContinuumBuildAgentUtil.KEY_RELEASE_PHASES, listener.getPhases() );
@@ -157,20 +163,32 @@
return "";
}
+ @SuppressWarnings( "unchecked" )
public void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
- Map repository )
+ Map repository, String username )
throws ContinuumReleaseException
{
ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+
+ listener.setUsername( username );
LocalRepository repo = null;
if ( !repository.isEmpty() )
{
- repo = new LocalRepository();
- repo.setLayout( ContinuumBuildAgentUtil.getLocalRepositoryLayout( repository ) );
- repo.setName( ContinuumBuildAgentUtil.getLocalRepositoryName( repository ) );
- repo.setLocation( ContinuumBuildAgentUtil.getLocalRepository( repository ) );
+ List<org.apache.continuum.buildagent.model.LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();
+ for( org.apache.continuum.buildagent.model.LocalRepository localRepo : localRepos )
+ {
+ if( localRepo.getName().equalsIgnoreCase( ContinuumBuildAgentUtil.getLocalRepositoryName( repository ) ) )
+ {
+ repo = new LocalRepository();
+ repo.setLayout( localRepo.getLayout() );
+ repo.setName( localRepo.getName() );
+ repo.setLocation( localRepo.getLocation() );
+
+ break;
+ }
+ }
}
File performDirectory =
@@ -182,7 +200,7 @@
public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map<String, String> environments )
+ String scmTagBase, Map<String, String> environments, String username )
throws ContinuumReleaseException
{
ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
@@ -203,7 +221,7 @@
releaseManager.getPreparedReleases().put( releaseId, descriptor );
- releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+ releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
return releaseId;
}
@@ -260,7 +278,8 @@
ProjectGroup group = new ProjectGroup();
- String localRepo = ContinuumBuildAgentUtil.getLocalRepository( context );
+ String localRepo = ContinuumBuildAgentUtil.getLocalRepositoryName( context );
+
if ( StringUtils.isBlank( localRepo ) )
{
group.setLocalRepository( null );
@@ -268,8 +287,16 @@
else
{
LocalRepository localRepository = new LocalRepository();
- localRepository.setLocation( localRepo );
- group.setLocalRepository( localRepository );
+ List<org.apache.continuum.buildagent.model.LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();
+ for( org.apache.continuum.buildagent.model.LocalRepository localRepoBA : localRepos )
+ {
+ if( localRepoBA.getName().equalsIgnoreCase( localRepo ) )
+ {
+ localRepository.setLocation( localRepoBA.getLocation() );
+ group.setLocalRepository( localRepository );
+ break;
+ }
+ }
}
project.setProjectGroup( group );
@@ -343,5 +370,8 @@
return props;
}
-
+ public void setBuildAgentConfigurationService( BuildAgentConfigurationService buildAgentConfigurationService )
+ {
+ this.buildAgentConfigurationService = buildAgentConfigurationService;
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java
index 57cb3f8..1ada810 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java
@@ -22,6 +22,7 @@
import java.util.List;
import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.codehaus.plexus.taskqueue.Task;
public class PrepareBuildProjectsTask
@@ -29,19 +30,22 @@
{
private final List<BuildContext> buildContexts;
- private final int trigger;
+ private BuildTrigger buildTrigger;
private final int projectGroupId;
private final String scmRootAddress;
- public PrepareBuildProjectsTask( List<BuildContext> buildContexts, int trigger, int projectGroupId,
- String scmRootAddress )
+ private final int scmRootId;
+
+ public PrepareBuildProjectsTask( List<BuildContext> buildContexts, BuildTrigger buildTrigger, int projectGroupId,
+ String scmRootAddress, int scmRootId )
{
this.buildContexts = buildContexts;
- this.trigger = trigger;
+ this.buildTrigger = buildTrigger;
this.projectGroupId = projectGroupId;
this.scmRootAddress = scmRootAddress;
+ this.scmRootId = scmRootId;
}
public long getMaxExecutionTime()
@@ -55,9 +59,9 @@
return buildContexts;
}
- public int getTrigger()
+ public BuildTrigger getBuildTrigger()
{
- return trigger;
+ return buildTrigger;
}
public int getProjectGroupId()
@@ -69,4 +73,14 @@
{
return scmRootAddress;
}
+
+ public int getScmRootId()
+ {
+ return scmRootId;
+ }
+
+ public int getHashCode()
+ {
+ return projectGroupId + scmRootId + buildTrigger.getTrigger();
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
index 3e9a092..34d4571 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
@@ -35,6 +35,7 @@
import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
import org.apache.continuum.buildagent.installation.BuildAgentInstallationService;
import org.apache.continuum.buildagent.manager.BuildAgentManager;
+import org.apache.continuum.buildagent.model.LocalRepository;
import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
import org.apache.continuum.buildagent.utils.BuildContextToProject;
import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
@@ -103,7 +104,7 @@
int projectId = buildProjectTask.getProjectId();
- log.info( "Initializing build" );
+ log.info( "Initializing build (projectId=" + projectId + ")" );
BuildContext context = buildContextManager.getBuildContext( projectId );
initializeBuildContext( context );
@@ -164,10 +165,25 @@
BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+ actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS,
getEnvironments( buildContext.getBuildDefinitionId(),
getInstallationType( buildContext ) ) );
- actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, buildContext.getLocalRepository() );
+
+ // CONTINUUM-2391
+ if( buildContext.getLocalRepository() != null )
+ {
+ List<LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();
+ for( LocalRepository local : localRepos )
+ {
+ if( local.getName().equalsIgnoreCase( buildContext.getLocalRepository() ) )
+ {
+ actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, local.getLocation() );
+ break;
+ }
+ }
+ }
+
actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_RESULT, buildContext.getScmResult() );
buildContext.setActionContext( actionContext );
@@ -205,6 +221,7 @@
result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+ result.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, buildResult.getState() );
result.put( ContinuumBuildAgentUtil.KEY_START_TIME, Long.toString( buildResult.getStartTime() ) );
result.put( ContinuumBuildAgentUtil.KEY_END_TIME, Long.toString( buildResult.getEndTime() ) );
@@ -239,6 +256,7 @@
try
{
buildAgentManager.returnBuildResult( result );
+ buildContextManager.removeBuildContext( buildContext.getProjectId() );
}
catch ( ContinuumException e )
{
@@ -299,6 +317,8 @@
build.setState( ContinuumProjectState.ERROR );
build.setTrigger( context.getTrigger() );
+
+ build.setUsername( context.getUsername() );
build.setStartTime( context.getBuildStartTime() );
@@ -400,6 +420,7 @@
map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, context.getTrigger() );
+ map.put( ContinuumBuildAgentUtil.KEY_USERNAME, context.getUsername() );
map.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( context.getScmResult() ) );
map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context ) );
if ( context.getLatestUpdateDate() != null )
@@ -531,4 +552,29 @@
return mavenProject;
}
+
+ public void setBuildContextManager( BuildContextManager buildContextManager )
+ {
+ this.buildContextManager = buildContextManager;
+ }
+
+ public void setActionManager( ActionManager actionManager )
+ {
+ this.actionManager = actionManager;
+ }
+
+ public void setBuildAgentConfigurationService( BuildAgentConfigurationService buildAgentConfigurationService )
+ {
+ this.buildAgentConfigurationService = buildAgentConfigurationService;
+ }
+
+ public void setBuildAgentManager( BuildAgentManager buildAgentManager )
+ {
+ this.buildAgentManager = buildAgentManager;
+ }
+
+ public void setBuildAgentBuildExecutorManager( BuildAgentBuildExecutorManager buildAgentBuildExecutorManager )
+ {
+ this.buildAgentBuildExecutorManager = buildAgentBuildExecutorManager;
+ }
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
index 1856164..05afb26 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
@@ -31,6 +31,7 @@
import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
import org.apache.continuum.buildagent.utils.BuildContextToProject;
import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
@@ -174,6 +175,8 @@
actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, buildContext.getScmRootAddress() );
actionContext.put( ContinuumBuildAgentUtil.KEY_OLD_SCM_RESULT, buildContext.getOldScmResult() );
actionContext.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, buildContext.getLatestUpdateDate() );
+ actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+ actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
buildContext.setActionContext( actionContext );
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
index a39e995..66e51d8 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
@@ -19,7 +19,12 @@
* under the License.
*/
+import java.util.List;
+
+import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.codehaus.plexus.taskqueue.TaskQueue;
public interface BuildAgentTaskQueueManager
@@ -33,15 +38,39 @@
void cancelBuild()
throws TaskQueueManagerException;
- int getCurrentProjectInBuilding()
+ int getIdOfProjectCurrentlyBuilding()
throws TaskQueueManagerException;
+ BuildProjectTask getCurrentProjectInBuilding()
+ throws TaskQueueManagerException;
+
+ PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+ throws TaskQueueManagerException;
+
boolean hasBuildTaskInQueue()
throws TaskQueueManagerException;
boolean isProjectInBuildQueue( int projectId )
throws TaskQueueManagerException;
- boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+ boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger trigger, String scmRootAddress )
+ throws TaskQueueManagerException;
+
+ List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+ throws TaskQueueManagerException;
+
+ List<BuildProjectTask> getProjectsInBuildQueue()
+ throws TaskQueueManagerException;
+
+ boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueManagerException;
+
+ void removeFromPrepareBuildQueue( int[] hashCodes )
+ throws TaskQueueManagerException;
+
+ boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws TaskQueueManagerException;
+
+ void removeFromBuildQueue( int[] hashCodes )
throws TaskQueueManagerException;
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
index 02acb84..66e7dfe 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
@@ -21,9 +21,11 @@
import java.util.List;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -60,8 +62,24 @@
public void cancelBuild()
throws TaskQueueManagerException
{
- removeProjectsFromBuildQueue();
- cancelCurrentBuild();
+ Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+ if ( task != null )
+ {
+ if ( task instanceof BuildProjectTask )
+ {
+ log.info( "Cancelling current build task of project " + ( (BuildProjectTask) task ).getProjectId() );
+ getBuildTaskQueueExecutor().cancelTask( task );
+ }
+ else
+ {
+ log.warn( "Current task not a BuildProjectTask - not cancelling" );
+ }
+ }
+ else
+ {
+ log.warn( "No task running - not cancelling" );
+ }
}
public TaskQueue getBuildQueue()
@@ -69,7 +87,7 @@
return buildAgentBuildQueue;
}
- public int getCurrentProjectInBuilding()
+ public int getIdOfProjectCurrentlyBuilding()
throws TaskQueueManagerException
{
Task task = getBuildTaskQueueExecutor().getCurrentTask();
@@ -99,8 +117,11 @@
{
for ( BuildProjectTask task : queues )
{
- log.info( "remove project '" + task.getProjectName() + "' from build queue" );
- buildAgentBuildQueue.remove( task );
+ if ( task != null )
+ {
+ log.info( "remove project '" + task.getProjectName() + "' from build queue" );
+ buildAgentBuildQueue.remove( task );
+ }
}
}
else
@@ -114,30 +135,6 @@
}
}
- private boolean cancelCurrentBuild()
- throws TaskQueueManagerException
- {
- Task task = getBuildTaskQueueExecutor().getCurrentTask();
-
- if ( task != null )
- {
- if ( task instanceof BuildProjectTask )
- {
- log.info( "Cancelling current build task" );
- return getBuildTaskQueueExecutor().cancelTask( task );
- }
- else
- {
- log.warn( "Current task not a BuildProjectTask - not cancelling" );
- }
- }
- else
- {
- log.warn( "No task running - not cancelling" );
- }
- return false;
- }
-
public TaskQueueExecutor getBuildTaskQueueExecutor()
throws TaskQueueManagerException
{
@@ -151,6 +148,19 @@
}
}
+ public TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
+ throws TaskQueueManagerException
+ {
+ try
+ {
+ return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "prepare-build-agent" );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new TaskQueueManagerException( e.getMessage(), e );
+ }
+ }
+
public boolean hasBuildTaskInQueue()
throws TaskQueueManagerException
{
@@ -179,7 +189,7 @@
{
for ( BuildProjectTask task : queues )
{
- if ( task.getProjectId() == projectId )
+ if ( task != null && task.getProjectId() == projectId )
{
log.info( "project already in build queue" );
return true;
@@ -199,7 +209,7 @@
return false;
}
- public boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+ public boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger buildTrigger, String scmRootAddress )
throws TaskQueueManagerException
{
try
@@ -210,8 +220,9 @@
{
for ( PrepareBuildProjectsTask task : queues )
{
- if ( task.getProjectGroupId() == projectGroupId && task.getTrigger() == trigger &&
- task.getScmRootAddress().equals( scmRootAddress ) )
+ if ( task != null && task.getProjectGroupId() == projectGroupId &&
+ task.getBuildTrigger().getTrigger() == buildTrigger.getTrigger() &&
+ task.getScmRootAddress().equals( scmRootAddress ) )
{
log.info( "projects already in build queue" );
return true;
@@ -231,9 +242,135 @@
return false;
}
+ public List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+ throws TaskQueueManagerException
+ {
+ try
+ {
+ return buildAgentPrepareBuildQueue.getQueueSnapshot();
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error occurred while retrieving projects in prepare build queue", e );
+ throw new TaskQueueManagerException( "Error occurred while retrieving projects in prepare build queue", e );
+ }
+ }
+
+ public List<BuildProjectTask> getProjectsInBuildQueue()
+ throws TaskQueueManagerException
+ {
+ try
+ {
+ return buildAgentBuildQueue.getQueueSnapshot();
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error occurred while retrieving projects in build queue", e );
+ throw new TaskQueueManagerException( "Error occurred while retrieving projects in build queue", e );
+ }
+ }
+
+ public PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+ throws TaskQueueManagerException
+ {
+ Task task = getPrepareBuildTaskQueueExecutor().getCurrentTask();
+
+ if ( task != null )
+ {
+ return (PrepareBuildProjectsTask) task;
+ }
+ return null;
+ }
+
+ public BuildProjectTask getCurrentProjectInBuilding()
+ throws TaskQueueManagerException
+ {
+ Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+ if ( task != null )
+ {
+ return (BuildProjectTask) task;
+ }
+
+ return null;
+ }
+
+ public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueManagerException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null && task.getProjectGroupId() == projectGroupId && task.getScmRootId() == scmRootId )
+ {
+ return getPrepareBuildQueue().remove( task );
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void removeFromPrepareBuildQueue( int[] hashCodes )
+ throws TaskQueueManagerException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+ {
+ getPrepareBuildQueue().remove( task );
+ }
+ }
+ }
+ }
+
+ public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws TaskQueueManagerException
+ {
+ List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( BuildProjectTask task : tasks )
+ {
+ if ( task != null && task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
+ {
+ return getBuildQueue().remove( task );
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void removeFromBuildQueue( int[] hashCodes )
+ throws TaskQueueManagerException
+ {
+ List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( BuildProjectTask task : tasks )
+ {
+ if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+ {
+ getBuildQueue().remove( task );
+ }
+ }
+ }
+ }
+
public void contextualize( Context context )
throws ContextException
{
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
+
}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
index caf992c..c68d4ae 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
@@ -43,6 +43,8 @@
project.setScmPassword( buildContext.getScmPassword() );
+ project.setScmTag( buildContext.getScmTag() );
+
project.setExecutorId( buildContext.getExecutorId() );
project.setState( buildContext.getProjectState() );
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
index b43f065..dd71939 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
@@ -30,6 +30,7 @@
import java.util.Map;
import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
@@ -51,7 +52,11 @@
public static final String KEY_BUILD_DEFINITION_ID = "builddefinition-id";
+ public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
+
public static final String KEY_TRIGGER = "trigger";
+
+ public static final String KEY_USERNAME = "username";
public static final String KEY_EXECUTOR_ID = "executor-id";
@@ -95,6 +100,8 @@
public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
+ public static final String KEY_SCM_ROOT_ID = "scm-root-id";
+
public static final String KEY_SCM_ROOT_STATE = "scm-root-state";
public static final String KEY_CHECKOUT_SCM_RESULT = "checkout-scm-result";
@@ -351,6 +358,16 @@
{
return getInteger( context, KEY_TRIGGER );
}
+
+ public static String getUsername( Map<String, Object> context )
+ {
+ return getString( context, KEY_USERNAME, "" );
+ }
+
+ public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+ {
+ return new BuildTrigger( getTrigger( context ), getUsername( context ) );
+ }
public static BuildResult getBuildResult( Map<String, Object> context, Object defaultValue )
{
@@ -526,6 +543,16 @@
return getString( context, KEY_LOCAL_REPOSITORY_LAYOUT, "" );
}
+ public static int getScmRootId( Map<String, Object> context )
+ {
+ return getInteger( context, KEY_SCM_ROOT_ID );
+ }
+
+ public static String getBuildDefinitionLabel( Map<String, Object> context )
+ {
+ return getString( context, KEY_BUILD_DEFINITION_LABEL, "" );
+ }
+
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java
index e9b323b..2423803 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java
@@ -1,5 +1,24 @@
package org.apache.continuum.buildagent.utils;
+/*
+ * 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.
+ */
+
import java.io.File;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/plexus/components.xml b/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/plexus/components-fragment.xml
similarity index 100%
rename from continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/plexus/components.xml
rename to continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/plexus/components-fragment.xml
diff --git a/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml b/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml
index a57b4fd..d745787 100644
--- a/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml
+++ b/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml
@@ -36,7 +36,7 @@
<bean id="buildAgentConfiguration" class="org.apache.continuum.buildagent.configuration.DefaultBuildAgentConfiguration"
init-method="initialize">
- <property name="configurationFile" value="file:${CONTINUUM_BUILDAGENT_HOME}/conf/continuum-buildagent.xml" />
+ <property name="configurationFile" value="file:${appserver.base}/conf/continuum-buildagent.xml" />
</bean>
</beans>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationTest.java b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationTest.java
new file mode 100644
index 0000000..eb73b88
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationTest.java
@@ -0,0 +1,187 @@
+package org.apache.continuum.buildagent.configuration;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
+public class BuildAgentConfigurationTest
+ extends PlexusInSpringTestCase
+{
+ public void testInitialize()
+ throws Exception
+ {
+ DefaultBuildAgentConfiguration config = (DefaultBuildAgentConfiguration) lookup( BuildAgentConfiguration.class );
+
+ config.setConfigurationFile( new File( getBasedir(), "target/test-classes/buildagent-config/continuum-buildagent.xml" ) );
+
+ config.initialize();
+
+ GeneralBuildAgentConfiguration generalConfig = config.getContinuumBuildAgentConfiguration();
+ assertEquals( "http://localhost:9595/continuum/master-xmlrpc", generalConfig.getContinuumServerUrl() );
+ assertEquals( new File( "/tmp/data/build-output-directory" ), generalConfig.getBuildOutputDirectory() );
+ assertEquals( new File( "/tmp/data/working-directory" ), generalConfig.getWorkingDirectory() );
+ assertEquals( 1, generalConfig.getInstallations().size() );
+
+ Installation installation = generalConfig.getInstallations().get( 0 );
+ assertEquals( "Tool", installation.getType() );
+ assertEquals( "Maven 2.2.1 Installation", installation.getName() );
+ assertEquals( "M2_HOME", installation.getVarName() );
+ assertEquals( "/tmp/apache-maven-2.2.1", installation.getVarValue() );
+
+ LocalRepository localRepo = generalConfig.getLocalRepositories().get( 0 );
+ assertLocalRepository( getExpectedLocalRepo(), localRepo );
+ }
+
+ public void testSaveExistingConfiguration()
+ throws Exception
+ {
+ DefaultBuildAgentConfiguration config = (DefaultBuildAgentConfiguration) lookup( BuildAgentConfiguration.class );
+
+ config.setConfigurationFile( new File( getBasedir(), "target/test-classes/buildagent-config/continuum-buildagent-edit.xml" ) );
+
+ config.initialize();
+
+ String expected = "http://192.165.240.12:8080/continuum/master-xmlrpc";
+
+ GeneralBuildAgentConfiguration generalConfig = config.getContinuumBuildAgentConfiguration();
+
+ assertEquals( "http://localhost:9595/continuum/master-xmlrpc", generalConfig.getContinuumServerUrl() );
+ assertEquals( 1, generalConfig.getInstallations().size() );
+
+ generalConfig.setContinuumServerUrl( expected );
+
+ Installation expectedInstallation = getExpectedInstallation();
+ generalConfig.getInstallations().add( expectedInstallation );
+
+ LocalRepository expectedLocalRepo = getExpectedLocalRepo();
+
+ List<LocalRepository> localRepos = new ArrayList<LocalRepository>();
+ localRepos.add( expectedLocalRepo );
+
+ generalConfig.setLocalRepositories( localRepos );
+
+ config.save();
+
+ config.reload();
+
+ assertEquals( expected, config.getContinuumBuildAgentConfiguration().getContinuumServerUrl() );
+ assertEquals( 2, config.getContinuumBuildAgentConfiguration().getInstallations().size() );
+
+ Installation installation = generalConfig.getInstallations().get( 1 );
+ assertInstallation( expectedInstallation, installation );
+
+ LocalRepository localRepo = generalConfig.getLocalRepositories().get( 0 );
+ assertLocalRepository( expectedLocalRepo, localRepo );
+ }
+
+ public void testSaveNewConfiguration()
+ throws Exception
+ {
+ File configFile = new File( getBasedir(), "target/test-classes/buildagent-config/continuum-buildagent-new.xml" );
+ DefaultBuildAgentConfiguration config = (DefaultBuildAgentConfiguration) lookup( BuildAgentConfiguration.class );
+
+ config.setConfigurationFile( configFile );
+
+ config.initialize();
+
+ String expectedUrl = "http://localhost:8080/continuum/master-xmlrpc";
+ File expectedBuildOutputDir = new File( "/tmp/data/build-output-directory" );
+ File expectedWorkingDir = new File( "/tmp/data/working-directory" );
+
+ GeneralBuildAgentConfiguration generalConfig = config.getContinuumBuildAgentConfiguration();
+
+ assertNull( generalConfig.getContinuumServerUrl() );
+ assertNull( generalConfig.getBuildOutputDirectory() );
+ assertNull( generalConfig.getWorkingDirectory() );
+ assertNull( generalConfig.getInstallations() );
+
+ Installation expectedInstallation = getExpectedInstallation();
+
+ List<Installation> installations = new ArrayList<Installation>();
+ installations.add( expectedInstallation );
+
+ LocalRepository expectedLocalRepo = getExpectedLocalRepo();
+
+ List<LocalRepository> localRepos = new ArrayList<LocalRepository>();
+ localRepos.add( expectedLocalRepo );
+
+ generalConfig.setContinuumServerUrl( expectedUrl );
+ generalConfig.setBuildOutputDirectory( expectedBuildOutputDir );
+ generalConfig.setWorkingDirectory( expectedWorkingDir );
+ generalConfig.setInstallations( installations );
+ generalConfig.setLocalRepositories( localRepos );
+
+ config.save();
+
+ config.reload();
+
+ assertTrue( configFile.exists() );
+ assertEquals( expectedUrl, config.getContinuumBuildAgentConfiguration().getContinuumServerUrl() );
+ assertEquals( expectedBuildOutputDir, config.getContinuumBuildAgentConfiguration().getBuildOutputDirectory() );
+ assertEquals( expectedWorkingDir, config.getContinuumBuildAgentConfiguration().getWorkingDirectory() );
+ assertEquals( 1, config.getContinuumBuildAgentConfiguration().getInstallations().size() );
+
+ Installation installation = generalConfig.getInstallations().get( 0 );
+ assertInstallation( expectedInstallation, installation );
+
+ LocalRepository localRepo = generalConfig.getLocalRepositories().get( 0 );
+ assertLocalRepository( expectedLocalRepo, localRepo );
+ }
+
+ private Installation getExpectedInstallation()
+ {
+ Installation expectedInstallation = new Installation();
+ expectedInstallation.setName( "Maven 2.0.10 Installation" );
+ expectedInstallation.setType( "Tool" );
+ expectedInstallation.setVarName( "M2_HOME" );
+ expectedInstallation.setVarValue( "/tmp/apache-maven-2.1.10" );
+ return expectedInstallation;
+ }
+
+ private LocalRepository getExpectedLocalRepo()
+ {
+ LocalRepository expectedLocalRepo = new LocalRepository();
+ expectedLocalRepo.setName( "default" );
+ expectedLocalRepo.setLayout( "default" );
+ expectedLocalRepo.setLocation( "/tmp/.m2/repository" );
+ return expectedLocalRepo;
+ }
+
+ private void assertLocalRepository( LocalRepository expectedLocalRepo, LocalRepository localRepo )
+ {
+ assertEquals( expectedLocalRepo.getName(), localRepo.getName() );
+ assertEquals( expectedLocalRepo.getLayout(), localRepo.getLayout() );
+ assertEquals( expectedLocalRepo.getLocation(), localRepo.getLocation() );
+ }
+
+ private void assertInstallation( Installation expectedInstallation, Installation installation )
+ {
+ assertEquals( expectedInstallation.getType(), installation.getType() );
+ assertEquals( expectedInstallation.getName(), installation.getName() );
+ assertEquals( expectedInstallation.getVarName(), installation.getVarName() );
+ assertEquals( expectedInstallation.getVarValue(), installation.getVarValue() );
+ }
+}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
new file mode 100644
index 0000000..13ab168
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
@@ -0,0 +1,316 @@
+package org.apache.continuum.buildagent.manager;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
+import org.apache.continuum.buildagent.model.LocalRepository;
+import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.apache.maven.continuum.release.ContinuumReleaseException;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit3.JUnit3Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+
+/**
+ * For the CONTINUUM-2391 tests, checking of the local repository details is in ContinuumReleaseManagerStub. An
+ * exception is thrown if the set local repository in the repository map is incorrect.
+ */
+public class BuildAgentReleaseManagerTest
+ extends PlexusInSpringTestCase
+{
+ private Mockery context;
+
+ private BuildAgentConfigurationService buildAgentConfigurationService;
+
+ private DefaultBuildAgentReleaseManager releaseManager;
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ context = new JUnit3Mockery();
+ context.setImposteriser( ClassImposteriser.INSTANCE );
+
+ releaseManager = (DefaultBuildAgentReleaseManager) lookup( BuildAgentReleaseManager.class );
+
+ buildAgentConfigurationService = context.mock( BuildAgentConfigurationService.class );
+
+ releaseManager.setBuildAgentConfigurationService( buildAgentConfigurationService );
+ }
+
+ protected void tearDown()
+ throws Exception
+ {
+ releaseManager = null;
+
+ super.tearDown();
+ }
+
+ // CONTINUUM-2391
+ public void testLocalRepositoryInReleasePrepare()
+ throws Exception
+ {
+ final List<LocalRepository> localRepos = createLocalRepositories();
+ final File workingDir = new File( getBasedir(), "target/test-classes/working-dir" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory( 1 );
+ will( returnValue( workingDir ) );
+ }
+ } );
+
+ try
+ {
+ releaseManager.releasePrepare( createProjectMap(), createPropertiesMap(), createReleaseVersionMap(),
+ createDevVersionMap(), createEnvironmentsMap(), "user" );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ // CONTINUUM-2391
+ public void testLocalRepositoryNameMismatchedCaseInReleasePrepare()
+ throws Exception
+ {
+ final List<LocalRepository> localRepos = createLocalRepositories();
+ final File workingDir = new File( getBasedir(), "target/test-classes/working-dir" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory( 1 );
+ will( returnValue( workingDir ) );
+ }
+ } );
+
+ Map<String, Object> map = createProjectMap();
+
+ try
+ {
+ releaseManager.releasePrepare( map, createPropertiesMap(), createReleaseVersionMap(),
+ createDevVersionMap(), createEnvironmentsMap(), "user" );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ // CONTINUUM-2391
+ @SuppressWarnings( "unchecked" )
+ public void testLocalRepositoryInReleasePerform()
+ throws Exception
+ {
+ final List<LocalRepository> localRepos = createLocalRepositories();
+ final File workingDir = new File( getBasedir(), "target/test-classes/working-dir" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory();
+ will( returnValue( workingDir ) );
+ }
+ } );
+
+ Map repository = createRepositoryMap();
+ repository.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY_NAME, "DEFAULT" );
+
+ try
+ {
+ releaseManager.releasePerform( "1", "clean deploy", "", true, repository, "user" );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ // CONTINUUM-2391
+ public void testLocalRepositoryNameMismatchedCaseInReleasePerform()
+ throws Exception
+ {
+ final List<LocalRepository> localRepos = createLocalRepositories();
+ final File workingDir = new File( getBasedir(), "target/test-classes/working-dir" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory();
+ will( returnValue( workingDir ) );
+ }
+ } );
+
+ try
+ {
+ releaseManager.releasePerform( "1", "clean deploy", "", true, createRepositoryMap(), "user" );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ // CONTINUUM-2391
+ @SuppressWarnings( "unchecked" )
+ public void testLocalRepositoryInReleasePerformFromScm()
+ throws Exception
+ {
+ final List<LocalRepository> localRepos = createLocalRepositories();
+ final File workingDir = new File( getBasedir(), "target/test-classes/working-dir" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory();
+ will( returnValue( workingDir ) );
+ }
+ } );
+
+ Map repository = new HashMap();
+ repository.put( ContinuumBuildAgentUtil.KEY_USERNAME, "user" );
+ repository.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY_NAME, "default" );
+
+ try
+ {
+ releaseManager.releasePerformFromScm(
+ "clean deploy",
+ "",
+ true,
+ repository,
+ "scm:svn:http://svn.example.com/repos/test-project",
+ "user",
+ "mypasswrd",
+ "scm:svn:http://svn.example.com/repos/test-project/tags/test-project-1.0",
+ "scm:svn:http://svn.example.com/repos/test-project/tags", null,
+ "user" );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ private List<LocalRepository> createLocalRepositories()
+ {
+ List<LocalRepository> localRepos = new ArrayList<LocalRepository>();
+ LocalRepository localRepo = new LocalRepository();
+ localRepo.setName( "temp" );
+ localRepo.setLocation( "/tmp/.m2/repository" );
+ localRepo.setLayout( "default" );
+
+ localRepos.add( localRepo );
+
+ localRepo = new LocalRepository();
+ localRepo.setName( "default" );
+ localRepo.setLocation( "/home/user/.m2/repository" );
+ localRepo.setLayout( "default" );
+
+ localRepos.add( localRepo );
+
+ return localRepos;
+ }
+
+ private Map<String, String> createEnvironmentsMap()
+ {
+ Map<String, String> environments = new HashMap<String, String>();
+ environments.put( "M2_HOME", "/tmp/bin/apache-maven-2.2.1" );
+
+ return environments;
+ }
+
+ private Map<String, String> createDevVersionMap()
+ {
+ Map<String, String> devVersion = new HashMap<String, String>();
+ devVersion.put( "1.1-SNAPSHOT", "1.1-SNAPSHOT" );
+
+ return devVersion;
+ }
+
+ private Map<String, String> createReleaseVersionMap()
+ {
+ Map<String, String> releaseVersion = new HashMap<String, String>();
+ releaseVersion.put( "1.0", "1.0" );
+
+ return releaseVersion;
+ }
+
+ private Map<String, Object> createPropertiesMap()
+ {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put( ContinuumBuildAgentUtil.KEY_SCM_USERNAME, "scmusername" );
+ properties.put( ContinuumBuildAgentUtil.KEY_SCM_PASSWORD, "scmpassword" );
+ properties.put( ContinuumBuildAgentUtil.KEY_SCM_TAGBASE,
+ "scm:svn:http://svn.example.com/repos/test-project/tags" );
+ properties.put( ContinuumBuildAgentUtil.KEY_PREPARE_GOALS, "clean install" );
+ properties.put( ContinuumBuildAgentUtil.KEY_ARGUMENTS, "" );
+ properties.put( ContinuumBuildAgentUtil.KEY_SCM_TAG, "test-project-1.0" );
+
+ return properties;
+ }
+
+ private Map<String, Object> createProjectMap()
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY_NAME, "default" );
+ map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, 1 );
+ map.put( ContinuumBuildAgentUtil.KEY_GROUP_ID, "1" );
+ map.put( ContinuumBuildAgentUtil.KEY_ARTIFACT_ID, "test-project" );
+ map.put( ContinuumBuildAgentUtil.KEY_SCM_URL, "scm:svn:http://svn.example.com/repos/test-project/trunk" );
+
+ return map;
+ }
+
+ @SuppressWarnings( "unchecked" )
+ private Map createRepositoryMap()
+ {
+ Map repository = new HashMap();
+ repository.put( ContinuumBuildAgentUtil.KEY_USERNAME, "user" );
+ repository.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY_NAME, "default" );
+
+ return repository;
+ }
+}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumActionStub.java b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumActionStub.java
new file mode 100644
index 0000000..dc038b7
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumActionStub.java
@@ -0,0 +1,42 @@
+package org.apache.continuum.buildagent.stubs;
+
+/*
+ * 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.
+ */
+
+import java.util.Map;
+
+import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.codehaus.plexus.action.AbstractAction;
+
+/**
+ * This is used for testing the fix for CONTINUUM-2391. See BuildPRrojectTaskExecutorTest.java and
+ * BuildProjectTaskExecutorTest.xml for details.
+ */
+public class ContinuumActionStub
+ extends AbstractAction
+{
+ public void execute( Map context )
+ throws Exception
+ {
+ if ( !ContinuumBuildAgentUtil.getLocalRepository( context ).equals( "/home/user/.m2/repository" ) )
+ {
+ throw new Exception( "Local repository set in the build context should not have been a full path!" );
+ }
+ }
+}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumReleaseManagerStub.java b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumReleaseManagerStub.java
new file mode 100644
index 0000000..405a5c4
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/stubs/ContinuumReleaseManagerStub.java
@@ -0,0 +1,51 @@
+package org.apache.continuum.buildagent.stubs;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+
+import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.maven.continuum.release.ContinuumReleaseException;
+import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
+import org.apache.maven.continuum.release.DefaultContinuumReleaseManager;
+
+public class ContinuumReleaseManagerStub
+ extends DefaultContinuumReleaseManager
+{
+ public void perform( String releaseId, File buildDirectory, String goals, String arguments,
+ boolean useReleaseProfile, ContinuumReleaseManagerListener listener, LocalRepository repository )
+ throws ContinuumReleaseException
+ {
+ if( !repository.getName().equalsIgnoreCase( "default" ) )
+ {
+ throw new ContinuumReleaseException( "Incorrect local repository name!" );
+ }
+
+ if( !repository.getLocation().equals( "/home/user/.m2/repository" ) )
+ {
+ throw new ContinuumReleaseException( "Incorrect local repository location!" );
+ }
+
+ if( !repository.getLayout().equals( "default" ) )
+ {
+ throw new ContinuumReleaseException( "Incorrect local repository layout!" );
+ }
+ }
+}
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.java b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.java
new file mode 100644
index 0000000..db093e1
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.java
@@ -0,0 +1,213 @@
+package org.apache.continuum.buildagent.taskqueue.execution;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildExecutor;
+import org.apache.continuum.buildagent.build.execution.manager.BuildAgentBuildExecutorManager;
+import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
+import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
+import org.apache.continuum.buildagent.manager.BuildAgentManager;
+import org.apache.continuum.buildagent.model.LocalRepository;
+import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.utils.build.BuildTrigger;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.scm.ScmResult;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit3.JUnit3Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+
+public class BuildProjectTaskExecutorTest
+ extends PlexusInSpringTestCase
+{
+ private Mockery context;
+
+ private BuildContextManager buildContextManager;
+
+ private BuildAgentBuildExecutorManager buildAgentBuildExecutorManager;
+
+ private BuildAgentConfigurationService buildAgentConfigurationService;
+
+ private BuildAgentManager buildAgentManager;
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ context = new JUnit3Mockery();
+ context.setImposteriser( ClassImposteriser.INSTANCE );
+
+ buildContextManager = context.mock( BuildContextManager.class );
+
+ buildAgentBuildExecutorManager = context.mock( BuildAgentBuildExecutorManager.class );
+
+ buildAgentConfigurationService = context.mock( BuildAgentConfigurationService.class );
+
+ buildAgentManager = context.mock( BuildAgentManager.class );
+ }
+
+ // CONTINUUM-2391
+ // Note: The checking of the local repo set in the context is in ContinuumActionStub. If the
+ // local repo path is incorrect, an exception will be thrown by the action stub.
+ public void testBuildProjectLocalRepository()
+ throws Exception
+ {
+ BuildProjectTaskExecutor buildProjectExecutor =
+ (BuildProjectTaskExecutor) lookup( TaskExecutor.class, "build-agent" );
+
+ buildProjectExecutor.setBuildAgentBuildExecutorManager( buildAgentBuildExecutorManager );
+
+ buildProjectExecutor.setBuildAgentConfigurationService( buildAgentConfigurationService );
+
+ buildProjectExecutor.setBuildContextManager( buildContextManager );
+
+ buildProjectExecutor.setBuildAgentManager( buildAgentManager );
+
+ final BuildContext buildContext = createBuildContext();
+
+ final List<LocalRepository> localRepos = new ArrayList<LocalRepository>();
+
+ LocalRepository localRepo = new LocalRepository();
+ localRepo.setName( "temp" );
+ localRepo.setLocation( "/tmp/.m2/repository" );
+ localRepo.setLayout( "default" );
+
+ localRepos.add( localRepo );
+
+ localRepo = new LocalRepository();
+ localRepo.setName( "default" );
+ localRepo.setLocation( "/home/user/.m2/repository" );
+ localRepo.setLayout( "default" );
+
+ localRepos.add( localRepo );
+
+ final Map<String, String> buildEnvironments = new HashMap<String, String>();
+ buildEnvironments.put( "M2_HOME", "/tmp/apache-maven-2.2.1" );
+
+ final ContinuumAgentBuildExecutor executor = context.mock( ContinuumAgentBuildExecutor.class );
+ final File workingDir = new File( "/tmp/data/working-directory/project-test" );
+ final MavenProject project = new MavenProject();
+ final File outputFile = new File( "/tmp/data/build-output-directory/output.txt" );
+
+ context.checking( new Expectations()
+ {
+ {
+ one( buildContextManager ).getBuildContext( 1 );
+ will( returnValue( buildContext ) );
+
+ one( buildAgentManager ).getEnvironments( 1, "maven2" );
+ will( returnValue( buildEnvironments ) );
+
+ one( buildAgentConfigurationService ).getLocalRepositories();
+ will( returnValue( localRepos ) );
+
+ one( buildAgentManager ).shouldBuild( with( any( Map.class ) ) );
+ will( returnValue( true ) );
+
+ one( buildAgentBuildExecutorManager ).getBuildExecutor(
+ ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
+ will( returnValue( executor ) );
+
+ one( buildAgentConfigurationService ).getWorkingDirectory( 1 );
+ will( returnValue( workingDir ) );
+
+ one( executor ).getMavenProject( with( any( File.class ) ), with( any( BuildDefinition.class ) ) );
+ will( returnValue( project ) );
+
+ one( buildAgentManager ).startProjectBuild( 1 );
+
+ one( buildAgentConfigurationService ).getBuildOutputFile( 1 );
+ will( returnValue( outputFile ) );
+
+ one( buildAgentManager ).returnBuildResult( with( any( Map.class ) ) );
+
+ one( buildContextManager ).removeBuildContext( 1 );
+ }
+ } );
+
+ try
+ {
+ buildProjectExecutor.executeTask( createBuildProjectTask() );
+ }
+ catch ( Exception e )
+ {
+ fail( "An exception should not have been thrown!" );
+ }
+ }
+
+ private BuildProjectTask createBuildProjectTask()
+ {
+ BuildProjectTask task =
+ new BuildProjectTask( 1, 1, new BuildTrigger( 1 ), "Test Project", "Default Build Definition",
+ new ScmResult(), 1 );
+ return task;
+ }
+
+ private BuildContext createBuildContext()
+ {
+ BuildContext context = new BuildContext();
+ context.setProjectId( 1 );
+ context.setProjectVersion( "1.0-SNAPSHOT" );
+ context.setBuildDefinitionId( 1 );
+ context.setBuildFile( "pom.xml" );
+ context.setExecutorId( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
+ context.setGoals( "clean intall" );
+ context.setArguments( "--batch --non-recursive" );
+ context.setScmUrl( "scm:svn:http://svn.example.com/repos/dummy/trunk" );
+ context.setScmUsername( "" );
+ context.setScmPassword( "" );
+ context.setBuildFresh( false );
+ context.setProjectGroupId( 1 );
+ context.setProjectGroupName( "Test Project Group" );
+ context.setScmRootAddress( "scm:svn:http://svn.example.com/repos/dummy" );
+ context.setScmRootId( 1 );
+ context.setProjectName( "Test Project" );
+ context.setProjectState( 1 );
+ context.setTrigger( 1 );
+ context.setUsername( "" );
+ context.setLocalRepository( "default" );
+ context.setBuildNumber( 1 );
+
+ ScmResult scmResult = new ScmResult();
+ scmResult.setSuccess( true );
+
+ context.setScmResult( scmResult );
+ context.setLatestUpdateDate( Calendar.getInstance().getTime() );
+ context.setBuildAgentUrl( "http://localhost:8181/continuum-buildagent/xmlrpc" );
+ context.setMaxExecutionTime( 7200 );
+ context.setBuildDefinitionLabel( "Default Build Definition" );
+ context.setScmTag( "scm:svn:http://svn.example.com/repos/dummy/tags" );
+
+ return context;
+ }
+}
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent-edit.xml b/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent-edit.xml
new file mode 100644
index 0000000..6f17b20
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent-edit.xml
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+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.
+-->
+
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:9595/continuum/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>/tmp/data/build-output-directory</buildOutputDirectory>
+ <workingDirectory>/tmp/data/working-directory</workingDirectory>
+ <installations>
+ <installation>
+ <name>Maven 2.2.1 Installation</name>
+ <type>Tool</type>
+ <varName>M2_HOME</varName>
+ <varValue>/tmp/apache-maven-2.2.1</varValue>
+ </installation>
+ </installations>
+</continuum-buildagent-configuration>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent.xml b/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent.xml
new file mode 100644
index 0000000..a425487
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/resources/buildagent-config/continuum-buildagent.xml
@@ -0,0 +1,40 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+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.
+-->
+
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:9595/continuum/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>/tmp/data/build-output-directory</buildOutputDirectory>
+ <workingDirectory>/tmp/data/working-directory</workingDirectory>
+ <installations>
+ <installation>
+ <name>Maven 2.2.1 Installation</name>
+ <type>Tool</type>
+ <varName>M2_HOME</varName>
+ <varValue>/tmp/apache-maven-2.2.1</varValue>
+ </installation>
+ </installations>
+ <localRepositories>
+ <localRepository>
+ <name>default</name>
+ <location>/tmp/.m2/repository</location>
+ <layout>default</layout>
+ </localRepository>
+ </localRepositories>
+</continuum-buildagent-configuration>
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.xml b/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.xml
new file mode 100644
index 0000000..0d41623
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.xml
@@ -0,0 +1,52 @@
+<!--
+ ~ 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.
+ -->
+
+<plexus>
+ <components>
+ <component>
+ <role>org.apache.maven.continuum.release.ContinuumReleaseManager</role>
+ <role-hint>default</role-hint>
+ <implementation>org.apache.continuum.buildagent.stubs.ContinuumReleaseManagerStub</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.shared.release.config.ReleaseDescriptorStore</role>
+ <role-hint>continuum-release-properties</role-hint>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+ <role-hint>prepare-release</role-hint>
+ <field-name>prepareReleaseQueue</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+ <role-hint>perform-release</role-hint>
+ <field-name>performReleaseQueue</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+ <role-hint>rollback-release</role-hint>
+ <field-name>rollbackReleaseQueue</field-name>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.scm.manager.ScmManager</role>
+ </requirement>
+ </requirements>
+ </component>
+ </components>
+</plexus>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.xml b/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.xml
new file mode 100644
index 0000000..5151461
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-core/src/test/resources/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutorTest.xml
@@ -0,0 +1,33 @@
+<!--
+ ~ 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.
+ -->
+
+<plexus>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.action.Action</role>
+ <role-hint>update-project-from-agent-working-directory</role-hint>
+ <implementation>org.apache.continuum.buildagent.stubs.ContinuumActionStub</implementation>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.action.Action</role>
+ <role-hint>execute-agent-builder</role-hint>
+ <implementation>org.apache.continuum.buildagent.stubs.ContinuumActionStub</implementation>
+ </component>
+ </components>
+</plexus>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-jetty/pom.xml b/continuum-buildagent/continuum-buildagent-jetty/pom.xml
index 4b1f4a4..760c045 100644
--- a/continuum-buildagent/continuum-buildagent-jetty/pom.xml
+++ b/continuum-buildagent/continuum-buildagent-jetty/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-buildagent</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-buildagent-jetty</artifactId>
<packaging>pom</packaging>
@@ -49,12 +49,7 @@
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-api-2.0</artifactId>
+ <artifactId>jsp-2.1-jetty</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -62,43 +57,6 @@
<artifactId>jetty-plus</artifactId>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>commons-el</groupId>
- <artifactId>commons-el</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler-jdt</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -112,7 +70,6 @@
<mainClass>org.mortbay.start.Main</mainClass>
<commandLineArguments>
<commandLineArgument>conf/jetty.xml</commandLineArgument>
- <commandLineArgument>conf/jetty-logging.xml</commandLineArgument>
</commandLineArguments>
<platforms>
<platform>jsw</platform>
@@ -142,10 +99,6 @@
<value>%CONTINUUM_BUILDAGENT_BASE%/conf/jetty.xml</value>
</property>
<property>
- <name>wrapper.app.parameter.3</name>
- <value>%CONTINUUM_BUILDAGENT_BASE%/conf/jetty-logging.xml</value>
- </property>
- <property>
<name>app.base.envvar</name>
<value>CONTINUUM_BUILDAGENT_BASE</value>
</property>
@@ -176,7 +129,7 @@
<jvmSettings>
<systemProperties>
<systemProperty>appserver.home=.</systemProperty>
- <systemProperty>CONTINUUM_BUILDAGENT_HOME=%CONTINUUM_BUILDAGENT_BASE%</systemProperty>
+ <systemProperty>appserver.base=%CONTINUUM_BUILDAGENT_BASE%</systemProperty>
<systemProperty>jetty.logs=%CONTINUUM_BUILDAGENT_BASE%/logs</systemProperty>
<systemProperty>java.io.tmpdir=%CONTINUUM_BUILDAGENT_BASE%/tmp</systemProperty>
</systemProperties>
@@ -234,7 +187,4 @@
</plugin>
</plugins>
</build>
- <properties>
- <jetty.version>6.1.11</jetty.version>
- </properties>
</project>
diff --git a/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml b/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml
index 743433a..aa05c25 100644
--- a/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml
+++ b/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml
@@ -18,4 +18,8 @@
under the License.
-->
-<continuum-buildagent-configuration />
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:8080/continuum/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>data/build-output-directory</buildOutputDirectory>
+ <workingDirectory>data/working-directory</workingDirectory>
+</continuum-buildagent-configuration>
diff --git a/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/jetty-logging.xml b/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/jetty-logging.xml
deleted file mode 100644
index 379bd13..0000000
--- a/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/jetty-logging.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-<!--
- ~ 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.
- -->
-
-<!-- =============================================================== -->
-<!-- Configure stderr and stdout to a Jetty rollover log file -->
-<!-- this configuration file should be used in combination with -->
-<!-- other configuration files. e.g. -->
-<!-- java -jar start.jar etc/jetty-logging.xml etc/jetty.xml -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.mortbay.jetty.Server">
-
- <New id="ServerLog" class="java.io.PrintStream">
- <Arg>
- <New class="org.mortbay.util.RolloverFileOutputStream">
- <Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.stderrout.log</Arg>
- <Arg type="boolean">false</Arg>
- <Arg type="int">90</Arg>
- <Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
- <Get id="ServerLogName" name="datedFilename"/>
- </New>
- </Arg>
- </New>
-
- <Call class="org.mortbay.log.Log" name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
- <Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call>
- <Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call>
-
-</Configure>
-
-
-
diff --git a/continuum-buildagent/continuum-buildagent-webapp/pom.xml b/continuum-buildagent/continuum-buildagent-webapp/pom.xml
index 33cdefd..3a78a84 100644
--- a/continuum-buildagent/continuum-buildagent-webapp/pom.xml
+++ b/continuum-buildagent/continuum-buildagent-webapp/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-buildagent</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-buildagent-webapp</artifactId>
@@ -80,6 +80,51 @@
<artifactId>atlassian-xmlrpc-binder-server-spring</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-lightweight</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>classworlds</groupId>
+ <artifactId>classworlds</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh-external</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
<build>
@@ -91,7 +136,7 @@
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextPath>/</contextPath>
<stopKey>stopkey</stopKey>
- <stopPort>9192</stopPort>
+ <stopPort>9292</stopPort>
<jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
@@ -101,12 +146,42 @@
</connectors>
<systemProperties>
<systemProperty>
- <name>CONTINUUM_BUILDAGENT_HOME</name>
+ <name>appserver.base</name>
<value>${project.build.directory}/appserver-base</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <path>/continuum-buildagent</path>
+ <port>9191</port>
+ <contextFile>${basedir}/src/test/tomcat/tomcat-context-continuum.xml</contextFile>
+ <systemProperties>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}/appserver-base">
+ <fileset dir="src/appserver-base" />
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/appserver-base/conf/continuum-buildagent.xml b/continuum-buildagent/continuum-buildagent-webapp/src/appserver-base/conf/continuum-buildagent.xml
new file mode 100644
index 0000000..540e58c
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/appserver-base/conf/continuum-buildagent.xml
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+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.
+-->
+
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:9090/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>target/data/build-agent/build-output-directory</buildOutputDirectory>
+ <workingDirectory>target/data/build-agent/working-directory</workingDirectory>
+</continuum-buildagent-configuration>
\ No newline at end of file
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java b/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
index 53ba86d..f76928b 100644
--- a/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
@@ -1,5 +1,24 @@
package org.apache.continuum.web.startup;
+/*
+ * 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.
+ */
+
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@@ -21,7 +40,6 @@
public void contextDestroyed( ServletContextEvent sce )
{
// nothing to do here
-
}
/**
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml b/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
index d5682a3..d482de8 100644
--- a/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
@@ -3,7 +3,7 @@
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="rolling" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="file" value="${CONTINUUM_BUILDAGENT_HOME}/logs/continuum-buildagent.log" />
+ <param name="file" value="${appserver.base}/logs/continuum-buildagent.log" />
<param name="append" value="true" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
@@ -11,6 +11,7 @@
</layout>
</appender>
+<!--
<logger name="org.apache.continuum.buildagent">
<level value="info"/>
</logger>
@@ -22,6 +23,7 @@
<logger name="org.apache.continuum.distributed">
<level value="info"/>
</logger>
+-->
<logger name="org.springframework">
<level value="error"/>
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml b/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
index d676c1e..5020c7e 100644
--- a/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
@@ -1,8 +1,27 @@
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<?xml version="1.0"?>
-<web-app>
+<!--
+ ~ 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.
+ -->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Continuum Distributed Build Transport Tests</display-name>
<context-param>
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp b/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
index c38169b..6db69ff 100644
--- a/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
@@ -1,5 +1,20 @@
-<html>
-<body>
-<h2>Hello World!</h2>
-</body>
-</html>
+<%--
+ ~ 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.
+ --%>
+
+<% response.sendRedirect( request.getContextPath() + "/xmlrpc" ); %>
diff --git a/continuum-buildagent/continuum-buildagent-webapp/src/test/tomcat/tomcat-context-continuum-buildagent.xml b/continuum-buildagent/continuum-buildagent-webapp/src/test/tomcat/tomcat-context-continuum-buildagent.xml
new file mode 100644
index 0000000..2bcbde0
--- /dev/null
+++ b/continuum-buildagent/continuum-buildagent-webapp/src/test/tomcat/tomcat-context-continuum-buildagent.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+ <Context path="/continuum" />
+
\ No newline at end of file
diff --git a/continuum-buildagent/pom.xml b/continuum-buildagent/pom.xml
index cd11d58..982480c 100644
--- a/continuum-buildagent/pom.xml
+++ b/continuum-buildagent/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-buildagent</artifactId>
@@ -35,4 +35,34 @@
<module>continuum-buildagent-webapp</module>
<module>continuum-buildagent-jetty</module>
</modules>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <inherited>false</inherited>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/src.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <finalName>continuum-buildagent-${version}-src</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/continuum-buildagent/src/main/assembly/src.xml b/continuum-buildagent/src/main/assembly/src.xml
new file mode 100644
index 0000000..f5a3e84
--- /dev/null
+++ b/continuum-buildagent/src/main/assembly/src.xml
@@ -0,0 +1,46 @@
+<?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.
+ -->
+
+<assembly>
+ <id>src</id>
+ <formats>
+ <format>zip</format>
+ <format>tar.gz</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directory>../target/maven-shared-archive-resources/META-INF/</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>NOTICE</include>
+ <include>LICENSE</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
+
diff --git a/continuum-builder/pom.xml b/continuum-builder/pom.xml
index 08ab7fc..7341a9d 100644
--- a/continuum-builder/pom.xml
+++ b/continuum-builder/pom.xml
@@ -23,7 +23,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-builder</artifactId>
<name>Continuum :: Builder</name>
@@ -71,6 +71,10 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
</dependency>
diff --git a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
index 4732abc..5ce1a67 100644
--- a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
+++ b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
@@ -38,6 +38,7 @@
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.utils.ContinuumUtils;
import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
@@ -103,10 +104,11 @@
{
SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- log.info( "initializing buildContext" );
+ log.info( "initializing buildContext for projectGroupId=" + prepareBuildTask.getProjectGroupId() );
List<Map<String, Object>> buildContext =
initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
- prepareBuildTask.getTrigger(), prepareBuildTask.getScmRootAddress() );
+ prepareBuildTask.getBuildTrigger(), prepareBuildTask.getScmRootAddress(),
+ prepareBuildTask.getProjectScmRootId() );
startTime = System.currentTimeMillis();
client.buildProjects( buildContext );
@@ -126,24 +128,25 @@
}
private List<Map<String, Object>> initializeBuildContext( Map<Integer, Integer> projectsAndBuildDefinitions,
- int trigger, String scmRootAddress )
+ BuildTrigger buildTrigger, String scmRootAddress, int scmRootId )
throws ContinuumException
{
List<Map<String, Object>> buildContext = new ArrayList<Map<String, Object>>();
- List<Project> projects = new ArrayList<Project>();
try
{
- for ( Integer projectId : projectsAndBuildDefinitions.keySet() )
- {
- Project project = projectDao.getProjectWithDependencies( projectId );
- projects.add( project );
- }
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( scmRootId );
- projects = ProjectSorter.getSortedProjects( projects, null );
+ List<Project> projects = projectDao.getProjectsWithDependenciesByGroupId( scmRoot.getProjectGroup().getId() );
+ List<Project> sortedProjects = ProjectSorter.getSortedProjects( projects, null );
- for ( Project project : projects )
+ for ( Project project : sortedProjects )
{
+ if ( !projectsAndBuildDefinitions.containsKey( project.getId() ) )
+ {
+ continue;
+ }
+
int buildDefinitionId = projectsAndBuildDefinitions.get( project.getId() );
BuildDefinition buildDef = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );
@@ -152,6 +155,7 @@
context.put( ContinuumBuildConstant.KEY_PROJECT_GROUP_ID, project.getProjectGroup().getId() );
context.put( ContinuumBuildConstant.KEY_PROJECT_GROUP_NAME, project.getProjectGroup().getName() );
+ context.put( ContinuumBuildConstant.KEY_SCM_ROOT_ID, scmRootId );
context.put( ContinuumBuildConstant.KEY_SCM_ROOT_ADDRESS, scmRootAddress );
context.put( ContinuumBuildConstant.KEY_PROJECT_ID, project.getId() );
context.put( ContinuumBuildConstant.KEY_PROJECT_NAME, project.getName() );
@@ -166,11 +170,12 @@
new Date( buildResult.getStartTime() ) );
}
- LocalRepository localRepo = project.getProjectGroup().getLocalRepository();
+ LocalRepository localRepo = project.getProjectGroup().getLocalRepository();
if ( localRepo != null )
{
- context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getLocation() );
+ // CONTINUUM-2391
+ context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getName() );
}
else
{
@@ -195,7 +200,23 @@
context.put( ContinuumBuildConstant.KEY_SCM_PASSWORD, project.getScmPassword() );
}
+ if ( project.getScmTag() != null )
+ {
+ context.put( ContinuumBuildConstant.KEY_SCM_TAG, project.getScmTag() );
+ }
+ else
+ {
+ context.put( ContinuumBuildConstant.KEY_SCM_TAG, "" );
+ }
+
context.put( ContinuumBuildConstant.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
+ String buildDefinitionLabel = buildDef.getDescription();
+ if ( StringUtils.isEmpty( buildDefinitionLabel ) )
+ {
+ buildDefinitionLabel = buildDef.getGoals();
+ }
+ context.put( ContinuumBuildConstant.KEY_BUILD_DEFINITION_LABEL, buildDefinitionLabel );
+
context.put( ContinuumBuildConstant.KEY_BUILD_FILE, buildDef.getBuildFile() );
context.put( ContinuumBuildConstant.KEY_GOALS, buildDef.getGoals() );
@@ -207,7 +228,8 @@
{
context.put( ContinuumBuildConstant.KEY_ARGUMENTS, buildDef.getArguments() );
}
- context.put( ContinuumBuildConstant.KEY_TRIGGER, trigger );
+ context.put( ContinuumBuildConstant.KEY_TRIGGER, buildTrigger.getTrigger() );
+ context.put( ContinuumBuildConstant.KEY_USERNAME, buildTrigger.getUsername() );
context.put( ContinuumBuildConstant.KEY_BUILD_FRESH, buildDef.isBuildFresh() );
context.put( ContinuumBuildConstant.KEY_ALWAYS_BUILD, buildDef.isAlwaysBuild() );
context.put( ContinuumBuildConstant.KEY_OLD_SCM_CHANGES,
@@ -260,7 +282,8 @@
buildResult.setBuildDefinition( buildDef );
buildResult.setError( error );
buildResult.setState( ContinuumProjectState.ERROR );
- buildResult.setTrigger( task.getTrigger() );
+ buildResult.setTrigger( task.getBuildTrigger().getTrigger() );
+ buildResult.setUsername( task.getBuildTrigger().getUsername() );
buildResult.setStartTime( startTime );
buildResult.setEndTime( endTime );
diff --git a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/deferred/DistributedBuildProjectTaskExecutorDeferred.java b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/deferred/DistributedBuildProjectTaskExecutorDeferred.java
deleted file mode 100644
index c6d6d07..0000000
--- a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/deferred/DistributedBuildProjectTaskExecutorDeferred.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.apache.continuum.builder.distributed.executor.deferred;
-
-import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.TaskQueue;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DistributedBuildProjectTaskExecutorDeferred
- implements TaskExecutor
-{
- private static final Logger log = LoggerFactory.getLogger( DistributedBuildProjectTaskExecutorDeferred.class );
-
- /**
- * @plexus.requirement
- */
- private TaskQueue distributedTaskQueue;
-
- public void executeTask( Task task )
- throws TaskExecutionException
- {
- try
- {
- Thread.sleep( 1000 );
- distributedTaskQueue.put( task );
- }
- catch ( Exception e )
- {
- log.error( "error encountered adding the deferred task back to distributed queue", e );
- throw new TaskExecutionException( e.getMessage(), e );
- }
- }
-}
diff --git a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/overall/DistributedBuildProjectTaskExecutorOverall.java b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/overall/DistributedBuildProjectTaskExecutorOverall.java
deleted file mode 100644
index dcbf919..0000000
--- a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/overall/DistributedBuildProjectTaskExecutorOverall.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.apache.continuum.builder.distributed.executor.overall;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
-import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
-import org.apache.continuum.configuration.BuildAgentConfiguration;
-import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
-import org.apache.continuum.dao.BuildDefinitionDao;
-import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
-import org.apache.continuum.utils.ProjectSorter;
-import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.TaskQueue;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.dag.CycleDetectedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DistributedBuildProjectTaskExecutorOverall
- implements TaskExecutor
-{
- private static final Logger log = LoggerFactory.getLogger( DistributedBuildProjectTaskExecutorOverall.class );
-
- /**
- * @plexus.requirement
- */
- private ConfigurationService configurationService;
-
- /**
- * @plexus.requirement
- */
- private ProjectDao projectDao;
-
- /**
- * @plexus.requirement
- */
- private BuildDefinitionDao buildDefinitionDao;
-
- /**
- * @plexus.requirement
- */
- private DistributedBuildManager buildManager;
-
- /**
- * @plexus.requirement
- */
- private TaskQueue deferredTaskQueue;
-
- public void executeTask( Task task )
- throws TaskExecutionException
- {
- try
- {
- String agentGroup = getBuildAgentGroup( task );
-
- Map<String, DistributedBuildTaskQueueExecutor> executors = buildManager.getTaskQueueExecutors();
-
- DistributedBuildTaskQueueExecutor executor = filterExecutors( agentGroup, executors );
- if ( executor != null )
- {
- log.info( "delegating task to build agent task queue executor: " + executor.getBuildAgentUrl() );
- executor.getQueue().put( task );
- }
- else
- {
- // task is added to deferred-queue , which will then be added back to distributed-queue
- // so as not to choke-off the distributed-queue.
- deferredTaskQueue.put( task );
- }
- }
- catch ( ContinuumException e )
- {
- log.error( "error encountered delegating task to a build agent queue", e );
- throw new TaskExecutionException( e.getMessage(), e );
- }
- catch ( Exception e )
- {
- log.error( "error encountered delegating task to a build agent queue", e );
- throw new TaskExecutionException( e.getMessage(), e );
- }
- }
-
- private DistributedBuildTaskQueueExecutor filterExecutors(
- Map<String, DistributedBuildTaskQueueExecutor> executors )
- {
- // return the first non-busy taskqueue executor
- for ( String url : executors.keySet() )
- {
- if ( executors.get( url ).getCurrentTask() == null )
- {
- return executors.get( url );
- }
- }
- // else return the first executor
- if ( !executors.isEmpty() )
- {
- return executors.values().iterator().next();
- }
- return null;
- }
-
- private DistributedBuildTaskQueueExecutor filterExecutors( String agentGroupName,
- Map<String, DistributedBuildTaskQueueExecutor> executors )
- {
- if ( agentGroupName == null ) //it doesnt belong to any group, just return the first non-busy executor.
- {
- return filterExecutors( executors );
- }
-
- BuildAgentGroupConfiguration agentGroup = configurationService.getBuildAgentGroup( agentGroupName );
- List<BuildAgentConfiguration> buildAgents = agentGroup.getBuildAgents();
- Map<String, DistributedBuildTaskQueueExecutor> mapCandidateExecutors =
- new HashMap<String, DistributedBuildTaskQueueExecutor>();
- List<String> agentUrls = new ArrayList<String>();
-
- if ( buildAgents != null )
- {
- for ( BuildAgentConfiguration buildAgent : buildAgents )
- {
- agentUrls.add( buildAgent.getUrl() );
- }
- }
-
- for ( String url : executors.keySet() )
- {
- if ( agentUrls.contains( url ) )
- {
- mapCandidateExecutors.put( url, executors.get( url ) );
- }
- }
-
- return filterExecutors( mapCandidateExecutors );
- }
-
- private String getBuildAgentGroup( Task task )
- throws ContinuumException
- {
- try
- {
- List<Project> projects = new ArrayList<Project>();
-
- PrepareBuildProjectsTask prepareBuildTask = (PrepareBuildProjectsTask) task;
- Map<Integer, Integer> projectsAndBuildDefinitions = prepareBuildTask.getProjectsBuildDefinitionsMap();
-
- for ( Integer projectId : projectsAndBuildDefinitions.keySet() )
- {
- projects.add( projectDao.getProjectWithDependencies( projectId ) );
- }
-
- projects = ProjectSorter.getSortedProjects( projects, null );
-
- int buildDefinitionId = projectsAndBuildDefinitions.get( projects.get( 0 ).getId() );
- BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-
- Profile profile = buildDefinition.getProfile();
-
- if ( profile != null && !StringUtils.isEmpty( profile.getBuildAgentGroup() ) )
- {
- String groupName = profile.getBuildAgentGroup();
-
- BuildAgentGroupConfiguration buildAgentGroup = configurationService.getBuildAgentGroup( groupName );
-
- return buildAgentGroup.getName();
- }
- }
- catch ( ContinuumStoreException e )
- {
- throw new ContinuumException( "Error while getting build agent group", e );
- }
-
- log.info( "profile build agent group is null" );
-
- return null;
- }
-}
diff --git a/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/taskqueue/DefaultOverallDistributedBuildQueue.java b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/taskqueue/DefaultOverallDistributedBuildQueue.java
new file mode 100644
index 0000000..33e9c9b
--- /dev/null
+++ b/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/taskqueue/DefaultOverallDistributedBuildQueue.java
@@ -0,0 +1,139 @@
+package org.apache.continuum.builder.distributed.taskqueue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
+import org.apache.continuum.builder.distributed.executor.ThreadedDistributedBuildTaskQueueExecutor;
+import org.apache.continuum.taskqueue.OverallDistributedBuildQueue;
+import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.taskqueue.TaskQueueException;
+
+public class DefaultOverallDistributedBuildQueue
+ implements OverallDistributedBuildQueue
+{
+ private String buildAgentUrl;
+
+ private DistributedBuildTaskQueueExecutor distributedBuildTaskQueueExecutor;
+
+ public void addToDistributedBuildQueue( Task distributedBuildTask )
+ throws TaskQueueException
+ {
+ getDistributedBuildQueue().put( distributedBuildTask );
+ }
+
+ public String getBuildAgentUrl()
+ {
+ return buildAgentUrl;
+ }
+
+ public TaskQueue getDistributedBuildQueue()
+ {
+ return ( (ThreadedDistributedBuildTaskQueueExecutor) distributedBuildTaskQueueExecutor ).getQueue();
+ }
+
+ public DistributedBuildTaskQueueExecutor getDistributedBuildTaskQueueExecutor()
+ {
+ return distributedBuildTaskQueueExecutor;
+ }
+
+ public List<PrepareBuildProjectsTask> getProjectsInQueue()
+ throws TaskQueueException
+ {
+ return getDistributedBuildQueue().getQueueSnapshot();
+ }
+
+ public boolean isInDistributedBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInQueue();
+
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null )
+ {
+ if ( task.getProjectGroupId() == projectGroupId &&
+ task.getProjectScmRootId() == scmRootId )
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void removeFromDistributedBuildQueue( int projectGroupId, int scmRootId )
+ throws TaskQueueException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInQueue();
+
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null )
+ {
+ if ( task.getProjectGroupId() == projectGroupId &&
+ task.getProjectScmRootId() == scmRootId )
+ {
+ getDistributedBuildQueue().remove( task );
+ return;
+ }
+ }
+ }
+ }
+
+ public void removeFromDistributedBuildQueue( int[] hashCodes )
+ throws TaskQueueException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInQueue();
+
+ List<PrepareBuildProjectsTask> tasksToRemove = new ArrayList<PrepareBuildProjectsTask>();
+
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null )
+ {
+ if ( ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+ {
+ tasksToRemove.add( task );
+ }
+ }
+ }
+
+ if ( !tasksToRemove.isEmpty() )
+ {
+ getDistributedBuildQueue().removeAll( tasksToRemove );
+ }
+ }
+
+ public void removeFromDistributedBuildQueueByHashCode( int hashCode )
+ throws TaskQueueException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInQueue();
+
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task != null )
+ {
+ if ( task.getHashCode() == hashCode )
+ {
+ getDistributedBuildQueue().remove( task );
+ return;
+ }
+ }
+ }
+ }
+
+ public void setBuildAgentUrl( String buildAgentUrl )
+ {
+ this.buildAgentUrl = buildAgentUrl;
+ }
+
+ public void setDistributedBuildTaskQueueExecutor( DistributedBuildTaskQueueExecutor distributedBuildTaskQueueExecutor )
+ {
+ this.distributedBuildTaskQueueExecutor = distributedBuildTaskQueueExecutor;
+ }
+}
diff --git a/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java b/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
index a80fa5a..f33689a 100644
--- a/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
+++ b/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
@@ -25,6 +25,7 @@
import java.util.List;
import java.util.Map;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildResult;
public class ContinuumBuildConstant
@@ -37,7 +38,13 @@
public static final String KEY_BUILD_DEFINITION_ID = "builddefinition-id";
+ public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
+
public static final String KEY_TRIGGER = "trigger";
+
+ public static final String KEY_USERNAME = "username";
+
+ public static final String KEY_BUILD_TRIGGER = "buildTrigger";
public static final String KEY_EXECUTOR_ID = "executor-id";
@@ -83,6 +90,8 @@
public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
+ public static final String KEY_SCM_ROOT_ID = "scm-root-id";
+
public static final String KEY_SCM_ERROR = "scm-error";
public static final String KEY_PROJECT_NAME = "project-name";
@@ -198,6 +207,17 @@
{
return getInteger( context, KEY_TRIGGER );
}
+
+ public static String getUsername( Map<String, Object> context )
+ {
+ return getString( context, KEY_USERNAME, "" );
+ }
+
+ public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+ {
+ BuildTrigger defaultValue = new BuildTrigger( 0, "" );
+ return (BuildTrigger) getObject( context, KEY_BUILD_TRIGGER, defaultValue );
+ }
public static long getStartTime( Map<String, Object> context )
{
@@ -289,7 +309,7 @@
return getString( context, KEY_INSTALLATION_VAR_NAME );
}
- public static List<Map> getScmChanges( Map<String, Object> context )
+ public static List<Map<String, Object>> getScmChanges( Map<String, Object> context )
{
return getList( context, KEY_SCM_CHANGES );
}
@@ -318,7 +338,7 @@
}
}
- public static List<Map> getChangeSetFiles( Map<String, Object> context )
+ public static List<Map<String, Object>> getChangeSetFiles( Map<String, Object> context )
{
return getList( context, KEY_CHANGESET_FILES );
}
@@ -379,12 +399,12 @@
return getString( context, KEY_SCM_TAG );
}
- public static Map getProjectParent( Map<String, Object> context )
+ public static Map<String, Object> getProjectParent( Map<String, Object> context )
{
return getMap( context, KEY_PROJECT_PARENT );
}
- public static List<Map> getProjectDevelopers( Map<String, Object> context )
+ public static List<Map<String, Object>> getProjectDevelopers( Map<String, Object> context )
{
return getList( context, KEY_PROJECT_DEVELOPERS );
}
@@ -404,12 +424,12 @@
return getString( context, KEY_PROJECT_DEVELOPER_SCMID );
}
- public static List<Map> getProjectDependencies( Map<String, Object> context )
+ public static List<Map<String, Object>> getProjectDependencies( Map<String, Object> context )
{
return getList( context, KEY_PROJECT_DEPENDENCIES );
}
- public static List<Map> getProjectNotifiers( Map<String, Object> context )
+ public static List<Map<String, Object>> getProjectNotifiers( Map<String, Object> context )
{
return getList( context, KEY_PROJECT_NOTIFIERS );
}
@@ -464,12 +484,12 @@
return getBoolean( context, KEY_NOTIFIER_SEND_ON_WARNING );
}
- public static Map getScmResult( Map<String, Object> context )
+ public static Map<String, Object> getScmResult( Map<String, Object> context )
{
return getMap( context, KEY_SCM_RESULT );
}
- public static Map getMavenProject( Map<String, Object> context )
+ public static Map<String, Object> getMavenProject( Map<String, Object> context )
{
return getMap( context, KEY_MAVEN_PROJECT );
}
@@ -489,6 +509,16 @@
return getString( context, KEY_BUILD_AGENT_URL );
}
+ public static int getScmRootId( Map<String, Object> context )
+ {
+ return getInteger( context, KEY_SCM_ROOT_ID );
+ }
+
+ public static String getBuildDefinitionLabel( Map<String, Object> context )
+ {
+ return getString( context, KEY_BUILD_DEFINITION_LABEL, "" );
+ }
+
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
diff --git a/continuum-builder/src/main/resources/META-INF/plexus/components.xml b/continuum-builder/src/main/resources/META-INF/plexus/components.xml
index 41931bf..1fd08da 100644
--- a/continuum-builder/src/main/resources/META-INF/plexus/components.xml
+++ b/continuum-builder/src/main/resources/META-INF/plexus/components.xml
@@ -31,102 +31,10 @@
<role-hint>distributed-build-project</role-hint>
<implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
<lifecycle-handler>plexus-configurable</lifecycle-handler>
- </component>
-
- <component>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
- <lifecycle-handler>plexus-configurable</lifecycle-handler>
- </component>
-
- <component>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project-per-agent</role-hint>
- <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
- <lifecycle-handler>plexus-configurable</lifecycle-handler>
<instantiation-strategy>per-lookup</instantiation-strategy>
</component>
<component>
- <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
- <role-hint>distributed-build-project-overall</role-hint>
- <implementation>org.apache.continuum.builder.distributed.executor.overall.DistributedBuildProjectTaskExecutorOverall</implementation>
- <requirements>
- <requirement>
- <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
- <role-hint>default</role-hint>
- </requirement>
- <requirement>
- <role>org.apache.continuum.dao.ProjectDao</role>
- </requirement>
- <requirement>
- <role>org.apache.continuum.dao.BuildDefinitionDao</role>
- </requirement>
- <requirement>
- <role>org.apache.continuum.builder.distributed.manager.DistributedBuildManager</role>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- <field-name>deferredTaskQueue</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
- <role-hint>distributed-build-project-overall</role-hint>
- <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
- <instantiation-strategy>singleton</instantiation-strategy>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
- <role-hint>distributed-build-project-overall</role-hint>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project</role-hint>
- </requirement>
- </requirements>
- <configuration>
- <name>distributed-build-project-overall</name>
- </configuration>
- </component>
-
- <component>
- <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- <implementation>org.apache.continuum.builder.distributed.executor.deferred.DistributedBuildProjectTaskExecutorDeferred</implementation>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project</role-hint>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
- <instantiation-strategy>singleton</instantiation-strategy>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project-deferred</role-hint>
- </requirement>
- </requirements>
- <configuration>
- <name>distributed-build-project-deferred</name>
- </configuration>
- </component>
-
- <component>
<role>org.apache.continuum.builder.distributed.executor.DistributedBuildTaskExecutor</role>
<role-hint>distributed-build-project</role-hint>
<implementation>org.apache.continuum.builder.distributed.executor.DistributedBuildProjectTaskExecutor</implementation>
@@ -155,7 +63,7 @@
<requirements>
<requirement>
<role>org.codehaus.plexus.taskqueue.TaskQueue</role>
- <role-hint>distributed-build-project-per-agent</role-hint>
+ <role-hint>distributed-build-project</role-hint>
</requirement>
<requirement>
<role>org.apache.continuum.builder.distributed.executor.DistributedBuildTaskExecutor</role>
diff --git a/continuum-builder/src/main/resources/META-INF/spring-context.xml b/continuum-builder/src/main/resources/META-INF/spring-context.xml
new file mode 100644
index 0000000..5cf0ccb
--- /dev/null
+++ b/continuum-builder/src/main/resources/META-INF/spring-context.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+ <bean name="overallDistributedBuildQueue"
+ class="org.apache.continuum.builder.distributed.taskqueue.DefaultOverallDistributedBuildQueue" scope="prototype" autowire="byName">
+ <property name="distributedBuildTaskQueueExecutor" ref="distributedBuildTaskQueueExecutor#distributed-build-project"/>
+ </bean>
+</beans>
\ No newline at end of file
diff --git a/continuum-commons/pom.xml b/continuum-commons/pom.xml
index 1e41c08..d65ec58 100644
--- a/continuum-commons/pom.xml
+++ b/continuum-commons/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-commons</artifactId>
<name>Continuum :: Commons</name>
@@ -97,32 +97,5 @@
<artifactId>continuum-test</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jmock</groupId>
- <artifactId>jmock-junit3</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- dependency of jmock3 -->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- dependency of jmock3 -->
- <dependency>
- <groupId>org.objenesis</groupId>
- <artifactId>objenesis</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jmock</groupId>
- <artifactId>jmock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
diff --git a/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java b/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java
index 3de312e..9e19bc5 100644
--- a/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java
+++ b/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java
@@ -55,14 +55,12 @@
public void updateProfile( Profile profile )
throws ProfileException, AlreadyExistsProfileException
{
-
// already exists check should be done in the same transaction
// but we assume we don't have a huge load and a lot of concurrent access ;-)
- /*if ( alreadyExistsProfileName( profile ) )
+ if ( alreadyExistsProfileName( profile ) )
{
throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
}
- */
try
{
@@ -314,7 +312,8 @@
public boolean alreadyExistsProfileName( Profile profile )
throws ProfileException
{
- return getProfileWithName( profile.getName() ) != null;
+ Profile storedProfile = getProfileWithName( profile.getName() );
+ return ( storedProfile != null && storedProfile.getId() != profile.getId() );
}
}
diff --git a/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java b/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
index 6cada05..07c44b5 100644
--- a/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
+++ b/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
@@ -20,8 +20,6 @@
*/
import java.io.File;
-import java.util.List;
-
import javax.annotation.Resource;
import org.apache.maven.continuum.configuration.ConfigurationService;
@@ -73,9 +71,4 @@
f = new File( f, getConfigurationService().getWorkingDirectory().getPath() );
return new File( f, Integer.toString( project.getId() ) );
}
-
- public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
- {
- return getWorkingDirectory( project );
- }
}
diff --git a/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java b/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
index c89a2c8..3952b8a 100644
--- a/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
+++ b/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
@@ -21,13 +21,9 @@
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.Project;
-import org.codehaus.plexus.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.io.File;
-import java.util.List;
import javax.annotation.Resource;
@@ -41,8 +37,6 @@
{
@Resource
private ConfigurationService configurationService;
-
- private static final Logger log = LoggerFactory.getLogger( DefaultWorkingDirectoryService.class );
public void setConfigurationService( ConfigurationService configurationService )
{
@@ -60,69 +54,19 @@
public File getWorkingDirectory( Project project )
{
- return getWorkingDirectory( project, null, null );
- }
-
- /**
- *
- * @param project
- * @param projectScmRoot
- * @param projects projects under the same projectScmRoot
- * @return
- */
- public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
- {
// TODO: Enable, this is what we really want
// ContinuumProjectGroup projectGroup = project.getProjectGroup();
//
// return new File( projectGroup.getWorkingDirectory(),
// project.getPath() );
-
- if ( project.getWorkingDirectory() == null || "".equals( project.getWorkingDirectory() ) )
- {
- if ( project.isCheckedOutInSingleDirectory() && projectScmRoot != null && !"".equals( projectScmRoot ) )
- {
- Project rootProject = project;
- if( projects != null )
- {
- // the root project should have the lowest id since it's always added first
- for( Project projectUnderScmRoot : projects )
- {
- if( projectUnderScmRoot.getId() < rootProject.getId() )
- {
- rootProject = projectUnderScmRoot;
- }
- }
- }
-
- // determine the path
- String projectScmUrl = project.getScmUrl();
- int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );
-
- String pathToProject = "";
- if( indexDiff != -1 )
- {
- pathToProject = projectScmUrl.substring( indexDiff );
- }
-
- if( pathToProject.startsWith( "\\" ) || pathToProject.startsWith( "/" ) )
- {
- project.setWorkingDirectory( Integer.toString( rootProject.getId() ) + pathToProject );
- }
- else
- {
- project.setWorkingDirectory( Integer.toString( rootProject.getId() ) + "/" + pathToProject );
- }
- }
- else
- {
- project.setWorkingDirectory( Integer.toString( project.getId() ) );
- }
+
+ if ( project.getWorkingDirectory() == null )
+ {
+ project.setWorkingDirectory( Integer.toString( project.getId() ) );
}
File workDir;
File projectWorkingDirectory = new File( project.getWorkingDirectory() );
-
if ( projectWorkingDirectory.isAbsolute() )
{
// clean the project working directory path if it's a subdirectory of the global working directory
@@ -142,20 +86,8 @@
}
else
{
- File baseWorkingDir = getConfigurationService().getWorkingDirectory();
-
- // windows path
- if( baseWorkingDir.getPath().indexOf( '\\' ) != -1 )
- {
- project.setWorkingDirectory( project.getWorkingDirectory().replace( '/', '\\' ) );
- workDir = new File( baseWorkingDir.getPath() + "\\" + project.getWorkingDirectory() );
- }
- else
- {
- workDir = new File( baseWorkingDir, project.getWorkingDirectory() );
- }
+ workDir = new File( getConfigurationService().getWorkingDirectory(), project.getWorkingDirectory() );
}
-
return workDir;
}
}
diff --git a/continuum-commons/src/main/resources/META-INF/spring-context.xml b/continuum-commons/src/main/resources/META-INF/spring-context.xml
index 687d2ed..b8a9ada 100644
--- a/continuum-commons/src/main/resources/META-INF/spring-context.xml
+++ b/continuum-commons/src/main/resources/META-INF/spring-context.xml
@@ -29,13 +29,11 @@
<context:annotation-config />
<context:component-scan
base-package="org.apache.continuum.installation,org.apache.continuum.profile,
- org.apache.maven.continuum.configuration,org.apache.maven.continuum.utils,
- org.apache.continuum.utils.shell"/>
+ org.apache.maven.continuum.configuration,org.apache.maven.continuum.utils"/>
<bean id="configurationService" class="org.apache.maven.continuum.configuration.DefaultConfigurationService"
init-method="initialize">
<property name="applicationHome" value="data"/>
</bean>
- <bean id="shellCommandHelper" class="org.apache.continuum.utils.shell.DefaultShellCommandHelper"/>
<bean id="buildQueueService" class="org.apache.continuum.buildqueue.DefaultBuildQueueService"/>
</beans>
\ No newline at end of file
diff --git a/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java b/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
index 411eb23..834b3b0 100644
--- a/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
+++ b/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
@@ -216,23 +216,24 @@
public void testupdateProfileDuplicateName()
throws Exception
{
- Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
+ int profileId = jdk1mvn205.getId();
+ Profile profile = getProfileService().getProfile( profileId );
assertEquals( jdk1mvn205Name, profile.getName() );
profile.setName( jdk2mvn206Name );
try
{
getProfileService().updateProfile( profile );
- //commented
- //fail( "no AlreadyExistsProfileException with duplicate name" );
+
+ fail( "no AlreadyExistsProfileException with duplicate name" );
}
catch ( AlreadyExistsProfileException e )
{
// we must be here
}
- Profile getted = getProfileService().getProfile( jdk1mvn205.getId() );
+ Profile getted = getProfileService().getProfile( profileId );
assertNotNull( getted );
- assertEquals( jdk2mvn206Name, getted.getName() );
+ assertEquals( jdk1mvn205Name, getted.getName() );
}
public void testsetJdkInProfile()
diff --git a/continuum-commons/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java b/continuum-commons/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
deleted file mode 100644
index 02fc6ae..0000000
--- a/continuum-commons/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.apache.continuum.utils;
-
-/*
- * 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.
- */
-
-import junit.framework.TestCase;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.project.ProjectDependency;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author <a href="mailto:jmcconnell@apache.org">Jesse McConnell</a>
- * @version $Id:$
- */
-public class ProjectSorterTest
- extends TestCase
-{
-
- /**
- * test basic three project tree (really a line in this case)
- *
- * @throws Exception
- */
- public void testBasicNestedProjectStructure()
- throws Exception
- {
- List<Project> list = new ArrayList<Project>();
-
- Project top = getNewProject( "top" );
- list.add( top );
-
- Project c1 = getNewProject( "c1" );
- c1.setParent( generateProjectDependency( top ) );
- list.add( c1 );
-
- Project c2 = getNewProject( "c2" );
- c2.setParent( generateProjectDependency( top ) );
- c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) ) );
- list.add( c2 );
-
- List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
-
- assertNotNull( sortedList );
-
- Project p1 = sortedList.get( 0 );
- assertEquals( top.getArtifactId(), p1.getArtifactId() );
- Project p2 = sortedList.get( 1 );
- assertEquals( c1.getArtifactId(), p2.getArtifactId() );
- Project p3 = sortedList.get( 2 );
- assertEquals( c2.getArtifactId(), p3.getArtifactId() );
- }
-
- /**
- * test one of the child projects not having the artifactId or groupId empty and working off the
- * name instead
- *
- * @throws Exception
- */
- public void testIncompleteNestedProjectStructure()
- throws Exception
- {
- List<Project> list = new ArrayList<Project>();
-
- Project top = getNewProject( "top" );
- list.add( top );
-
- Project c1 = getIncompleteProject( "c1" );
- c1.setParent( generateProjectDependency( top ) );
- list.add( c1 );
-
- Project c2 = getNewProject( "c2" );
- c2.setParent( generateProjectDependency( top ) );
- c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) ) );
- list.add( c2 );
-
- List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
-
- assertNotNull( sortedList );
-
- Project p1 = sortedList.get( 0 );
- assertEquals( top.getArtifactId(), p1.getArtifactId() );
- Project p2 = sortedList.get( 1 );
- assertEquals( c1.getArtifactId(), p2.getArtifactId() );
- Project p3 = sortedList.get( 2 );
- assertEquals( c2.getArtifactId(), p3.getArtifactId() );
-
- }
-
- /**
- * project sorter can work with name replacing the artifactid and groupId
- *
- * @param projectId
- * @return
- */
- private Project getIncompleteProject( String projectId )
- {
- Project project = new Project();
- project.setName( "foo" + projectId );
- project.setVersion( "v" + projectId );
-
- return project;
- }
-
- private Project getNewProject( String projectId )
- {
- Project project = new Project();
- project.setArtifactId( "a" + projectId );
- project.setGroupId( "g" + projectId );
- project.setVersion( "v" + projectId );
- project.setName( "n" + projectId );
-
- return project;
- }
-
- private ProjectDependency generateProjectDependency( Project project )
- {
- ProjectDependency dep = new ProjectDependency();
- dep.setArtifactId( project.getArtifactId() );
- dep.setGroupId( project.getGroupId() );
- dep.setVersion( project.getVersion() );
-
- return dep;
- }
-
-}
\ No newline at end of file
diff --git a/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java b/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java
deleted file mode 100644
index dd0b937..0000000
--- a/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.apache.maven.continuum.utils;
-
-/*
- * 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.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.apache.maven.continuum.model.project.Project;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit3.JUnit3Mockery;
-
-/**
- * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @version
- */
-public class DefaultWorkingDirectoryServiceTest
- extends PlexusInSpringTestCase
-{
- private DefaultWorkingDirectoryService workingDirectoryService;
-
- private Mockery context;
-
- private ConfigurationService configurationService;
-
- public void setUp()
- throws Exception
- {
- super.setUp();
-
- context = new JUnit3Mockery();
-
- configurationService = context.mock( ConfigurationService.class );
-
- workingDirectoryService = ( DefaultWorkingDirectoryService ) lookup( WorkingDirectoryService.class );
-
- workingDirectoryService.setConfigurationService( configurationService );
- }
-
- private Project createProject( int id, String groupId, String artifactId, String version, String scmUrl,
- boolean checkedOutInSingleDirectory )
- {
- Project project = new Project();
- project.setId( id );
- project.setGroupId( groupId );
- project.setArtifactId( artifactId );
- project.setVersion( version );
- project.setScmUrl( scmUrl );
- project.setCheckedOutInSingleDirectory( checkedOutInSingleDirectory );
-
- return project;
- }
-
- public void testGetWorkingDirectoryOfSingleCheckoutFlatMultiModules()
- throws Exception
- {
- List<Project> projects = new ArrayList<Project>();
-
- Project project = createProject( 7, "org.apache.continuum", "module-a", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:flat-multi-module/module-a", true );
-
- projects.add( project );
-
- projects.add( createProject( 8, "org.apache.continuum", "module-b", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:flat-multi-module/module-b", true ) );
-
- projects.add( createProject( 6, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:flat-multi-module/parent-project", true ) );
-
- final File unixBaseWorkingDirectory = new File( "/target/working-directory" );
-
- final File windowsBaseWorkingDirectory = new File( "c:\\target\\working-directory" );
-
- context.checking( new Expectations()
- {
- {
- exactly( 2 ).of( configurationService ).getWorkingDirectory();
- will( returnValue( unixBaseWorkingDirectory ) );
-
- one( configurationService ).getWorkingDirectory();
- will( returnValue( windowsBaseWorkingDirectory ) );
- }} );
-
- // test if unix path
- File projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:flat-multi-module",
- projects );
-
- assertEquals( "Incorrect working directory for flat multi-module project", "/target/working-directory/6/module-a",
- projectWorkingDirectory.getPath() );
-
- // test if separator is appended at the end of the scm root url
- projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:flat-multi-module/",
- projects );
-
- assertEquals( "Incorrect working directory for flat multi-module project", "/target/working-directory/6/module-a",
- projectWorkingDirectory.getPath() );
-
-
- project.setWorkingDirectory( null );
-
- // test if windows path
- projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:flat-multi-module",
- projects );
-
- assertEquals( "Incorrect working directory for flat multi-module project", "c:\\target\\working-directory\\6\\module-a",
- projectWorkingDirectory.getPath() );
- }
-
- public void testGetWorkingDirectoryOfSingleCheckoutRegularMultiModules()
- throws Exception
- {
- List<Project> projects = new ArrayList<Project>();
-
- Project project = createProject( 10, "org.apache.continuum", "module-a", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:regular-multi-module/module-a", true );
-
- projects.add( project );
-
- projects.add( createProject( 11, "org.apache.continuum", "module-b", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:regular-multi-module/module-b", true ) );
-
- projects.add( createProject( 9, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:regular-multi-module/", true ) );
-
- final File unixBaseWorkingDirectory = new File( "/target/working-directory" );
-
- final File windowsBaseWorkingDirectory = new File( "c:\\target\\working-directory" );
-
- context.checking( new Expectations()
- {
- {
- exactly( 2 ).of( configurationService ).getWorkingDirectory();
- will( returnValue( unixBaseWorkingDirectory ) );
-
- one( configurationService ).getWorkingDirectory();
- will( returnValue( windowsBaseWorkingDirectory ) );
- }} );
-
- // test if unix path
- File projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module",
- projects );
-
- assertEquals( "Incorrect working directory for regular multi-module project", "/target/working-directory/9/module-a",
- projectWorkingDirectory.getPath() );
-
- // test if separator is appended at the end of the scm root url
- projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module/",
- projects );
-
- assertEquals( "Incorrect working directory for regular multi-module project", "/target/working-directory/9/module-a",
- projectWorkingDirectory.getPath() );
-
-
- project.setWorkingDirectory( null );
-
- // test if windows path
- projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module",
- projects );
-
- assertEquals( "Incorrect working directory for regular multi-module project", "c:\\target\\working-directory\\9\\module-a",
- projectWorkingDirectory.getPath() );
-
- project.setWorkingDirectory( null );
-
- // test generated path of parent project
- project = createProject( 9, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
- "scm:local:src/test-projects:regular-multi-module", true );
-
- context.checking( new Expectations()
- {
- {
- one( configurationService ).getWorkingDirectory();
- will( returnValue( unixBaseWorkingDirectory ) );
- }} );
-
- projectWorkingDirectory =
- workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module",
- projects );
-
- assertEquals( "Incorrect working directory for regular multi-module project", "/target/working-directory/9",
- projectWorkingDirectory.getPath() );
- }
-}
diff --git a/continuum-commons/src/test/resources/conf/continuum.xml b/continuum-commons/src/test/resources/conf/continuum.xml
index 6012086..1ee0fc0 100644
--- a/continuum-commons/src/test/resources/conf/continuum.xml
+++ b/continuum-commons/src/test/resources/conf/continuum.xml
@@ -9,5 +9,4 @@
<enabled>true</enabled>
</buildAgent>
</buildAgents>
- <distributedBuildEnabled>true</distributedBuildEnabled>
</continuum-configuration>
\ No newline at end of file
diff --git a/continuum-core/pom.xml b/continuum-core/pom.xml
index 0a5193f..162de97 100644
--- a/continuum-core/pom.xml
+++ b/continuum-core/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-core</artifactId>
@@ -171,7 +171,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-builder</artifactId>
@@ -282,20 +282,21 @@
<executions>
<execution>
<id>generate</id>
+ <phase>generate-resources</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>merge</id>
- <!--
+ <phase>process-resources</phase>
<configuration>
<descriptors>
- <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
- <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+ <descriptor>${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml</descriptor>
+ <descriptor>${project.build.outputDirectory}/META-INF/plexus/components.xml</descriptor>
</descriptors>
+ <output>${project.build.outputDirectory}/META-INF/plexus/components.xml</output>
</configuration>
- -->
<goals>
<goal>merge-descriptors</goal>
</goals>
diff --git a/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
new file mode 100644
index 0000000..58c5b0c
--- /dev/null
+++ b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
@@ -0,0 +1,730 @@
+package org.apache.continuum.builder.distributed;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.builder.distributed.util.DistributedBuildUtil;
+import org.apache.continuum.builder.utils.ContinuumBuildConstant;
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.dao.ProjectScmRootDao;
+import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.configuration.ConfigurationException;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.maven.continuum.installation.InstallationService;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDependency;
+import org.apache.maven.continuum.model.project.ProjectDeveloper;
+import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.model.scm.ChangeFile;
+import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @plexus.component role="org.apache.continuum.builder.distributed.DistributedBuildService"
+ */
+public class DefaultDistributedBuildService
+ implements DistributedBuildService
+{
+ private static final Logger log = LoggerFactory.getLogger( DefaultDistributedBuildService.class );
+
+ /**
+ * @plexus.requirement
+ */
+ private ProjectDao projectDao;
+
+ /**
+ * @plexus.requirement
+ */
+ private BuildDefinitionDao buildDefinitionDao;
+
+ /**
+ * @plexus.requirement
+ */
+ private BuildResultDao buildResultDao;
+
+ /**
+ * @plexus.requirement
+ */
+ private ProjectScmRootDao projectScmRootDao;
+
+ /**
+ * @plexus.requirement
+ */
+ private ConfigurationService configurationService;
+
+ /**
+ * @plexus.requirement
+ */
+ private InstallationService installationService;
+
+ /**
+ * @plexus.requirement
+ */
+ private ContinuumNotificationDispatcher notifierDispatcher;
+
+ /**
+ * @plexus.requirement
+ */
+ private DistributedBuildUtil distributedBuildUtil;
+
+ public void updateBuildResult( Map<String, Object> context )
+ throws ContinuumException
+ {
+ try
+ {
+ int projectId = ContinuumBuildConstant.getProjectId( context );
+ int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
+
+ log.info( "update build result of project '" + projectId + "'" );
+
+ Project project = projectDao.getProjectWithAllDetails( projectId );
+ BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+
+ BuildResult oldBuildResult =
+ buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
+
+ int buildNumber;
+
+ if ( ContinuumBuildConstant.getBuildState( context ) == ContinuumProjectState.OK )
+ {
+ buildNumber = project.getBuildNumber() + 1;
+ }
+ else
+ {
+ buildNumber = project.getBuildNumber();
+ }
+
+ // ----------------------------------------------------------------------
+ // Make the buildResult
+ // ----------------------------------------------------------------------
+
+ BuildResult buildResult = distributedBuildUtil.convertMapToBuildResult( context );
+
+ if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
+ {
+ buildResult.setBuildDefinition( buildDefinition );
+ buildResult.setBuildNumber( buildNumber );
+ buildResult.setModifiedDependencies( distributedBuildUtil.getModifiedDependencies( oldBuildResult, context ) );
+ buildResult.setScmResult( distributedBuildUtil.getScmResult( context ) );
+
+ Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
+ if ( date != null )
+ {
+ buildResult.setLastChangedDate( date.getTime() );
+ }
+ else if ( oldBuildResult != null )
+ {
+ buildResult.setLastChangedDate( oldBuildResult.getLastChangedDate() );
+ }
+
+ buildResultDao.addBuildResult( project, buildResult );
+
+ buildResult = buildResultDao.getBuildResult( buildResult.getId() );
+
+ project.setOldState( project.getState() );
+ project.setState( ContinuumBuildConstant.getBuildState( context ) );
+ project.setBuildNumber( buildNumber );
+ project.setLatestBuildId( buildResult.getId() );
+ }
+ else
+ {
+ project.setState( project.getOldState() );
+ project.setOldState( 0 );
+ }
+
+ projectDao.updateProject( project );
+
+ File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(), project.getId() );
+
+ FileWriter fstream = new FileWriter( buildOutputFile );
+ BufferedWriter out = new BufferedWriter( fstream );
+ out.write( ContinuumBuildConstant.getBuildOutput( context ) == null ? ""
+ : ContinuumBuildConstant.getBuildOutput( context ) );
+ out.close();
+
+ if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
+ {
+ notifierDispatcher.buildComplete( project, buildDefinition, buildResult );
+ }
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while updating build result for project", e );
+ }
+ catch ( ConfigurationException e )
+ {
+ throw new ContinuumException( "Error retrieving build output file", e );
+ }
+ catch ( IOException e )
+ {
+ throw new ContinuumException( "Error while writing build output to file", e );
+ }
+ }
+
+ public void prepareBuildFinished( Map<String, Object> context )
+ throws ContinuumException
+ {
+ int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
+ String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
+
+ try
+ {
+ ProjectScmRoot scmRoot =
+ projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
+
+ String error = ContinuumBuildConstant.getScmError( context );
+
+ if ( StringUtils.isEmpty( error ) )
+ {
+ scmRoot.setState( ContinuumProjectState.UPDATED );
+ }
+ else
+ {
+ scmRoot.setState( ContinuumProjectState.ERROR );
+ scmRoot.setError( error );
+ }
+
+ projectScmRootDao.updateProjectScmRoot( scmRoot );
+
+ notifierDispatcher.prepareBuildComplete( scmRoot );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Error while updating project scm root '" + scmRootAddress + "'", e );
+ }
+ }
+
+ public void startProjectBuild( int projectId )
+ throws ContinuumException
+ {
+ try
+ {
+ Project project = projectDao.getProject( projectId );
+ project.setState( ContinuumProjectState.BUILDING );
+ projectDao.updateProject( project );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ log.error( "Error while updating project's state (projectId=" + projectId + ")", e );
+ throw new ContinuumException( "Error while updating project's state (projectId=" + projectId + ")", e );
+ }
+ }
+
+ public void startPrepareBuild( Map<String, Object> context )
+ throws ContinuumException
+ {
+ int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
+
+ try
+ {
+ String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
+
+ ProjectScmRoot scmRoot =
+ projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
+ scmRoot.setOldState( scmRoot.getState() );
+ scmRoot.setState( ContinuumProjectState.UPDATING );
+ projectScmRootDao.updateProjectScmRoot( scmRoot );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ log.error( "Error while updating project group'" + projectGroupId + "' scm root's state", e );
+ throw new ContinuumException( "Error while updating project group'" + projectGroupId + "' scm root's state", e );
+ }
+ }
+
+ public Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+ throws ContinuumException
+ {
+ BuildDefinition buildDefinition;
+
+ try
+ {
+ buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Failed to retrieve build definition: " + buildDefinitionId, e );
+ }
+
+ Profile profile = buildDefinition.getProfile();
+ if ( profile == null )
+ {
+ return Collections.EMPTY_MAP;
+ }
+ Map<String, String> envVars = new HashMap<String, String>();
+ String javaHome = getJavaHomeValue( buildDefinition );
+ if ( !StringUtils.isEmpty( javaHome ) )
+ {
+ envVars.put( installationService.getEnvVar( InstallationService.JDK_TYPE ), javaHome );
+ }
+ Installation builder = profile.getBuilder();
+ if ( builder != null )
+ {
+ envVars.put( installationService.getEnvVar( installationType ), builder.getVarValue() );
+ }
+ envVars.putAll( getEnvironmentVariables( buildDefinition ) );
+ return envVars;
+ }
+
+ public void updateProject( Map<String, Object> context )
+ throws ContinuumException
+ {
+ try
+ {
+ Project project = projectDao.getProject( ContinuumBuildConstant.getProjectId( context ) );
+
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getGroupId( context ) ) )
+ {
+ project.setGroupId( ContinuumBuildConstant.getGroupId( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getArtifactId( context ) ) )
+ {
+ project.setArtifactId( ContinuumBuildConstant.getArtifactId( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getVersion( context ) ) )
+ {
+ project.setVersion( ContinuumBuildConstant.getVersion( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectName( context ) ) )
+ {
+ project.setName( ContinuumBuildConstant.getProjectName( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectDescription( context ) ) )
+ {
+ project.setDescription( ContinuumBuildConstant.getProjectDescription( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectUrl( context ) ) )
+ {
+ project.setUrl( ContinuumBuildConstant.getProjectUrl( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getScmUrl( context ) ) )
+ {
+ project.setScmUrl( ContinuumBuildConstant.getScmUrl( context ) );
+ }
+ if ( StringUtils.isNotBlank( ContinuumBuildConstant.getScmTag( context ) ) )
+ {
+ project.setScmTag( ContinuumBuildConstant.getScmTag( context ) );
+ }
+ project.setParent( getProjectParent( context ) );
+ project.setDependencies( getProjectDependencies( context ) );
+ project.setDevelopers( getProjectDevelopers( context ) );
+ project.setNotifiers( getProjectNotifiers( context ) );
+
+ projectDao.updateProject( project );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new ContinuumException( "Unable to update project '" + ContinuumBuildConstant.getProjectId( context ) +
+ "' from working copy", e );
+ }
+ }
+
+ public boolean shouldBuild( Map<String, Object> context )
+ {
+ int projectId = ContinuumBuildConstant.getProjectId( context );
+
+ try
+ {
+ int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
+
+ int trigger = ContinuumBuildConstant.getTrigger( context );
+
+ Project project = projectDao.getProjectWithAllDetails( projectId );
+
+ BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+
+ BuildResult oldBuildResult =
+ buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
+
+ List<ProjectDependency> modifiedDependencies = distributedBuildUtil.getModifiedDependencies( oldBuildResult, context );
+
+ List<ChangeSet> changes = distributedBuildUtil.getScmChanges( context );
+
+ if ( buildDefinition.isBuildFresh() )
+ {
+ log.info( "FreshBuild configured, building (projectId=" + projectId + ")" );
+ return true;
+ }
+ if ( buildDefinition.isAlwaysBuild() )
+ {
+ log.info( "AlwaysBuild configured, building (projectId=" + projectId + ")" );
+ return true;
+ }
+ if ( oldBuildResult == null )
+ {
+ log.info( "The project '" + projectId + "' was never built with the current build definition, building" );
+ return true;
+ }
+
+ //CONTINUUM-1428
+ if ( project.getOldState() == ContinuumProjectState.ERROR ||
+ oldBuildResult.getState() == ContinuumProjectState.ERROR )
+ {
+ log.info( "Latest state was 'ERROR', building (projectId=" + projectId + ")" );
+ return true;
+ }
+
+ if ( trigger == ContinuumProjectState.TRIGGER_FORCED )
+ {
+ log.info( "The project '" + projectId + "' build is forced, building" );
+ return true;
+ }
+
+ Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
+ if ( date != null && oldBuildResult.getLastChangedDate() >= date.getTime() )
+ {
+ log.info( "No changes found, not building (projectId=" + projectId + ")" );
+ return false;
+ }
+ else if ( date != null && changes.isEmpty() )
+ {
+ // fresh checkout from build agent that's why changes is empty
+ log.info( "Changes found in the current project, building (projectId=" + projectId + ")" );
+ return true;
+ }
+
+ boolean shouldBuild = false;
+
+ boolean allChangesUnknown = true;
+
+ if ( project.getOldState() != ContinuumProjectState.NEW &&
+ project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
+ project.getState() != ContinuumProjectState.NEW &&
+ project.getState() != ContinuumProjectState.CHECKEDOUT )
+ {
+ // Check SCM changes
+ allChangesUnknown = checkAllChangesUnknown( changes );
+
+ if ( allChangesUnknown )
+ {
+ if ( !changes.isEmpty() )
+ {
+ log.info( "The project '" + projectId +
+ "' was not built because all changes are unknown (maybe local modifications or ignored files not defined in your SCM tool." );
+ }
+ else
+ {
+ log.info( "The project '" + projectId +
+ "' was not built because no changes were detected in sources since the last build." );
+ }
+ }
+
+ // Check dependencies changes
+ if ( modifiedDependencies != null && !modifiedDependencies.isEmpty() )
+ {
+ log.info( "Found dependencies changes, building (projectId=" + projectId + ")" );
+ shouldBuild = true;
+ }
+ }
+
+ // Check changes
+ if ( !shouldBuild && ( ( !allChangesUnknown && !changes.isEmpty() ) ||
+ project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
+ {
+ shouldBuild = shouldBuild( changes, buildDefinition, project, getMavenProjectVersion( context ),
+ getMavenProjectModules( context ) );
+ }
+
+ if ( shouldBuild )
+ {
+ log.info( "Changes found in the current project, building (projectId=" + projectId + ")" );
+ }
+ else
+ {
+ log.info( "No changes in the current project, not building (projectId=" + projectId + ")" );
+ }
+
+ return shouldBuild;
+ }
+ catch ( ContinuumStoreException e )
+ {
+ log.error( "Failed to determine if project '" + projectId + "' should build", e );
+ }
+ catch ( ContinuumException e )
+ {
+ log.error( "Failed to determine if project '" + projectId + "' should build", e );
+ }
+
+ return false;
+ }
+
+ private boolean shouldBuild( List<ChangeSet> changes, BuildDefinition buildDefinition, Project project,
+ String mavenProjectVersion, List<String> mavenProjectModules )
+ {
+ //Check if it's a recursive build
+ boolean isRecursive = false;
+ if ( StringUtils.isNotEmpty( buildDefinition.getArguments() ) )
+ {
+ isRecursive = buildDefinition.getArguments().indexOf( "-N" ) < 0 &&
+ buildDefinition.getArguments().indexOf( "--non-recursive" ) < 0;
+ }
+
+ if ( isRecursive && changes != null && !changes.isEmpty() )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "recursive build and changes found --> building (projectId=" + project.getId() + ")" );
+ }
+ return true;
+ }
+
+ if ( !project.getVersion().equals( mavenProjectVersion ) )
+ {
+ log.info( "Found changes in project's version ( maybe project '" + project.getId() +
+ "' was recently released ), building" );
+ return true;
+ }
+
+ if ( changes == null || changes.isEmpty() )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "Found no changes, not building (projectId=" + project.getId() + ")" );
+ }
+ return false;
+ }
+
+ //check if changes are only in sub-modules or not
+ List<ChangeFile> files = new ArrayList<ChangeFile>();
+ for ( ChangeSet changeSet : changes )
+ {
+ files.addAll( changeSet.getFiles() );
+ }
+
+ int i = 0;
+ while ( i <= files.size() - 1 )
+ {
+ ChangeFile file = files.get( i );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "changeFile.name " + file.getName() );
+ log.debug( "check in modules " + mavenProjectModules );
+ }
+ boolean found = false;
+ if ( mavenProjectModules != null )
+ {
+ for ( String module : mavenProjectModules )
+ {
+ if ( file.getName().indexOf( module ) >= 0 )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "changeFile.name " + file.getName() + " removed because in a module" );
+ }
+ files.remove( file );
+ found = true;
+ break;
+ }
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "not removing file " + file.getName() + " not in module " + module );
+ }
+ }
+ }
+ if ( !found )
+ {
+ i++;
+ }
+ }
+
+ boolean shouldBuild = !files.isEmpty();
+
+ if ( !shouldBuild )
+ {
+ log.info( "Changes are only in sub-modules (projectId=" + project.getId() + ")." );
+ }
+
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "shoulbuild = " + shouldBuild );
+ }
+
+ return shouldBuild;
+ }
+
+ private boolean checkAllChangesUnknown( List<ChangeSet> changes )
+ {
+ for ( ChangeSet changeSet : changes )
+ {
+ List<ChangeFile> changeFiles = changeSet.getFiles();
+
+ for ( ChangeFile changeFile : changeFiles )
+ {
+ if ( !"unknown".equalsIgnoreCase( changeFile.getStatus() ) )
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+
+ private String getJavaHomeValue( BuildDefinition buildDefinition )
+ {
+ Profile profile = buildDefinition.getProfile();
+ if ( profile == null )
+ {
+ return null;
+ }
+ Installation jdk = profile.getJdk();
+ if ( jdk == null )
+ {
+ return null;
+ }
+ return jdk.getVarValue();
+ }
+
+ private Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition )
+ {
+ Profile profile = buildDefinition.getProfile();
+ Map<String, String> envVars = new HashMap<String, String>();
+ if ( profile == null )
+ {
+ return envVars;
+ }
+ List<Installation> environmentVariables = profile.getEnvironmentVariables();
+ if ( environmentVariables.isEmpty() )
+ {
+ return envVars;
+ }
+ for ( Installation installation : environmentVariables )
+ {
+ envVars.put( installation.getVarName(), installation.getVarValue() );
+ }
+ return envVars;
+ }
+
+ private ProjectDependency getProjectParent( Map<String, Object> context )
+ {
+ Map<String, Object> map = ContinuumBuildConstant.getProjectParent( context );
+
+ if ( map != null && map.size() > 0 )
+ {
+ ProjectDependency parent = new ProjectDependency();
+ parent.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
+ parent.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
+ parent.setVersion( ContinuumBuildConstant.getVersion( map ) );
+
+ return parent;
+ }
+
+ return null;
+ }
+
+ private List<ProjectDependency> getProjectDependencies( Map<String, Object> context )
+ {
+ List<ProjectDependency> projectDependencies = new ArrayList<ProjectDependency>();
+
+ List<Map<String, Object>> dependencies = ContinuumBuildConstant.getProjectDependencies( context );
+
+ if ( dependencies != null )
+ {
+ for ( Map<String, Object> map : dependencies )
+ {
+ ProjectDependency dependency = new ProjectDependency();
+ dependency.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
+ dependency.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
+ dependency.setVersion( ContinuumBuildConstant.getVersion( map ) );
+
+ projectDependencies.add( dependency );
+ }
+ }
+ return projectDependencies;
+ }
+
+ private List<ProjectDeveloper> getProjectDevelopers( Map<String, Object> context )
+ {
+ List<ProjectDeveloper> projectDevelopers = new ArrayList<ProjectDeveloper>();
+
+ List<Map<String, Object>> developers = ContinuumBuildConstant.getProjectDevelopers( context );
+
+ if ( developers != null )
+ {
+ for ( Map<String, Object> map : developers )
+ {
+ ProjectDeveloper developer = new ProjectDeveloper();
+ developer.setName( ContinuumBuildConstant.getDeveloperName( map ) );
+ developer.setEmail( ContinuumBuildConstant.getDeveloperEmail( map ) );
+ developer.setScmId( ContinuumBuildConstant.getDeveloperScmId( map ) );
+
+ projectDevelopers.add( developer );
+ }
+ }
+ return projectDevelopers;
+ }
+
+ private List<ProjectNotifier> getProjectNotifiers( Map<String, Object> context )
+ {
+ List<ProjectNotifier> projectNotifiers = new ArrayList<ProjectNotifier>();
+
+ List<Map<String, Object>> notifiers = ContinuumBuildConstant.getProjectNotifiers( context );
+
+ if ( notifiers != null )
+ {
+ for ( Map<String, Object> map : notifiers )
+ {
+ ProjectNotifier notifier = new ProjectNotifier();
+ notifier.setConfiguration( ContinuumBuildConstant.getNotifierConfiguration( map ) );
+ notifier.setEnabled( ContinuumBuildConstant.isNotifierEnabled( map ) );
+ notifier.setFrom( ContinuumBuildConstant.getNotifierFrom( map ) );
+ notifier.setRecipientType( ContinuumBuildConstant.getNotifierRecipientType( map ) );
+ notifier.setSendOnError( ContinuumBuildConstant.isNotifierSendOnError( map ) );
+ notifier.setSendOnFailure( ContinuumBuildConstant.isNotifierSendOnFailure( map ) );
+ notifier.setSendOnScmFailure( ContinuumBuildConstant.isNotifierSendOnScmFailure( map ) );
+ notifier.setSendOnSuccess( ContinuumBuildConstant.isNotifierSendOnSuccess( map ) );
+ notifier.setSendOnWarning( ContinuumBuildConstant.isNotifierSendOnWarning( map ) );
+ notifier.setType( ContinuumBuildConstant.getNotifierType( map ) );
+
+ projectNotifiers.add( notifier );
+ }
+ }
+ return projectNotifiers;
+ }
+
+ private String getMavenProjectVersion( Map<String, Object> context )
+ {
+ Map<String, Object> map = ContinuumBuildConstant.getMavenProject( context );
+
+ if ( !map.isEmpty() )
+ {
+ return ContinuumBuildConstant.getVersion( map );
+ }
+
+ return null;
+ }
+
+ private List<String> getMavenProjectModules( Map<String, Object> context )
+ {
+ Map<String, Object> map = ContinuumBuildConstant.getMavenProject( context );
+
+ if ( !map.isEmpty() )
+ {
+ return ContinuumBuildConstant.getProjectModules( map );
+ }
+
+ return null;
+ }
+}
diff --git a/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
index 99c5ef4..1117ab0 100644
--- a/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
+++ b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
@@ -19,49 +19,40 @@
* under the License.
*/
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.builder.distributed.executor.ThreadedDistributedBuildTaskQueueExecutor;
+import org.apache.continuum.builder.distributed.util.DistributedBuildUtil;
import org.apache.continuum.builder.utils.ContinuumBuildConstant;
import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectScmRootDao;
import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportClient;
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.taskqueue.OverallDistributedBuildQueue;
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.utils.ContinuumUtils;
+import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.configuration.ConfigurationException;
import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.project.ProjectDependency;
-import org.apache.maven.continuum.model.project.ProjectDeveloper;
-import org.apache.maven.continuum.model.project.ProjectNotifier;
-import org.apache.maven.continuum.model.scm.ChangeFile;
-import org.apache.maven.continuum.model.scm.ChangeSet;
-import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
-import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
@@ -73,6 +64,8 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.TaskQueueException;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -86,15 +79,13 @@
{
private static final Logger log = LoggerFactory.getLogger( DefaultDistributedBuildManager.class );
- /**
- * @plexus.requirement
- */
- private ConfigurationService configurationService;
+ private Map<String, OverallDistributedBuildQueue> overallDistributedBuildQueues =
+ Collections.synchronizedMap( new HashMap<String, OverallDistributedBuildQueue>() );
/**
* @plexus.requirement
*/
- private InstallationService installationService;
+ private ConfigurationService configurationService;
/**
* @plexus.requirement
@@ -109,22 +100,15 @@
/**
* @plexus.requirement
*/
- private ProjectScmRootDao projectScmRootDao;
-
- /**
- * @plexus.requirement
- */
private BuildResultDao buildResultDao;
/**
* @plexus.requirement
*/
- private ContinuumNotificationDispatcher notifierDispatcher;
+ private DistributedBuildUtil distributedBuildUtil;
private PlexusContainer container;
- private Map<String, DistributedBuildTaskQueueExecutor> taskQueueExecutors;
-
// --------------------------------
// Plexus Lifecycle
// --------------------------------
@@ -137,47 +121,47 @@
public void initialize()
throws InitializationException
{
- taskQueueExecutors = new HashMap<String, DistributedBuildTaskQueueExecutor>();
-
List<BuildAgentConfiguration> agents = configurationService.getBuildAgents();
if ( agents != null )
{
- for ( BuildAgentConfiguration agent : agents )
+ synchronized( overallDistributedBuildQueues )
{
- if ( agent.isEnabled() )
+ for ( BuildAgentConfiguration agent : agents )
{
- try
+ if ( agent.isEnabled() )
{
- SlaveBuildAgentTransportClient client =
- new SlaveBuildAgentTransportClient( new URL( agent.getUrl() ) );
+ try
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
- if ( client.ping() )
- {
- log.info(
- "agent is enabled, add TaskQueueExecutor for build agent '" + agent.getUrl() + "'" );
- addTaskQueueExecutor( agent.getUrl() );
+ if ( client.ping() )
+ {
+ log.info(
+ "agent is enabled, create distributed build queue for build agent '" + agent.getUrl() + "'" );
+ createDistributedBuildQueueForAgent( agent.getUrl() );
+ }
+ else
+ {
+ log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
+ }
}
- else
+ catch ( MalformedURLException e )
{
- log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
+ // do not throw exception, just log it
+ log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating distributed build queue" );
}
- }
- catch ( MalformedURLException e )
- {
- // do not throw exception, just log it
- log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating task queue executor" );
- }
- catch ( ContinuumException e )
- {
- throw new InitializationException(
- "Error while initializing distributed build task queue executors", e );
- }
- catch ( Exception e )
- {
- agent.setEnabled( false );
- log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
- ContinuumUtils.throwableToString( e ) );
+ catch ( ContinuumException e )
+ {
+ throw new InitializationException(
+ "Error while initializing distributed build queues", e );
+ }
+ catch ( Exception e )
+ {
+ agent.setEnabled( false );
+ log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
+ ContinuumUtils.throwableToString( e ) );
+ }
}
}
}
@@ -189,367 +173,367 @@
{
List<BuildAgentConfiguration> agents = configurationService.getBuildAgents();
- for ( BuildAgentConfiguration agent : agents )
- {
- if ( agent.isEnabled() && !taskQueueExecutors.containsKey( agent.getUrl() ) )
- {
- try
- {
- SlaveBuildAgentTransportClient client =
- new SlaveBuildAgentTransportClient( new URL( agent.getUrl() ) );
-
- if ( client.ping() )
- {
- log.info( "agent is enabled, add TaskQueueExecutor for build agent '" + agent.getUrl() + "'" );
- addTaskQueueExecutor( agent.getUrl() );
- }
- else
- {
- log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
- }
- }
- catch ( MalformedURLException e )
- {
- // do not throw exception, just log it
- log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating task queue executor" );
- }
- catch ( Exception e )
- {
- agent.setEnabled( false );
- log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
- ContinuumUtils.throwableToString( e ) );
- }
- }
- else if ( !agent.isEnabled() && taskQueueExecutors.containsKey( agent.getUrl() ) )
- {
- log.info( "agent is disabled, remove TaskQueueExecutor for build agent '" + agent.getUrl() + "'" );
- removeAgentFromTaskQueueExecutor( agent.getUrl() );
- }
- }
- }
-
- public void removeAgentFromTaskQueueExecutor( String buildAgentUrl )
- throws ContinuumException
- {
- log.info( "remove TaskQueueExecutor for build agent '" + buildAgentUrl + "'" );
- ThreadedDistributedBuildTaskQueueExecutor executor =
- (ThreadedDistributedBuildTaskQueueExecutor) taskQueueExecutors.get( buildAgentUrl );
-
- if ( executor == null )
+ if ( agents == null )
{
return;
}
- try
+ synchronized( overallDistributedBuildQueues )
{
- executor.stop();
- container.release( executor );
- }
- catch ( StoppingException e )
- {
- throw new ContinuumException( "Error while stopping task queue executor", e );
- }
- catch ( ComponentLifecycleException e )
- {
- throw new ContinuumException( "Error while releasing task queue executor from container", e );
- }
-
- taskQueueExecutors.remove( buildAgentUrl );
- }
-
- public boolean isBuildAgentBusy( String buildAgentUrl )
- {
- DistributedBuildTaskQueueExecutor executor = taskQueueExecutors.get( buildAgentUrl );
-
- if ( executor != null && executor.getCurrentTask() != null )
- {
- log.info( "build agent '" + buildAgentUrl + "' is busy" );
- return true;
- }
-
- log.info( "build agent '" + buildAgentUrl + "' is not busy" );
- return false;
- }
-
- private void addTaskQueueExecutor( String url )
- throws ContinuumException
- {
- try
- {
- DistributedBuildTaskQueueExecutor taskQueueExecutor = (DistributedBuildTaskQueueExecutor) container.
- lookup( DistributedBuildTaskQueueExecutor.class, "distributed-build-project" );
- taskQueueExecutor.setBuildAgentUrl( url );
- taskQueueExecutors.put( url, taskQueueExecutor );
- }
- catch ( ComponentLookupException e )
- {
- throw new ContinuumException( "Unable to lookup TaskQueueExecutor for distributed-build-project", e );
- }
- }
-
- public void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, String scmRootAddress )
- throws ContinuumException
- {
- DistributedBuildTaskQueueExecutor taskQueueExecutor = taskQueueExecutors.get( buildAgentUrl );
-
- if ( taskQueueExecutor != null )
- {
- if ( taskQueueExecutor.getCurrentTask() != null )
+ for ( BuildAgentConfiguration agent : agents )
{
- if ( taskQueueExecutor.getCurrentTask() instanceof PrepareBuildProjectsTask )
+ if ( agent.isEnabled() && !overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
{
- PrepareBuildProjectsTask currentTask = (PrepareBuildProjectsTask) taskQueueExecutor.getCurrentTask()
- ;
-
- if ( currentTask.getProjectGroupId() == projectGroupId &&
- currentTask.getScmRootAddress().equals( scmRootAddress ) )
+ try
{
- log.info( "cancelling task for project group " + projectGroupId + " with scm root address " +
- scmRootAddress );
- taskQueueExecutor.cancelTask( currentTask );
-
- try
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
+
+ if ( client.ping() )
{
- SlaveBuildAgentTransportClient client =
- new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- client.cancelBuild();
+ log.info( "agent is enabled, create distributed build queue for build agent '" + agent.getUrl() + "'" );
+ createDistributedBuildQueueForAgent( agent.getUrl() );
}
- catch ( Exception e )
+ else
{
- log.error( "Error while cancelling build in build agent '" + buildAgentUrl + "'" );
- throw new ContinuumException(
- "Error while cancelling build in build agent '" + buildAgentUrl + "'", e );
+ log.info( "unable to ping build agent '" + agent.getUrl() + "'" );
}
}
- else
+ catch ( MalformedURLException e )
{
- log.info( "current task not for project group " + projectGroupId + " with scm root address " +
- scmRootAddress );
+ // do not throw exception, just log it
+ log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating distributed build queue" );
}
+ catch ( Exception e )
+ {
+ agent.setEnabled( false );
+ log.info( "unable to ping build agent '" + agent.getUrl() + "': " +
+ ContinuumUtils.throwableToString( e ) );
+ }
+ }
+ else if ( !agent.isEnabled() && overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
+ {
+ log.info( "agent is disabled, remove distributed build queue for build agent '" + agent.getUrl() + "'" );
+ removeDistributedBuildQueueOfAgent( agent.getUrl() );
+ }
+ }
+ }
+ }
+
+ public void prepareBuildProjects( Map<Integer, Integer>projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId,
+ String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
+ {
+ PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, buildTrigger,
+ projectGroupId, projectGroupName,
+ scmRootAddress, scmRootId );
+
+ OverallDistributedBuildQueue overallDistributedBuildQueue = getOverallDistributedBuildQueueByGroup( projectGroupId, scmRoots, scmRootId );
+
+ if ( overallDistributedBuildQueue == null )
+ {
+ if ( hasBuildagentGroup( projectsBuildDefinitionsMap ) )
+ {
+ if ( !hasBuildagentInGroup( projectsBuildDefinitionsMap ) )
+ {
+ log.warn( "No build agent configured in build agent group. Not building projects." );
+
+ throw new NoBuildAgentInGroupException( "No build agent configured in build agent group" );
}
else
{
- log.info( "current task not a prepare build projects task, not cancelling" );
+ // get overall distributed build queue from build agent group
+ log.info( "getting the least busy build agent from the build agent group" );
+ overallDistributedBuildQueue = getOverallDistributedBuildQueueByAgentGroup( projectsBuildDefinitionsMap );
}
}
else
{
- log.info( "no current task in build agent '" + buildAgentUrl + "'" );
+ // project does not have build agent group
+ log.info( "project does not have a build agent group, getting the least busy build agent" );
+ overallDistributedBuildQueue = getOverallDistributedBuildQueue();
+ }
+ }
+
+ if ( overallDistributedBuildQueue != null )
+ {
+ try
+ {
+ overallDistributedBuildQueue.addToDistributedBuildQueue( task );
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error while enqueuing prepare build task", e );
+ throw new ContinuumException( "Error occurred while enqueuing prepare build task", e );
}
}
else
{
- log.info( "no task queue executor defined for build agent '" + buildAgentUrl + "'" );
+ log.warn( "No build agent configured. Not building projects." );
+
+ throw new NoBuildAgentException( "No build agent configured" );
}
+
+ // call in case we disabled a build agent
+ reload();
}
- public void updateBuildResult( Map<String, Object> context )
+ public void removeDistributedBuildQueueOfAgent( String buildAgentUrl )
throws ContinuumException
{
- try
+ if ( overallDistributedBuildQueues.containsKey( buildAgentUrl ) )
{
- int projectId = ContinuumBuildConstant.getProjectId( context );
- int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
+ List<PrepareBuildProjectsTask> tasks = null;
- log.info( "update build result of project '" + projectId + "'" );
-
- Project project = projectDao.getProjectWithAllDetails( projectId );
- BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-
- BuildResult oldBuildResult =
- buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
-
- int buildNumber;
-
- if ( ContinuumBuildConstant.getBuildState( context ) == ContinuumProjectState.OK )
+ synchronized( overallDistributedBuildQueues )
{
- buildNumber = project.getBuildNumber() + 1;
- }
- else
- {
- buildNumber = project.getBuildNumber();
- }
+ OverallDistributedBuildQueue overallDistributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
- // ----------------------------------------------------------------------
- // Make the buildResult
- // ----------------------------------------------------------------------
-
- BuildResult buildResult = convertMapToBuildResult( context );
-
- if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
- {
- buildResult.setBuildDefinition( buildDefinition );
- buildResult.setBuildNumber( buildNumber );
- buildResult.setModifiedDependencies( getModifiedDependencies( oldBuildResult, context ) );
- buildResult.setScmResult( getScmResult( context ) );
-
- Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
- if ( date != null )
+ try
{
- buildResult.setLastChangedDate( date.getTime() );
+ if ( overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask() != null )
+ {
+ log.error( "Unable to remove build agent because it is currently being used" );
+ throw new ContinuumException( "Unable to remove build agent because it is currently being used" );
+ }
+
+ tasks = overallDistributedBuildQueue.getProjectsInQueue();
+
+ overallDistributedBuildQueue.getDistributedBuildQueue().removeAll( tasks );
+
+ ( (ThreadedDistributedBuildTaskQueueExecutor) overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor() ).stop();
+
+ container.release( overallDistributedBuildQueue );
+
+ overallDistributedBuildQueues.remove( buildAgentUrl );
+
+ log.info( "remove distributed build queue for build agent '" + buildAgentUrl + "'" );
}
- else if ( oldBuildResult != null )
+ catch ( TaskQueueException e )
{
- buildResult.setLastChangedDate( oldBuildResult.getLastChangedDate() );
+ log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
}
-
- buildResultDao.addBuildResult( project, buildResult );
-
- project.setOldState( project.getState() );
- project.setState( ContinuumBuildConstant.getBuildState( context ) );
- project.setBuildNumber( buildNumber );
- project.setLatestBuildId( buildResult.getId() );
+ catch ( ComponentLifecycleException e )
+ {
+ log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
+ }
+ catch ( StoppingException e )
+ {
+ log.error( "Error occurred while removing build agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while removing build agent " + buildAgentUrl, e );
+ }
}
- else
- {
- project.setState( project.getOldState() );
- project.setOldState( 0 );
- }
-
- projectDao.updateProject( project );
-
- File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(), project.getId() );
-
- FileWriter fstream = new FileWriter( buildOutputFile );
- BufferedWriter out = new BufferedWriter( fstream );
- out.write( ContinuumBuildConstant.getBuildOutput( context ) == null ? ""
- : ContinuumBuildConstant.getBuildOutput( context ) );
- out.close();
-
- if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
- {
- notifierDispatcher.buildComplete( project, buildDefinition, buildResult );
- }
- }
- catch ( ContinuumStoreException e )
- {
- throw new ContinuumException( "Error while updating build result for project", e );
- }
- catch ( ConfigurationException e )
- {
- throw new ContinuumException( "Error retrieving build output file", e );
- }
- catch ( IOException e )
- {
- throw new ContinuumException( "Error while writing build output to file", e );
}
}
- public void prepareBuildFinished( Map<String, Object> context )
+ public Map<String, List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue()
throws ContinuumException
{
- int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
- String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
+ Map<String, List<PrepareBuildProjectsTask>> map = new HashMap<String, List<PrepareBuildProjectsTask>>();
- try
+ synchronized( overallDistributedBuildQueues )
{
- ProjectScmRoot scmRoot =
- projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
-
- String error = ContinuumBuildConstant.getScmError( context );
-
- if ( StringUtils.isEmpty( error ) )
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
{
- scmRoot.setState( ContinuumProjectState.UPDATED );
- }
- else
- {
- scmRoot.setState( ContinuumProjectState.ERROR );
- scmRoot.setError( error );
- }
+ List<PrepareBuildProjectsTask> tasks = new ArrayList<PrepareBuildProjectsTask>();
- projectScmRootDao.updateProjectScmRoot( scmRoot );
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
- notifierDispatcher.prepareBuildComplete( scmRoot );
- }
- catch ( ContinuumStoreException e )
- {
- throw new ContinuumException( "Error while updating project scm root '" + scmRootAddress + "'", e );
- }
- }
-
- public Map<String, PrepareBuildProjectsTask> getDistributedBuildProjects()
- {
- Map<String, PrepareBuildProjectsTask> map = new HashMap<String, PrepareBuildProjectsTask>();
-
- for ( String url : taskQueueExecutors.keySet() )
- {
- DistributedBuildTaskQueueExecutor taskQueueExecutor = taskQueueExecutors.get( url );
-
- if ( taskQueueExecutor.getCurrentTask() != null )
- {
- PrepareBuildProjectsTask task = (PrepareBuildProjectsTask) taskQueueExecutor.getCurrentTask();
-
- map.put( url, task );
+ List<Map<String, Object>> projects = client.getProjectsInPrepareBuildQueue();
+
+ for ( Map<String, Object> context : projects )
+ {
+ tasks.add( getPrepareBuildProjectsTask( context ) );
+ }
+
+ map.put( buildAgentUrl, tasks );
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error while retrieving projects in prepare build queue", e );
+ }
}
}
+ // call reload in case we disable a build agent
+ reload();
+
return map;
}
- public List<Installation> getAvailableInstallations( String buildAgentUrl )
+ public Map<String, PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
throws ContinuumException
{
- List<Installation> installations = new ArrayList<Installation>();
+ Map<String, PrepareBuildProjectsTask> map = new HashMap<String, PrepareBuildProjectsTask>();
- try
+ synchronized( overallDistributedBuildQueues )
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
-
- List<Map<String, String>> installationsList = client.getAvailableInstallations();
-
- for ( Map context : installationsList )
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
{
- Installation installation = new Installation();
- installation.setName( ContinuumBuildConstant.getInstallationName( context ) );
- installation.setType( ContinuumBuildConstant.getInstallationType( context ) );
- installation.setVarName( ContinuumBuildConstant.getInstallationVarName( context ) );
- installation.setVarValue( ContinuumBuildConstant.getInstallationVarValue( context ) );
- installations.add( installation );
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ Map<String, Object> project = client.getProjectCurrentlyPreparingBuild();
+
+ if ( !project.isEmpty() )
+ {
+ map.put( buildAgentUrl, getPrepareBuildProjectsTask( project ) );
+ }
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error retrieving projects currently preparing build in " + buildAgentUrl, e );
+ }
+ }
+ }
+
+ // call reload in case we disable a build agent
+ reload();
+
+ return map;
+ }
+
+ public Map<String, BuildProjectTask> getProjectsCurrentlyBuilding()
+ throws ContinuumException
+ {
+ Map<String, BuildProjectTask> map = new HashMap<String, BuildProjectTask>();
+
+ synchronized( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ Map<String, Object> project = client.getProjectCurrentlyBuilding();
+
+ if ( !project.isEmpty() )
+ {
+ map.put( buildAgentUrl, getBuildProjectTask( project ) );
+ }
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error retrieving projects currently building in " + buildAgentUrl, e );
+ }
+ }
+ }
+
+ // call reload in case we disable a build agent
+ reload();
+
+ return map;
+ }
+
+ public Map<String, List<BuildProjectTask>> getProjectsInBuildQueue()
+ throws ContinuumException
+ {
+ Map<String, List<BuildProjectTask>> map = new HashMap<String, List<BuildProjectTask>>();
+
+ synchronized( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ List<BuildProjectTask> tasks = new ArrayList<BuildProjectTask>();
+
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ List<Map<String, Object>> projects = client.getProjectsInBuildQueue();
+
+ for ( Map<String, Object> context : projects )
+ {
+ tasks.add( getBuildProjectTask( context ) );
+ }
+
+ map.put( buildAgentUrl, tasks );
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error while retrieving projects in build queue", e );
+ }
+ }
+ }
+
+ // call reload in case we disable a build agent
+ reload();
+
+ return map;
+ }
+
+ public boolean isBuildAgentBusy( String buildAgentUrl )
+ {
+ synchronized ( overallDistributedBuildQueues )
+ {
+ OverallDistributedBuildQueue overallDistributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
+
+ if ( overallDistributedBuildQueue != null &&
+ overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask() != null )
+ {
+ log.info( "build agent '" + buildAgentUrl + "' is busy" );
+ return true;
}
- return installations;
+ log.info( "build agent '" + buildAgentUrl + "' is not busy" );
+ return false;
+ }
+ }
+
+ public void cancelDistributedBuild( String buildAgentUrl )
+ throws ContinuumException
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+
+ client.cancelBuild();
+ }
+
+ // call reload in case we disable the build agent
+ reload();
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Error cancelling build in build agent: Invalid build agent url " + buildAgentUrl );
+ throw new ContinuumException( "Error cancelling build in build agent: Invalid build agent url " + buildAgentUrl );
}
catch ( Exception e )
{
- throw new ContinuumException( "Unable to get available installations of build agent", e );
- }
- }
-
- public void startProjectBuild( int projectId )
- throws ContinuumException
- {
- try
- {
- Project project = projectDao.getProject( projectId );
- project.setState( ContinuumProjectState.BUILDING );
- projectDao.updateProject( project );
- }
- catch ( ContinuumStoreException e )
- {
- log.error( "Error while updating project's state", e );
- throw new ContinuumException( "Error while updating project's state", e );
- }
- }
-
- public void startPrepareBuild( Map<String, Object> context )
- throws ContinuumException
- {
- try
- {
- int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
- String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
-
- ProjectScmRoot scmRoot =
- projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
- scmRoot.setOldState( scmRoot.getState() );
- scmRoot.setState( ContinuumProjectState.UPDATING );
- projectScmRootDao.updateProjectScmRoot( scmRoot );
- }
- catch ( ContinuumStoreException e )
- {
- log.error( "Error while updating project scm root's state", e );
- throw new ContinuumException( "Error while updating project scm root's state", e );
+ log.error( "Error occurred while cancelling build in build agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while cancelling build in build agent " + buildAgentUrl, e );
}
}
@@ -567,30 +551,33 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
-
- Map result = client.getBuildResult( projectId );
-
- if ( result != null )
+ if ( isAgentAvailable( buildAgentUrl ) )
{
- int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( result );
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
- Project project = projectDao.getProjectWithAllDetails( projectId );
- BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+ Map<String, Object> result = client.getBuildResult( projectId );
- BuildResult oldBuildResult =
- buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
+ if ( result != null )
+ {
+ int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( result );
- BuildResult buildResult = convertMapToBuildResult( result );
- buildResult.setBuildDefinition( buildDefinition );
- buildResult.setBuildNumber( project.getBuildNumber() + 1 );
- buildResult.setModifiedDependencies( getModifiedDependencies( oldBuildResult, result ) );
- buildResult.setScmResult( getScmResult( result ) );
+ Project project = projectDao.getProjectWithAllDetails( projectId );
+ BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
- String buildOutput = ContinuumBuildConstant.getBuildOutput( result );
+ BuildResult oldBuildResult =
+ buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
- map.put( ContinuumBuildConstant.KEY_BUILD_RESULT, buildResult );
- map.put( ContinuumBuildConstant.KEY_BUILD_OUTPUT, buildOutput );
+ BuildResult buildResult = distributedBuildUtil.convertMapToBuildResult( result );
+ buildResult.setBuildDefinition( buildDefinition );
+ buildResult.setBuildNumber( project.getBuildNumber() + 1 );
+ buildResult.setModifiedDependencies( distributedBuildUtil.getModifiedDependencies( oldBuildResult, result ) );
+ buildResult.setScmResult( distributedBuildUtil.getScmResult( result ) );
+
+ String buildOutput = ContinuumBuildConstant.getBuildOutput( result );
+
+ map.put( ContinuumBuildConstant.KEY_BUILD_RESULT, buildResult );
+ map.put( ContinuumBuildConstant.KEY_BUILD_OUTPUT, buildOutput );
+ }
}
}
catch ( MalformedURLException e )
@@ -602,92 +589,44 @@
throw new ContinuumException( "Error while retrieving build result for project" + projectId, e );
}
+ // call reload in case we disable the build agent
+ reload();
+
return map;
}
- public Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+ public List<Installation> getAvailableInstallations( String buildAgentUrl )
throws ContinuumException
{
- BuildDefinition buildDefinition;
+ List<Installation> installations = new ArrayList<Installation>();
try
{
- buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
- }
- catch ( ContinuumStoreException e )
- {
- throw new ContinuumException( "Failed to retrieve build definition: " + buildDefinitionId, e );
- }
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
- Profile profile = buildDefinition.getProfile();
- if ( profile == null )
- {
- return Collections.EMPTY_MAP;
- }
- Map<String, String> envVars = new HashMap<String, String>();
- String javaHome = getJavaHomeValue( buildDefinition );
- if ( !StringUtils.isEmpty( javaHome ) )
- {
- envVars.put( installationService.getEnvVar( InstallationService.JDK_TYPE ), javaHome );
- }
- Installation builder = profile.getBuilder();
- if ( builder != null )
- {
- envVars.put( installationService.getEnvVar( installationType ), builder.getVarValue() );
- }
- envVars.putAll( getEnvironmentVariables( buildDefinition ) );
- return envVars;
- }
+ List<Map<String, String>> installationsList = client.getAvailableInstallations();
- public void updateProject( Map<String, Object> context )
- throws ContinuumException
- {
- try
- {
- Project project = projectDao.getProject( ContinuumBuildConstant.getProjectId( context ) );
+ for ( Map context : installationsList )
+ {
+ Installation installation = new Installation();
+ installation.setName( ContinuumBuildConstant.getInstallationName( context ) );
+ installation.setType( ContinuumBuildConstant.getInstallationType( context ) );
+ installation.setVarName( ContinuumBuildConstant.getInstallationVarName( context ) );
+ installation.setVarValue( ContinuumBuildConstant.getInstallationVarValue( context ) );
+ installations.add( installation );
+ }
+ }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getGroupId( context ) ) )
- {
- project.setGroupId( ContinuumBuildConstant.getGroupId( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getArtifactId( context ) ) )
- {
- project.setArtifactId( ContinuumBuildConstant.getArtifactId( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getVersion( context ) ) )
- {
- project.setVersion( ContinuumBuildConstant.getVersion( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectName( context ) ) )
- {
- project.setName( ContinuumBuildConstant.getProjectName( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectDescription( context ) ) )
- {
- project.setDescription( ContinuumBuildConstant.getProjectDescription( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getProjectUrl( context ) ) )
- {
- project.setUrl( ContinuumBuildConstant.getProjectUrl( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getScmUrl( context ) ) )
- {
- project.setScmUrl( ContinuumBuildConstant.getScmUrl( context ) );
- }
- if ( StringUtils.isNotBlank( ContinuumBuildConstant.getScmTag( context ) ) )
- {
- project.setScmTag( ContinuumBuildConstant.getScmTag( context ) );
- }
- project.setParent( getProjectParent( context ) );
- project.setDependencies( getProjectDependencies( context ) );
- project.setDevelopers( getProjectDevelopers( context ) );
- project.setNotifiers( getProjectNotifiers( context ) );
+ // call reload in case we disable the build agent
+ reload();
- projectDao.updateProject( project );
+ return installations;
}
- catch ( ContinuumStoreException e )
+ catch ( Exception e )
{
- throw new ContinuumException( "Unable to update project from working copy", e );
+ throw new ContinuumException( "Unable to get available installations of build agent", e );
}
}
@@ -712,8 +651,11 @@
directory = "";
}
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.generateWorkingCopyContent( projectId, directory, baseUrl, imageBaseUrl );
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ return client.generateWorkingCopyContent( projectId, directory, baseUrl, imageBaseUrl );
+ }
}
catch ( MalformedURLException e )
{
@@ -724,9 +666,13 @@
log.error( "Error while generating working copy content from build agent " + buildAgentUrl, e );
}
}
+
+ // call reload in case we disable the build agent
+ reload();
+
return "";
}
-
+
public String getFileContent( int projectId, String directory, String filename )
throws ContinuumException
{
@@ -743,8 +689,11 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.getProjectFileContent( projectId, directory, filename );
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ return client.getProjectFileContent( projectId, directory, filename );
+ }
}
catch ( MalformedURLException e )
{
@@ -755,332 +704,370 @@
log.error( "Error while retrieving content of " + filename, e );
}
}
+
+ // call reload in case we disable the build agent
+ reload();
+
return "";
}
- public boolean shouldBuild( Map<String, Object> context )
+ public void removeFromPrepareBuildQueue( String buildAgentUrl, int projectGroupId, int scmRootId )
+ throws ContinuumException
{
try
{
- int projectId = ContinuumBuildConstant.getProjectId( context );
-
- int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
-
- int trigger = ContinuumBuildConstant.getTrigger( context );
-
- Project project = projectDao.getProjectWithAllDetails( projectId );
-
- BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-
- BuildResult oldBuildResult =
- buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
-
- List<ProjectDependency> modifiedDependencies = getModifiedDependencies( oldBuildResult, context );
-
- List<ChangeSet> changes = getScmChanges( context );
-
- if ( buildDefinition.isBuildFresh() )
+ if ( isAgentAvailable( buildAgentUrl ) )
{
- log.info( "FreshBuild configured, building" );
- return true;
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ client.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
}
- if ( buildDefinition.isAlwaysBuild() )
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Unable to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+ " from prepare build queue: Invalid build agent url " + buildAgentUrl );
+ throw new ContinuumException( "Unable to remove projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+ " from prepare build queue: Invalid build agent url " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error occurred while removing projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId +
+ " from prepare build queue of agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while removing projectGroupId=" + projectGroupId + " scmRootId=" +
+ scmRootId + " from prepare build queue of agent " + buildAgentUrl, e );
+ }
+
+ // call reload in case we disable the build agent
+ reload();
+ }
+
+ public void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId )
+ throws ContinuumException
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
{
- log.info( "AlwaysBuild configured, building" );
- return true;
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ client.removeFromBuildQueue( projectId, buildDefinitionId );
}
- if ( oldBuildResult == null )
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Unable to remove project " + projectId +
+ " from build queue: Invalid build agent url " + buildAgentUrl );
+ throw new ContinuumException( "Unable to remove project " + projectId +
+ " from build queue: Invalid build agent url " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error occurred while removing project " + projectId +
+ " from build queue of agent " + buildAgentUrl, e );
+ throw new ContinuumException( "Error occurred while removing project " + projectId +
+ " from build queue of agent " + buildAgentUrl, e );
+ }
+
+ // call reload in case we disable the build agent
+ reload();
+ }
+
+ public void removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws ContinuumException
+ {
+ synchronized ( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
{
- log.info( "The project was never be built with the current build definition, building" );
- return true;
- }
-
- //CONTINUUM-1428
- if ( project.getOldState() == ContinuumProjectState.ERROR ||
- oldBuildResult.getState() == ContinuumProjectState.ERROR )
- {
- log.info( "Latest state was 'ERROR', building" );
- return true;
- }
-
- if ( trigger == ContinuumProjectState.TRIGGER_FORCED )
- {
- log.info( "The project build is forced, building" );
- return true;
- }
-
- Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
- if ( date != null && oldBuildResult.getLastChangedDate() >= date.getTime() )
- {
- log.info( "No changes found,not building" );
- return false;
- }
- else if ( date != null && changes.isEmpty() )
- {
- // fresh checkout from build agent that's why changes is empty
- log.info( "Changes found in the current project, building" );
- return true;
- }
-
- boolean shouldBuild = false;
-
- boolean allChangesUnknown = true;
-
- if ( project.getOldState() != ContinuumProjectState.NEW &&
- project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
- project.getState() != ContinuumProjectState.NEW &&
- project.getState() != ContinuumProjectState.CHECKEDOUT )
- {
- // Check SCM changes
- allChangesUnknown = checkAllChangesUnknown( changes );
-
- if ( allChangesUnknown )
+ try
{
- if ( !changes.isEmpty() )
+ if ( isAgentAvailable( buildAgentUrl ) )
{
- log.info(
- "The project was not built because all changes are unknown (maybe local modifications or ignored files not defined in your SCM tool." );
- }
- else
- {
- log.info(
- "The project was not built because no changes were detected in sources since the last build." );
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ client.removeFromPrepareBuildQueue( hashCodes );
}
}
-
- // Check dependencies changes
- if ( modifiedDependencies != null && !modifiedDependencies.isEmpty() )
+ catch ( MalformedURLException e )
{
- log.info( "Found dependencies changes, building" );
- shouldBuild = true;
+ log.error( "Error trying to remove projects from prepare build queue. Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error trying to remove projects from prepare build queue of agent " + buildAgentUrl, e );
}
}
-
- // Check changes
- if ( !shouldBuild && ( ( !allChangesUnknown && !changes.isEmpty() ) ||
- project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
- {
- shouldBuild = shouldBuild( changes, buildDefinition, project, getMavenProjectVersion( context ),
- getMavenProjectModules( context ) );
- }
-
- if ( shouldBuild )
- {
- log.info( "Changes found in the current project, building" );
- }
- else
- {
- log.info( "No changes in the current project, not building" );
- }
-
- return shouldBuild;
}
- catch ( ContinuumStoreException e )
+
+ // call reload in case we disable a build agent
+ reload();
+ }
+
+ public void removeFromBuildQueue( List<String> hashCodes )
+ throws ContinuumException
+ {
+ synchronized ( overallDistributedBuildQueues )
{
- log.error( "Failed to determine if project should build", e );
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ client.removeFromBuildQueue( hashCodes );
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Error trying to remove projects from build queue. Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error trying to remove projects from build queue of agent " + buildAgentUrl, e );
+ }
+ }
}
- catch ( ContinuumException e )
+
+ // call reload in case we disable a build agent
+ reload();
+ }
+
+ public boolean isProjectInAnyPrepareBuildQueue( int projectId, int buildDefinitionId )
+ throws ContinuumException
+ {
+ boolean found = false;
+
+ synchronized( overallDistributedBuildQueues )
{
- log.error( "Failed to determine if project should build", e );
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+
+ List<Map<String, Object>> projects = client.getProjectsAndBuildDefinitionsInPrepareBuildQueue();
+
+ for ( Map<String, Object> context : projects )
+ {
+ int pid = ContinuumBuildConstant.getProjectId( context );
+ int buildId = ContinuumBuildConstant.getBuildDefinitionId( context );
+
+ if ( pid == projectId && buildId == buildDefinitionId )
+ {
+ found = true;
+ break;
+ }
+
+ }
+ }
+
+ if ( found )
+ {
+ break;
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error while retrieving projects in prepare build queue", e );
+ }
+ }
+ }
+
+ // call reload in case we disable a build agent
+ reload();
+
+ if ( found )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public boolean isProjectInAnyBuildQueue( int projectId, int buildDefinitionId )
+ throws ContinuumException
+ {
+ Map<String, List<BuildProjectTask>> map = getProjectsInBuildQueue();
+
+ for ( String url : map.keySet() )
+ {
+ for ( BuildProjectTask task : map.get( url ) )
+ {
+ if ( task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
+ {
+ return true;
+ }
+ }
}
return false;
}
- private boolean shouldBuild( List<ChangeSet> changes, BuildDefinition buildDefinition, Project project,
- String mavenProjectVersion, List<String> mavenProjectModules )
- {
- //Check if it's a recursive build
- boolean isRecursive = false;
- if ( StringUtils.isNotEmpty( buildDefinition.getArguments() ) )
- {
- isRecursive = buildDefinition.getArguments().indexOf( "-N" ) < 0 &&
- buildDefinition.getArguments().indexOf( "--non-recursive" ) < 0;
- }
-
- if ( isRecursive && changes != null && !changes.isEmpty() )
- {
- if ( log.isInfoEnabled() )
- {
- log.info( "recursive build and changes found --> building" );
- }
- return true;
- }
-
- if ( !project.getVersion().equals( mavenProjectVersion ) )
- {
- log.info( "Found changes in project's version ( maybe project was recently released ), building" );
- return true;
- }
-
- if ( changes == null || changes.isEmpty() )
- {
- if ( log.isInfoEnabled() )
- {
- log.info( "Found no changes, not building" );
- }
- return false;
- }
-
- //check if changes are only in sub-modules or not
- List<ChangeFile> files = new ArrayList<ChangeFile>();
- for ( ChangeSet changeSet : changes )
- {
- files.addAll( changeSet.getFiles() );
- }
-
- int i = 0;
- while ( i <= files.size() - 1 )
- {
- ChangeFile file = files.get( i );
- if ( log.isDebugEnabled() )
- {
- log.debug( "changeFile.name " + file.getName() );
- log.debug( "check in modules " + mavenProjectModules );
- }
- boolean found = false;
- if ( mavenProjectModules != null )
- {
- for ( String module : mavenProjectModules )
- {
- if ( file.getName().indexOf( module ) >= 0 )
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( "changeFile.name " + file.getName() + " removed because in a module" );
- }
- files.remove( file );
- found = true;
- break;
- }
- if ( log.isDebugEnabled() )
- {
- log.debug( "not removing file " + file.getName() + " not in module " + module );
- }
- }
- }
- if ( !found )
- {
- i++;
- }
- }
-
- boolean shouldBuild = !files.isEmpty();
-
- if ( !shouldBuild )
- {
- log.info( "Changes are only in sub-modules." );
- }
-
- if ( log.isDebugEnabled() )
- {
- log.debug( "shoulbuild = " + shouldBuild );
- }
-
- return shouldBuild;
- }
-
- private boolean checkAllChangesUnknown( List<ChangeSet> changes )
- {
- for ( ChangeSet changeSet : changes )
- {
- List<ChangeFile> changeFiles = changeSet.getFiles();
-
- for ( ChangeFile changeFile : changeFiles )
- {
- if ( !"unknown".equalsIgnoreCase( changeFile.getStatus() ) )
- {
- return false;
- }
- }
- }
-
- return true;
- }
-
- private List<ProjectDependency> getModifiedDependencies( BuildResult oldBuildResult, Map<String, Object> context )
+ public boolean isProjectCurrentlyPreparingBuild( int projectId, int buildDefinitionId )
throws ContinuumException
{
- if ( oldBuildResult == null )
+ boolean found = false;
+
+ synchronized( overallDistributedBuildQueues )
{
- return null;
- }
-
- try
- {
- Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId( context ) );
- List<ProjectDependency> dependencies = project.getDependencies();
-
- if ( dependencies == null )
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
{
- dependencies = new ArrayList<ProjectDependency>();
- }
-
- if ( project.getParent() != null )
- {
- dependencies.add( project.getParent() );
- }
-
- if ( dependencies.isEmpty() )
- {
- return null;
- }
-
- List<ProjectDependency> modifiedDependencies = new ArrayList<ProjectDependency>();
-
- for ( ProjectDependency dep : dependencies )
- {
- Project dependencyProject =
- projectDao.getProject( dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );
-
- if ( dependencyProject != null )
+ try
{
- List<BuildResult> buildResults =
- buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
- oldBuildResult.getEndTime() );
- if ( buildResults != null && !buildResults.isEmpty() )
+ if ( isAgentAvailable( buildAgentUrl ) )
{
- log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
- dep.getVersion() );
- modifiedDependencies.add( dep );
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ List<Map<String, Object>> projects = client.getProjectsAndBuildDefinitionsCurrentlyPreparingBuild();
+
+ for ( Map<String, Object> context : projects )
+ {
+ int pid = ContinuumBuildConstant.getProjectId( context );
+ int buildId = ContinuumBuildConstant.getBuildDefinitionId( context );
+
+ if ( pid == projectId && buildId == buildDefinitionId )
+ {
+ found = true;
+ break;
+ }
+ }
}
- else
+
+ if ( found )
{
- log.debug( "Dependency not changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
- dep.getVersion() );
+ break;
}
}
- else
+ catch ( MalformedURLException e )
{
- log.debug( "Skip non Continuum project: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
- dep.getVersion() );
+ throw new ContinuumException( "Invalid build agent url: " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Error retrieving projects currently preparing build in " + buildAgentUrl, e );
}
}
-
- return modifiedDependencies;
}
- catch ( ContinuumStoreException e )
+
+ // call reload in case we disable a build agent
+ reload();
+
+ if ( found )
{
- log.warn( "Can't get the project dependencies", e );
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public boolean isProjectCurrentlyBuilding( int projectId, int buildDefinitionId )
+ throws ContinuumException
+ {
+ Map<String, BuildProjectTask> map = getProjectsCurrentlyBuilding();
+
+ for ( String url : map.keySet() )
+ {
+ BuildProjectTask task = map.get( url );
+
+ if ( task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
+ {
+ return true;
+ }
}
- return null;
+ return false;
}
private String getBuildAgent( int projectId )
throws ContinuumException
{
- Map<String, PrepareBuildProjectsTask> map = getDistributedBuildProjects();
+ String agentUrl = null;
- for ( String url : map.keySet() )
+ synchronized( overallDistributedBuildQueues )
{
- PrepareBuildProjectsTask task = map.get( url );
-
- for ( Integer id : task.getProjectsBuildDefinitionsMap().keySet() )
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
{
- if ( projectId == id )
+ OverallDistributedBuildQueue overallDistributedBuildQueue =
+ overallDistributedBuildQueues.get( buildAgentUrl );
+
+ if ( overallDistributedBuildQueue != null )
{
- return url;
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+
+ if ( client.isProjectCurrentlyBuilding( projectId ) )
+ {
+ agentUrl = buildAgentUrl;
+ break;
+ }
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ log.warn( "Unable to check if project " + projectId + " is currently building in agent: Invalid build agent url" + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.warn( "Unable to check if project " + projectId + " is currently building in agent", e );
+ }
+ }
+ }
+ }
+
+ // call reload in case we disable a build agent
+ reload();
+
+ return agentUrl;
+ }
+
+ private void createDistributedBuildQueueForAgent( String buildAgentUrl )
+ throws ComponentLookupException
+ {
+ if ( !overallDistributedBuildQueues.containsKey( buildAgentUrl ) )
+ {
+ OverallDistributedBuildQueue overallDistributedBuildQueue =
+ (OverallDistributedBuildQueue) container.lookup( OverallDistributedBuildQueue.class );
+ overallDistributedBuildQueue.setBuildAgentUrl( buildAgentUrl );
+ overallDistributedBuildQueue.getDistributedBuildTaskQueueExecutor().setBuildAgentUrl( buildAgentUrl );
+
+ overallDistributedBuildQueues.put( buildAgentUrl, overallDistributedBuildQueue );
+ }
+ }
+
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueueByGroupAndScmRoot( int projectGroupId, int scmRootId )
+ throws ContinuumException
+ {
+ synchronized( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
+
+ try
+ {
+ for ( PrepareBuildProjectsTask task : distributedBuildQueue.getProjectsInQueue() )
+ {
+ if ( task.getProjectGroupId() == projectGroupId && task.getProjectScmRootId() == scmRootId )
+ {
+ return distributedBuildQueue;
+ }
+ }
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue of projectGroupId=" + projectGroupId + " scmRootId=" + scmRootId, e );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue of group", e );
}
}
}
@@ -1088,228 +1075,426 @@
return null;
}
- private BuildResult convertMapToBuildResult( Map<String, Object> context )
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueueByScmRoot( ProjectScmRoot scmRoot, int projectGroupId )
+ throws ContinuumException
{
- BuildResult buildResult = new BuildResult();
+ int scmRootId = scmRoot.getId();
- buildResult.setStartTime( ContinuumBuildConstant.getStartTime( context ) );
- buildResult.setEndTime( ContinuumBuildConstant.getEndTime( context ) );
- buildResult.setError( ContinuumBuildConstant.getBuildError( context ) );
- buildResult.setExitCode( ContinuumBuildConstant.getBuildExitCode( context ) );
- buildResult.setState( ContinuumBuildConstant.getBuildState( context ) );
- buildResult.setTrigger( ContinuumBuildConstant.getTrigger( context ) );
- buildResult.setBuildUrl( ContinuumBuildConstant.getBuildAgentUrl( context ) );
+ synchronized( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
- return buildResult;
+ try
+ {
+ for ( PrepareBuildProjectsTask task : distributedBuildQueue.getProjectsInQueue() )
+ {
+ if ( task.getProjectScmRootId() == scmRootId )
+ {
+ return distributedBuildQueue;
+ }
+ }
+
+ Task task = distributedBuildQueue.getDistributedBuildTaskQueueExecutor().getCurrentTask();
+ if ( task != null && ( (PrepareBuildProjectsTask) task ).getProjectScmRootId() == scmRootId )
+ {
+ return distributedBuildQueue;
+ }
+
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ List<Project> projects = projectDao.getProjectsInGroup( projectGroupId );
+ List<Integer> pIds = new ArrayList<Integer>();
+
+ for ( Project project : projects )
+ {
+ if ( project.getScmUrl().startsWith( scmRoot.getScmRootAddress() ) )
+ {
+ pIds.add( project.getId() );
+ }
+ }
+
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+
+ if ( client.isProjectScmRootInQueue( scmRootId, pIds ) )
+ {
+ return distributedBuildQueue;
+ }
+ }
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue of scmRootId=" + scmRootId, e );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue of scmRoot", e );
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue of scmRootId=" + scmRootId +
+ ": Invalid build agent url " + buildAgentUrl );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue of scmRootId=" + scmRootId +
+ ": Invalid build agent url " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue of scmRootId=" + scmRootId, e );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue of scmRoot", e );
+ }
+ }
+ }
+
+ return null;
}
- private String getJavaHomeValue( BuildDefinition buildDefinition )
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueueByGroup( int projectGroupId, List<ProjectScmRoot> scmRoots, int scmRootId )
+ throws ContinuumException
{
- Profile profile = buildDefinition.getProfile();
- if ( profile == null )
+ if ( scmRoots != null )
+ {
+ for ( ProjectScmRoot scmRoot : scmRoots )
+ {
+ if ( scmRoot.getId() == scmRootId )
+ {
+ break;
+ }
+ else if ( scmRoot.getProjectGroup().getId() == projectGroupId )
+ {
+ return getOverallDistributedBuildQueueByScmRoot( scmRoot, projectGroupId );
+ }
+ }
+ }
+ return null;
+ }
+
+ // need to change this
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueueByHashCode( int hashCode )
+ throws ContinuumException
+ {
+ synchronized( overallDistributedBuildQueues )
+ {
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
+
+ try
+ {
+ for ( PrepareBuildProjectsTask task : distributedBuildQueue.getProjectsInQueue() )
+ {
+ if ( task.getHashCode() == hashCode )
+ {
+ return distributedBuildQueue;
+ }
+ }
+ }
+ catch ( TaskQueueException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue", e );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue", e );
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueueByAgentGroup( Map<Integer, Integer> projectsAndBuildDefinitionsMap )
+ throws ContinuumException
+ {
+ OverallDistributedBuildQueue whereToBeQueued = null;
+
+ BuildAgentGroupConfiguration buildAgentGroup = getBuildAgentGroup( projectsAndBuildDefinitionsMap );
+
+ if ( buildAgentGroup != null )
+ {
+ List<BuildAgentConfiguration> buildAgents = buildAgentGroup.getBuildAgents();
+
+ if ( buildAgents != null && buildAgents.size() > 0 )
+ {
+ List<String> buildAgentUrls = new ArrayList<String>();
+
+ for ( BuildAgentConfiguration buildAgent : buildAgents )
+ {
+ buildAgentUrls.add( buildAgent.getUrl() );
+ }
+
+ synchronized( overallDistributedBuildQueues )
+ {
+ int idx = 0;
+ int size = 0;
+
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ if ( !buildAgentUrls.isEmpty() && buildAgentUrls.contains( buildAgentUrl ) )
+ {
+ OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
+
+ if ( distributedBuildQueue != null )
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ int agentBuildSize = client.getBuildSizeOfAgent();
+
+ if ( idx == 0 )
+ {
+ whereToBeQueued = distributedBuildQueue;
+ size = agentBuildSize;
+ idx++;
+ }
+
+ if ( agentBuildSize < size )
+ {
+ whereToBeQueued = distributedBuildQueue;
+ size = agentBuildSize;
+ }
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue: Invalid build agent url " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue ", e );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return whereToBeQueued;
+ }
+
+ private OverallDistributedBuildQueue getOverallDistributedBuildQueue()
+ throws ContinuumException
+ {
+ OverallDistributedBuildQueue whereToBeQueued = null;
+
+ synchronized ( overallDistributedBuildQueues )
+ {
+ if ( overallDistributedBuildQueues.isEmpty() )
+ {
+ log.info( "No distributed build queues are configured for build agents" );
+ return null;
+ }
+
+ int idx = 0;
+ int size = 0;
+
+ for ( String buildAgentUrl : overallDistributedBuildQueues.keySet() )
+ {
+ OverallDistributedBuildQueue distributedBuildQueue = overallDistributedBuildQueues.get( buildAgentUrl );
+
+ if ( distributedBuildQueue != null )
+ {
+ try
+ {
+ if ( isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
+ int agentBuildSize = client.getBuildSizeOfAgent();
+
+ if ( idx == 0 )
+ {
+ whereToBeQueued = distributedBuildQueue;
+ size = agentBuildSize;
+ idx++;
+ }
+
+ if ( agentBuildSize < size )
+ {
+ whereToBeQueued = distributedBuildQueue;
+ size = agentBuildSize;
+ }
+ }
+ }
+ catch ( MalformedURLException e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue: invalid build agent url " + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Error occurred while retrieving distributed build queue", e );
+ throw new ContinuumException( "Error occurred while retrieving distributed build queue", e );
+ }
+ }
+ }
+ }
+
+ return whereToBeQueued;
+ }
+
+ private BuildAgentGroupConfiguration getBuildAgentGroup( Map<Integer, Integer> projectsAndBuildDefinitions )
+ throws ContinuumException
+ {
+ if ( projectsAndBuildDefinitions == null )
{
return null;
}
- Installation jdk = profile.getJdk();
- if ( jdk == null )
+
+ try
{
- return null;
- }
- return jdk.getVarValue();
- }
+ List<Project> projects = new ArrayList<Project>();
- private Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition )
- {
- Profile profile = buildDefinition.getProfile();
- Map<String, String> envVars = new HashMap<String, String>();
- if ( profile == null )
- {
- return envVars;
- }
- List<Installation> environmentVariables = profile.getEnvironmentVariables();
- if ( environmentVariables.isEmpty() )
- {
- return envVars;
- }
- for ( Installation installation : environmentVariables )
- {
- envVars.put( installation.getVarName(), installation.getVarValue() );
- }
- return envVars;
- }
-
- private List<ChangeSet> getScmChanges( Map<String, Object> context )
- {
- List<ChangeSet> changes = new ArrayList<ChangeSet>();
- List<Map> scmChanges = ContinuumBuildConstant.getScmChanges( context );
-
- if ( scmChanges != null )
- {
- for ( Map map : scmChanges )
+ for ( Integer projectId : projectsAndBuildDefinitions.keySet() )
{
- ChangeSet changeSet = new ChangeSet();
- changeSet.setAuthor( ContinuumBuildConstant.getChangeSetAuthor( map ) );
- changeSet.setComment( ContinuumBuildConstant.getChangeSetComment( map ) );
- changeSet.setDate( ContinuumBuildConstant.getChangeSetDate( map ) );
- setChangeFiles( changeSet, map );
- changes.add( changeSet );
+ projects.add( projectDao.getProjectWithDependencies( projectId ) );
+ }
+
+ projects = ProjectSorter.getSortedProjects( projects, log );
+
+ int buildDefinitionId = projectsAndBuildDefinitions.get( projects.get( 0 ).getId() );
+ BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+
+ Profile profile = buildDefinition.getProfile();
+
+ if ( profile != null && !StringUtils.isEmpty( profile.getBuildAgentGroup() ) )
+ {
+ String groupName = profile.getBuildAgentGroup();
+
+ BuildAgentGroupConfiguration buildAgentGroup = configurationService.getBuildAgentGroup( groupName );
+
+ return buildAgentGroup;
}
}
-
- return changes;
- }
-
- private void setChangeFiles( ChangeSet changeSet, Map<String, Object> context )
- {
- List<Map> changeFiles = ContinuumBuildConstant.getChangeSetFiles( context );
-
- if ( changeFiles != null )
+ catch ( ContinuumStoreException e )
{
- for ( Map map : changeFiles )
- {
- ChangeFile changeFile = new ChangeFile();
- changeFile.setName( ContinuumBuildConstant.getChangeFileName( map ) );
- changeFile.setRevision( ContinuumBuildConstant.getChangeFileRevision( map ) );
- changeFile.setStatus( ContinuumBuildConstant.getChangeFileStatus( map ) );
-
- changeSet.addFile( changeFile );
- }
+ log.error( "Error while getting build agent group", e );
+ throw new ContinuumException( "Error while getting build agent group", e );
}
- }
- private ProjectDependency getProjectParent( Map<String, Object> context )
- {
- Map map = ContinuumBuildConstant.getProjectParent( context );
-
- if ( map != null && map.size() > 0 )
- {
- ProjectDependency parent = new ProjectDependency();
- parent.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
- parent.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
- parent.setVersion( ContinuumBuildConstant.getVersion( map ) );
-
- return parent;
- }
+ log.info( "profile build agent group is null" );
return null;
}
-
- private List<ProjectDependency> getProjectDependencies( Map<String, Object> context )
+
+ private PrepareBuildProjectsTask getPrepareBuildProjectsTask( Map context )
{
- List<ProjectDependency> projectDependencies = new ArrayList<ProjectDependency>();
+ int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
+ int scmRootId = ContinuumBuildConstant.getScmRootId( context );
+ String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
+ BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );
- List<Map> dependencies = ContinuumBuildConstant.getProjectDependencies( context );
+ return new PrepareBuildProjectsTask( null, buildTrigger, projectGroupId, null, scmRootAddress, scmRootId );
+ }
- if ( dependencies != null )
+ private BuildProjectTask getBuildProjectTask( Map context )
+ {
+ int projectId = ContinuumBuildConstant.getProjectId( context );
+ int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
+ BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );
+ int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
+ String buildDefinitionLabel = ContinuumBuildConstant.getBuildDefinitionLabel( context );
+
+ return new BuildProjectTask( projectId, buildDefinitionId, buildTrigger, null, buildDefinitionLabel, null, projectGroupId );
+ }
+
+ public boolean isAgentAvailable( String buildAgentUrl )
+ throws ContinuumException
+ {
+ try
{
- for ( Map map : dependencies )
- {
- ProjectDependency dependency = new ProjectDependency();
- dependency.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
- dependency.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
- dependency.setVersion( ContinuumBuildConstant.getVersion( map ) );
+ SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
- projectDependencies.add( dependency );
+ return client.ping();
+ }
+ catch ( MalformedURLException e )
+ {
+ log.warn( "Invalid build agent url" + buildAgentUrl );
+ }
+ catch ( Exception e )
+ {
+ log.warn( "Unable to ping build agent: " + buildAgentUrl + "; disabling it..." );
+ }
+
+ // disable it
+ disableBuildAgent( buildAgentUrl );
+
+ return false;
+ }
+
+ private void disableBuildAgent( String buildAgentUrl )
+ throws ContinuumException
+ {
+ List<BuildAgentConfiguration> agents = configurationService.getBuildAgents();
+
+ for ( BuildAgentConfiguration agent : agents )
+ {
+ if ( agent.getUrl().equals( buildAgentUrl ) )
+ {
+ agent.setEnabled( false );
+ configurationService.updateBuildAgent( agent );
+
+ try
+ {
+ configurationService.store();
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumException( "Unable to disable build agent: " + buildAgentUrl, e );
+ }
}
}
- return projectDependencies;
}
-
- private List<ProjectDeveloper> getProjectDevelopers( Map<String, Object> context )
+
+ private boolean hasBuildagentGroup( Map<Integer, Integer> projectsAndBuildDefinitionsMap )
+ throws ContinuumException
{
- List<ProjectDeveloper> projectDevelopers = new ArrayList<ProjectDeveloper>();
+ BuildAgentGroupConfiguration buildAgentGroup = getBuildAgentGroup( projectsAndBuildDefinitionsMap );
- List<Map> developers = ContinuumBuildConstant.getProjectDevelopers( context );
-
- if ( developers != null )
- {
- for ( Map map : developers )
- {
- ProjectDeveloper developer = new ProjectDeveloper();
- developer.setName( ContinuumBuildConstant.getDeveloperName( map ) );
- developer.setEmail( ContinuumBuildConstant.getDeveloperEmail( map ) );
- developer.setScmId( ContinuumBuildConstant.getDeveloperScmId( map ) );
-
- projectDevelopers.add( developer );
- }
- }
- return projectDevelopers;
+ return buildAgentGroup != null &&
+ buildAgentGroup.getName().length() > 0 ? true : false;
}
-
- private List<ProjectNotifier> getProjectNotifiers( Map<String, Object> context )
+
+ private boolean hasBuildagentInGroup( Map<Integer, Integer> projectsAndBuildDefinitionsMap )
+ throws ContinuumException
{
- List<ProjectNotifier> projectNotifiers = new ArrayList<ProjectNotifier>();
+ BuildAgentGroupConfiguration buildAgentGroup = getBuildAgentGroup( projectsAndBuildDefinitionsMap );
- List<Map> notifiers = ContinuumBuildConstant.getProjectNotifiers( context );
-
- if ( notifiers != null )
- {
- for ( Map map : notifiers )
- {
- ProjectNotifier notifier = new ProjectNotifier();
- notifier.setConfiguration( ContinuumBuildConstant.getNotifierConfiguration( map ) );
- notifier.setEnabled( ContinuumBuildConstant.isNotifierEnabled( map ) );
- notifier.setFrom( ContinuumBuildConstant.getNotifierFrom( map ) );
- notifier.setRecipientType( ContinuumBuildConstant.getNotifierRecipientType( map ) );
- notifier.setSendOnError( ContinuumBuildConstant.isNotifierSendOnError( map ) );
- notifier.setSendOnFailure( ContinuumBuildConstant.isNotifierSendOnFailure( map ) );
- notifier.setSendOnScmFailure( ContinuumBuildConstant.isNotifierSendOnScmFailure( map ) );
- notifier.setSendOnSuccess( ContinuumBuildConstant.isNotifierSendOnSuccess( map ) );
- notifier.setSendOnWarning( ContinuumBuildConstant.isNotifierSendOnWarning( map ) );
- notifier.setType( ContinuumBuildConstant.getNotifierType( map ) );
-
- projectNotifiers.add( notifier );
- }
- }
- return projectNotifiers;
+ return buildAgentGroup != null &&
+ buildAgentGroup.getBuildAgents().size() > 0 ? true : false;
}
- private ScmResult getScmResult( Map<String, Object> context )
+ public SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection( String buildAgentUrl )
+ throws MalformedURLException, Exception
{
- Map map = ContinuumBuildConstant.getScmResult( context );
-
- if ( !map.isEmpty() )
- {
- ScmResult scmResult = new ScmResult();
- scmResult.setCommandLine( ContinuumBuildConstant.getScmCommandLine( map ) );
- scmResult.setCommandOutput( ContinuumBuildConstant.getScmCommandOutput( map ) );
- scmResult.setException( ContinuumBuildConstant.getScmException( map ) );
- scmResult.setProviderMessage( ContinuumBuildConstant.getScmProviderMessage( map ) );
- scmResult.setSuccess( ContinuumBuildConstant.isScmSuccess( map ) );
- scmResult.setChanges( getScmChanges( map ) );
-
- return scmResult;
- }
-
- return null;
+ return new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
}
- private String getMavenProjectVersion( Map<String, Object> context )
+ // for unit testing
+
+ public void setOverallDistributedBuildQueues( Map<String, OverallDistributedBuildQueue> overallDistributedBuildQueues )
{
- Map map = ContinuumBuildConstant.getMavenProject( context );
-
- if ( !map.isEmpty() )
- {
- return ContinuumBuildConstant.getVersion( map );
- }
-
- return null;
+ this.overallDistributedBuildQueues = overallDistributedBuildQueues;
}
- private List<String> getMavenProjectModules( Map<String, Object> context )
+ public void setConfigurationService( ConfigurationService configurationService )
{
- Map map = ContinuumBuildConstant.getMavenProject( context );
-
- if ( !map.isEmpty() )
- {
- return ContinuumBuildConstant.getProjectModules( map );
- }
-
- return null;
+ this.configurationService = configurationService;
}
- public Map<String, DistributedBuildTaskQueueExecutor> getTaskQueueExecutors()
+ public void setProjectDao( ProjectDao projectDao )
{
- return taskQueueExecutors;
+ this.projectDao = projectDao;
}
-}
+
+ public void setBuildDefinitionDao( BuildDefinitionDao buildDefinitionDao )
+ {
+ this.buildDefinitionDao = buildDefinitionDao;
+ }
+
+ public void setBuildResultDao( BuildResultDao buildResultDao )
+ {
+ this.buildResultDao = buildResultDao;
+ }
+
+ public void setContainer( PlexusContainer container )
+ {
+ this.container = container;
+ }
+
+}
\ No newline at end of file
diff --git a/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
new file mode 100644
index 0000000..f140109
--- /dev/null
+++ b/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
@@ -0,0 +1,180 @@
+package org.apache.continuum.builder.distributed.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.builder.utils.ContinuumBuildConstant;
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDependency;
+import org.apache.maven.continuum.model.scm.ChangeFile;
+import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.scm.ScmResult;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @plexus.component role="org.apache.continuum.builder.distributed.util.DistributedBuildUtil"
+ */
+public class DistributedBuildUtil
+{
+ private Logger log = LoggerFactory.getLogger( DistributedBuildUtil.class );
+
+ /**
+ * @plexus.requirement
+ */
+ private ProjectDao projectDao;
+
+ /**
+ * @plexus.requirement
+ */
+ private BuildResultDao buildResultDao;
+
+ public BuildResult convertMapToBuildResult( Map<String, Object> context )
+ {
+ BuildResult buildResult = new BuildResult();
+
+ buildResult.setStartTime( ContinuumBuildConstant.getStartTime( context ) );
+ buildResult.setEndTime( ContinuumBuildConstant.getEndTime( context ) );
+ buildResult.setError( ContinuumBuildConstant.getBuildError( context ) );
+ buildResult.setExitCode( ContinuumBuildConstant.getBuildExitCode( context ) );
+ buildResult.setState( ContinuumBuildConstant.getBuildState( context ) );
+ buildResult.setTrigger( ContinuumBuildConstant.getTrigger( context ) );
+ buildResult.setUsername( ContinuumBuildConstant.getUsername( context ) );
+ buildResult.setBuildUrl( ContinuumBuildConstant.getBuildAgentUrl( context ) );
+
+ return buildResult;
+ }
+
+ public List<ProjectDependency> getModifiedDependencies( BuildResult oldBuildResult, Map<String, Object> context )
+ throws ContinuumException
+ {
+ if ( oldBuildResult == null )
+ {
+ return null;
+ }
+
+ try
+ {
+ Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId( context ) );
+ List<ProjectDependency> dependencies = project.getDependencies();
+
+ if ( dependencies == null )
+ {
+ dependencies = new ArrayList<ProjectDependency>();
+ }
+
+ if ( project.getParent() != null )
+ {
+ dependencies.add( project.getParent() );
+ }
+
+ if ( dependencies.isEmpty() )
+ {
+ return null;
+ }
+
+ List<ProjectDependency> modifiedDependencies = new ArrayList<ProjectDependency>();
+
+ for ( ProjectDependency dep : dependencies )
+ {
+ Project dependencyProject =
+ projectDao.getProject( dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );
+
+ if ( dependencyProject != null )
+ {
+ long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+ oldBuildResult.getEndTime() );
+ if ( nbBuild > 0 )
+ {
+ log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
+ dep.getVersion() );
+ modifiedDependencies.add( dep );
+ }
+ else
+ {
+ log.debug( "Dependency not changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
+ dep.getVersion() );
+ }
+ }
+ else
+ {
+ log.debug( "Skip non Continuum project: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
+ dep.getVersion() );
+ }
+ }
+
+ return modifiedDependencies;
+ }
+ catch ( ContinuumStoreException e )
+ {
+ log.warn( "Can't get the project dependencies", e );
+ }
+
+ return null;
+ }
+
+ public ScmResult getScmResult( Map<String, Object> context )
+ {
+ Map<String, Object> map = ContinuumBuildConstant.getScmResult( context );
+
+ if ( !map.isEmpty() )
+ {
+ ScmResult scmResult = new ScmResult();
+ scmResult.setCommandLine( ContinuumBuildConstant.getScmCommandLine( map ) );
+ scmResult.setCommandOutput( ContinuumBuildConstant.getScmCommandOutput( map ) );
+ scmResult.setException( ContinuumBuildConstant.getScmException( map ) );
+ scmResult.setProviderMessage( ContinuumBuildConstant.getScmProviderMessage( map ) );
+ scmResult.setSuccess( ContinuumBuildConstant.isScmSuccess( map ) );
+ scmResult.setChanges( getScmChanges( map ) );
+
+ return scmResult;
+ }
+
+ return null;
+ }
+
+ public List<ChangeSet> getScmChanges( Map<String, Object> context )
+ {
+ List<ChangeSet> changes = new ArrayList<ChangeSet>();
+ List<Map<String, Object>> scmChanges = ContinuumBuildConstant.getScmChanges( context );
+
+ if ( scmChanges != null )
+ {
+ for ( Map<String, Object> map : scmChanges )
+ {
+ ChangeSet changeSet = new ChangeSet();
+ changeSet.setAuthor( ContinuumBuildConstant.getChangeSetAuthor( map ) );
+ changeSet.setComment( ContinuumBuildConstant.getChangeSetComment( map ) );
+ changeSet.setDate( ContinuumBuildConstant.getChangeSetDate( map ) );
+ setChangeFiles( changeSet, map );
+ changes.add( changeSet );
+ }
+ }
+
+ return changes;
+ }
+
+ private void setChangeFiles( ChangeSet changeSet, Map<String, Object> context )
+ {
+ List<Map<String, Object>> changeFiles = ContinuumBuildConstant.getChangeSetFiles( context );
+
+ if ( changeFiles != null )
+ {
+ for ( Map<String, Object> map : changeFiles )
+ {
+ ChangeFile changeFile = new ChangeFile();
+ changeFile.setName( ContinuumBuildConstant.getChangeFileName( map ) );
+ changeFile.setRevision( ContinuumBuildConstant.getChangeFileRevision( map ) );
+ changeFile.setStatus( ContinuumBuildConstant.getChangeFileStatus( map ) );
+
+ changeSet.addFile( changeFile );
+ }
+ }
+ }
+}
diff --git a/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java b/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
index 0432dc3..376f3a5 100644
--- a/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
+++ b/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
@@ -28,14 +28,17 @@
import javax.annotation.Resource;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.continuum.buildqueue.BuildQueueService;
import org.apache.continuum.buildqueue.BuildQueueServiceException;
import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.CheckOutTask;
import org.apache.continuum.taskqueue.OverallBuildQueue;
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildQueue;
@@ -80,6 +83,9 @@
@Resource
private BuildDefinitionDao buildDefinitionDao;
+ @Resource
+ private ProjectDao projectDao;
+
private TaskQueue prepareBuildQueue;
@Resource
@@ -89,12 +95,12 @@
private BuildQueueService buildQueueService;
private PlexusContainer container;
-
+
/**
- * @see BuildsManager#buildProject(int, BuildDefinition, String, int, ScmResult)
+ * @see BuildsManager#buildProject(int, BuildDefinition, String, BuildTrigger, ScmResult, int)
*/
- public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger,
- ScmResult scmResult )
+ public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger,
+ ScmResult scmResult, int projectGroupId )
throws BuildManagerException
{
try
@@ -104,6 +110,11 @@
log.warn( "Project already queued." );
return;
}
+ else if ( isProjectInAnyCurrentBuild( projectId ) )
+ {
+ log.warn( "Project is already building." );
+ return;
+ }
}
catch ( TaskQueueException e )
{
@@ -111,35 +122,47 @@
"Error occurred while checking if the project is already in queue: " + e.getMessage() );
}
- OverallBuildQueue overallBuildQueue =
- getOverallBuildQueue( BUILD_QUEUE, buildDefinition.getSchedule().getBuildQueues() );
+ OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectsInGroupAreQueued( projectGroupId );
- String buildDefinitionLabel = buildDefinition.getDescription();
- if ( StringUtils.isEmpty( buildDefinitionLabel ) )
+ if ( overallBuildQueue == null )
{
- buildDefinitionLabel = buildDefinition.getGoals();
+ overallBuildQueue = getOverallBuildQueue( BUILD_QUEUE, buildDefinition.getSchedule().getBuildQueues() );
}
- BuildProjectTask buildTask =
- new BuildProjectTask( projectId, buildDefinition.getId(), trigger, projectName, buildDefinitionLabel,
- scmResult );
- try
+ if ( overallBuildQueue != null )
{
- log.info(
- "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
- overallBuildQueue.addToBuildQueue( buildTask );
+ String buildDefinitionLabel = buildDefinition.getDescription();
+
+ if ( StringUtils.isEmpty( buildDefinitionLabel ) )
+ {
+ buildDefinitionLabel = buildDefinition.getGoals();
+ }
+
+ BuildProjectTask buildTask =
+ new BuildProjectTask( projectId, buildDefinition.getId(), buildTrigger, projectName, buildDefinitionLabel,
+ scmResult, projectGroupId );
+ try
+ {
+ log.info(
+ "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
+ overallBuildQueue.addToBuildQueue( buildTask );
+ }
+ catch ( TaskQueueException e )
+ {
+ throw new BuildManagerException( "Error occurred while adding project to build queue: " + e.getMessage() );
+ }
}
- catch ( TaskQueueException e )
+ else
{
- throw new BuildManagerException( "Error occurred while adding project to build queue: " + e.getMessage() );
+ log.warn( "No build queue configured. Not building." );
}
}
/**
- * @see BuildsManager#buildProjects(List, Map, int, Map)
+ * @see BuildsManager#buildProjects(List, Map, BuildTrigger, Map, int)
*/
public void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap,
- int trigger, Map<Integer, ScmResult> scmResultMap )
+ BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId )
throws BuildManagerException
{
int firstProjectId = 0;
@@ -148,7 +171,7 @@
{
try
{
- if ( !isInQueue( project.getId(), BUILD_QUEUE, -1 ) )
+ if ( !isInQueue( project.getId(), BUILD_QUEUE, -1 ) && !isProjectInAnyCurrentBuild( project.getId() ) )
{
firstProjectId = project.getId();
break;
@@ -163,8 +186,12 @@
if ( firstProjectId != 0 )
{
BuildDefinition buildDef = projectsBuildDefinitionsMap.get( firstProjectId );
- OverallBuildQueue overallBuildQueue =
- getOverallBuildQueue( BUILD_QUEUE, buildDef.getSchedule().getBuildQueues() );
+ OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectsInGroupAreQueued( projectGroupId );
+
+ if ( overallBuildQueue == null )
+ {
+ overallBuildQueue = getOverallBuildQueue( BUILD_QUEUE, buildDef.getSchedule().getBuildQueues() );
+ }
if ( overallBuildQueue != null )
{
@@ -179,6 +206,12 @@
"' is already in build queue." );
continue;
}
+ else if ( isProjectInAnyCurrentBuild( project.getId() ) )
+ {
+ log.warn( "Project '" + project.getId() + "' - '" + project.getName() +
+ "' is already building." );
+ continue;
+ }
}
catch ( TaskQueueException e )
{
@@ -195,8 +228,8 @@
ScmResult scmResult = scmResultMap.get( project.getId() );
BuildProjectTask buildTask =
- new BuildProjectTask( project.getId(), buildDefinition.getId(), trigger, project.getName(),
- buildDefinitionLabel, scmResult );
+ new BuildProjectTask( project.getId(), buildDefinition.getId(), buildTrigger, project.getName(),
+ buildDefinitionLabel, scmResult, projectGroupId );
buildTask.setMaxExecutionTime( buildDefinition.getSchedule().getMaxJobExecutionTime() * 1000 );
try
@@ -213,11 +246,14 @@
}
}
}
+ else
+ {
+ log.warn( "No build queue configured. Not building" );
+ }
}
else
{
log.error( "Projects are already in build queue." );
- throw new BuildManagerException( "Projects are already in build queue." );
}
}
@@ -367,10 +403,10 @@
}
/**
- * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition, List)
+ * @see BuildsManager#checkoutProject(int, String, File, String, String, BuildDefinition)
*/
- public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
- String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects )
+ public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
+ String scmPassword, BuildDefinition defaultBuildDefinition )
throws BuildManagerException
{
try
@@ -390,7 +426,7 @@
OverallBuildQueue overallBuildQueue =
getOverallBuildQueue( CHECKOUT_QUEUE, defaultBuildDefinition.getSchedule().getBuildQueues() );
CheckOutTask checkoutTask =
- new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword, scmRootUrl, subProjects );
+ new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword );
try
{
if ( overallBuildQueue != null )
@@ -475,6 +511,7 @@
CheckOutTask task = checkouts.get( key );
if ( task.getProjectId() == projectId )
{
+ log.info( "Project " + projectId + " is currently being checked out" );
return true;
}
}
@@ -503,6 +540,7 @@
if ( projectIds.contains( new Integer( projectId ) ) )
{
+ log.info( "Project " + projectId + " is in prepare build queue" );
return true;
}
}
@@ -533,6 +571,7 @@
(BuildProjectTask) overallBuildQueue.getBuildTaskQueueExecutor().getCurrentTask();
if ( task != null && task.getProjectId() == projectId )
{
+ log.info( "Project " + projectId + " is currently building in " + overallBuildQueue.getName() );
return true;
}
}
@@ -541,9 +580,9 @@
}
/**
- * @see BuildsManager#prepareBuildProjects(Map, int, int, String, String, int)
+ * @see BuildsManager#prepareBuildProjects(Map, BuildTrigger, int, String, String, int)
*/
- public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger,
+ public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
int projectGroupId, String projectGroupName, String scmRootAddress,
int scmRootId )
throws BuildManagerException
@@ -551,7 +590,7 @@
try
{
PrepareBuildProjectsTask task =
- new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger, projectGroupId, projectGroupName,
+ new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, buildTrigger, projectGroupId, projectGroupName,
scmRootAddress, scmRootId );
log.info( "Queueing prepare-build-project task '" + task + "' to prepare-build queue." );
@@ -590,9 +629,10 @@
}
/**
- * @see BuildsManager#removeProjectFromBuildQueue(int, int, int, String)
+ * @see BuildsManager#removeProjectFromBuildQueue(int, int, BuildTrigger, String, int)
*/
- public void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
+ public void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+ String projectName, int projectGroupId )
throws BuildManagerException
{
try
@@ -600,7 +640,8 @@
OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, BUILD_QUEUE );
if ( overallBuildQueue != null )
{
- overallBuildQueue.removeProjectFromBuildQueue( projectId, buildDefinitionId, trigger, projectName );
+ overallBuildQueue.removeProjectFromBuildQueue( projectId, buildDefinitionId, buildTrigger, projectName,
+ projectGroupId );
}
else
{
@@ -859,7 +900,7 @@
buildDefinitionDao.getBuildDefinition( buildTask.getBuildDefinitionId() );
buildProject( buildTask.getProjectId(), buildDefinition, buildTask.getProjectName(),
- buildTask.getTrigger(), buildTask.getScmResult() );
+ buildTask.getBuildTrigger(), buildTask.getScmResult(), buildTask.getProjectGroupId() );
}
catch ( ContinuumStoreException e )
{
@@ -871,9 +912,9 @@
{
try
{
- BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( task.getProjectId() );
+ BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( task.getProjectId() );
checkoutProject( task.getProjectId(), task.getProjectName(), task.getWorkingDirectory(),
- task.getScmRootUrl(), task.getScmUserName(), task.getScmPassword(), buildDefinition, task.getProjectsWithCommonScmRoot() );
+ task.getScmUserName(), task.getScmPassword(), buildDefinition );
}
catch ( ContinuumStoreException e )
{
@@ -1034,6 +1075,94 @@
}
}
+ public boolean isProjectCurrentlyPreparingBuild( int projectId )
+ throws BuildManagerException
+ {
+ PrepareBuildProjectsTask task = getCurrentProjectInPrepareBuild();
+
+ if ( task != null )
+ {
+ Map<Integer, Integer> map = task.getProjectsBuildDefinitionsMap();
+
+ if ( map.size() > 0 )
+ {
+ Set<Integer> projectIds = map.keySet();
+
+ if ( projectIds.contains( new Integer( projectId ) ) )
+ {
+ log.info( "Project " + projectId + " is currently preparing build" );
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+ throws BuildManagerException
+ {
+ Task task = getPrepareBuildTaskQueueExecutor().getCurrentTask();
+
+ if ( task != null )
+ {
+ return (PrepareBuildProjectsTask) task;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+ throws BuildManagerException
+ {
+ try
+ {
+ return getPrepareBuildQueue().getQueueSnapshot();
+ }
+ catch ( TaskQueueException e )
+ {
+ throw new BuildManagerException( "Error occurred while retrieving projects in prepare build queue", e );
+ }
+ }
+
+ public boolean removeProjectFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws BuildManagerException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( task.getProjectGroupId() == projectGroupId && task.getProjectScmRootId() == scmRootId )
+ {
+ return getPrepareBuildQueue().remove( task );
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public void removeProjectsFromPrepareBuildQueueWithHashCodes( int[] hashCodes )
+ throws BuildManagerException
+ {
+ List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+ if ( tasks != null )
+ {
+ for ( PrepareBuildProjectsTask task : tasks )
+ {
+ if ( ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+ {
+ getPrepareBuildQueue().remove( task );
+ }
+ }
+ }
+ }
+
private boolean isInQueue( int projectId, int typeOfQueue, int buildDefinitionId )
throws TaskQueueException
{
@@ -1049,6 +1178,7 @@
{
if ( overallBuildQueue.isInBuildQueue( projectId ) )
{
+ log.info( "Project " + projectId + " is in build queue " + overallBuildQueue.getName() );
return true;
}
}
@@ -1056,6 +1186,7 @@
{
if ( overallBuildQueue.isInBuildQueue( projectId, buildDefinitionId ) )
{
+ log.info( "Project " + projectId + " is in build queue " + overallBuildQueue.getName() );
return true;
}
}
@@ -1064,6 +1195,7 @@
{
if ( overallBuildQueue.isInCheckoutQueue( projectId ) )
{
+ log.info( "Project " + projectId + " is in checkout queue " + overallBuildQueue.getName() );
return true;
}
}
@@ -1118,14 +1250,14 @@
{
throw new BuildManagerException( "No build queues configured." );
}
-
+
+ int size = 0;
+ int idx = 0;
+ int allowedBuilds = configurationService.getNumberOfBuildsInParallel();
+
try
- {
- int size = 0;
- int idx = 0;
- int allowedBuilds = configurationService.getNumberOfBuildsInParallel();
+ {
int count = 1;
-
for ( BuildQueue buildQueue : buildQueues )
{
if ( count <= allowedBuilds )
@@ -1134,27 +1266,37 @@
if ( overallBuildQueue != null )
{
TaskQueue taskQueue = null;
+ TaskQueueExecutor taskQueueExecutor = null;
+ int tempSize = 0;
if ( typeOfQueue == BUILD_QUEUE )
{
taskQueue = overallBuildQueue.getBuildQueue();
+ taskQueueExecutor = overallBuildQueue.getBuildTaskQueueExecutor();
}
else if ( typeOfQueue == CHECKOUT_QUEUE )
{
taskQueue = overallBuildQueue.getCheckoutQueue();
+ taskQueueExecutor = overallBuildQueue.getCheckoutTaskQueueExecutor();
}
-
+
+ tempSize = taskQueue.getQueueSnapshot().size();
+ if ( taskQueueExecutor.getCurrentTask() != null )
+ {
+ tempSize++;
+ }
+
if ( idx == 0 )
{
- size = taskQueue.getQueueSnapshot().size();
whereToBeQueued = overallBuildQueue;
+ size = tempSize;
}
-
- if ( taskQueue.getQueueSnapshot().size() < size )
+
+ if ( tempSize < size )
{
whereToBeQueued = overallBuildQueue;
- size = taskQueue.getQueueSnapshot().size();
+ size = tempSize;
}
-
+
idx++;
}
else
@@ -1172,7 +1314,7 @@
catch ( TaskQueueException e )
{
throw new BuildManagerException( "Error occurred while retrieving task quueue: " + e.getMessage() );
- }
+ }
}
// use default overall build queue if none is configured
@@ -1191,7 +1333,107 @@
return whereToBeQueued;
}
-
+
+ public OverallBuildQueue getOverallBuildQueueWhereProjectsInGroupAreQueued( int projectGroupId )
+ throws BuildManagerException
+ {
+ OverallBuildQueue whereToBeQueued = null;
+
+ try
+ {
+ List<Project> projects = projectDao.getProjectsInGroup( projectGroupId );
+
+ if ( projects != null )
+ {
+ for ( Project project : projects )
+ {
+ whereToBeQueued = getOverallBuildQueueWhereProjectIsQueued( project.getId(), BUILD_QUEUE );
+
+ if ( whereToBeQueued == null )
+ {
+ whereToBeQueued = getOverallBuildQueueWhereProjectIsBuilding( project.getId() );
+ }
+
+ if ( whereToBeQueued != null )
+ {
+ break;
+ }
+ }
+ }
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw new BuildManagerException( "Error while retrieving overall build queue for project: " + e.getMessage() );
+ }
+ catch ( TaskQueueException e )
+ {
+ throw new BuildManagerException( "Error while retrieving overall build queue for project: " + e.getMessage() );
+ }
+
+ return whereToBeQueued;
+ }
+
+ private OverallBuildQueue getOverallBuildQueueWhereProjectIsBuilding( int projectId )
+ {
+ synchronized ( overallBuildQueues )
+ {
+ for ( Integer key : overallBuildQueues.keySet() )
+ {
+ OverallBuildQueue overallBuildQueue = overallBuildQueues.get( key );
+ BuildProjectTask task =
+ (BuildProjectTask) overallBuildQueue.getBuildTaskQueueExecutor().getCurrentTask();
+ if ( task != null && task.getProjectId() == projectId )
+ {
+ return overallBuildQueue;
+ }
+ }
+ return null;
+ }
+ }
+
+ public TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
+ throws BuildManagerException
+ {
+ try
+ {
+ return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "prepare-build-project" );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new BuildManagerException( e.getMessage(), e );
+ }
+ }
+
+ public boolean isProjectCurrentlyBeingCheckedOut( int projectId )
+ throws BuildManagerException
+ {
+ Map<String, CheckOutTask> checkouts = getCurrentCheckouts();
+ for( String key : checkouts.keySet() )
+ {
+ CheckOutTask task = checkouts.get( key );
+ if( task.getProjectId() == projectId )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public boolean isAnyProjectCurrentlyBuilding( int[] projectIds )
+ throws BuildManagerException
+ {
+ for ( int i = 0; i < projectIds.length; i++ )
+ {
+ if ( isProjectInAnyCurrentBuild( projectIds[i] ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public void contextualize( Context context )
throws ContextException
{
@@ -1272,4 +1514,9 @@
{
this.buildDefinitionDao = buildDefinitionDao;
}
+
+ public void setProjectDao( ProjectDao projectDao )
+ {
+ this.projectDao = projectDao;
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java b/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
index 1abe8b3..2083088 100644
--- a/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
+++ b/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
@@ -27,8 +27,13 @@
import org.apache.continuum.purge.task.PurgeTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.maven.continuum.build.settings.DefaultSchedulesActivator;
+import org.apache.maven.continuum.build.settings.SchedulesActivationException;
+import org.apache.maven.continuum.build.settings.SchedulesActivator;
import org.apache.maven.continuum.model.project.Schedule;
import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.List;
@@ -43,10 +48,12 @@
public class DefaultContinuumPurgeManager
implements ContinuumPurgeManager
{
+ private static final Logger log = LoggerFactory.getLogger( DefaultContinuumPurgeManager.class );
+
/**
* @plexus.requirement
*/
- private ProjectDao projectDao;
+ private SchedulesActivator schedulesActivator;
/**
* @plexus.requirement
@@ -69,8 +76,8 @@
List<RepositoryPurgeConfiguration> repoPurgeList = null;
List<DirectoryPurgeConfiguration> dirPurgeList = null;
- repoPurgeList = purgeConfigurationService.getRepositoryPurgeConfigurationsBySchedule( schedule.getId() );
- dirPurgeList = purgeConfigurationService.getDirectoryPurgeConfigurationsBySchedule( schedule.getId() );
+ repoPurgeList = purgeConfigurationService.getEnableRepositoryPurgeConfigurationsBySchedule( schedule.getId() );
+ dirPurgeList = purgeConfigurationService.getEnableDirectoryPurgeConfigurationsBySchedule( schedule.getId() );
if ( repoPurgeList != null && repoPurgeList.size() > 0 )
{
@@ -87,6 +94,20 @@
purgeDirectory( dirPurge );
}
}
+
+ if ( ( repoPurgeList == null || repoPurgeList.isEmpty() ) && ( dirPurgeList == null || dirPurgeList.isEmpty() ) )
+ {
+ // This purge is not enable for a purge process.
+ try
+ {
+ schedulesActivator.unactivateOrphanPurgeSchedule( schedule );
+ }
+ catch ( SchedulesActivationException e )
+ {
+ log.debug( String.format( "Can't unactivate orphan schedule '%s' for purgeConfiguration",
+ schedule.getName() ) );
+ }
+ }
}
public void purgeRepository( RepositoryPurgeConfiguration repoPurge )
diff --git a/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java b/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
index 25281f8..d6ea0fd 100644
--- a/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
+++ b/continuum-core/src/main/java/org/apache/continuum/release/distributed/DistributedReleaseUtil.java
@@ -99,6 +99,8 @@
public static final String KEY_RELEASE_GOAL = "release-goal";
public static final String KEY_BUILD_AGENT_URL = "build-agent-url";
+
+ public static final String KEY_USERNAME = "username";
public static String getScmTag( Map<String, Object> context, String defaultValue )
{
@@ -209,6 +211,11 @@
{
return getInteger( context, KEY_PROJECT_ID );
}
+
+ public static String getUsername( Map<String, Object> context )
+ {
+ return getString( context, KEY_USERNAME, "" );
+ }
// ----------------------------------------------------------------------
//
diff --git a/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java b/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
index 208ed61..0606e30 100644
--- a/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
+++ b/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
@@ -32,6 +32,7 @@
import java.util.Map;
import java.util.Properties;
+import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
import org.apache.continuum.configuration.BuildAgentConfiguration;
import org.apache.continuum.configuration.BuildAgentConfigurationException;
import org.apache.continuum.dao.BuildResultDao;
@@ -48,6 +49,7 @@
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.release.ContinuumReleaseException;
import org.apache.maven.shared.release.ReleaseResult;
+import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.slf4j.Logger;
@@ -78,14 +80,17 @@
*/
ConfigurationService configurationService;
+ /**
+ * @plexus.requirement
+ */
+ DistributedBuildManager distributedBuildManager;
+
private Map<String, Map<String, Object>> releasesInProgress;
public Map getReleasePluginParameters( int projectId, String pomFilename )
throws ContinuumReleaseException, BuildAgentConfigurationException
{
- BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId );
-
- String buildAgentUrl = buildResult.getBuildUrl();
+ String buildAgentUrl = getDefaultBuildagent( projectId );
if ( !checkBuildAgent( buildAgentUrl ) )
{
@@ -94,8 +99,16 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.getReleasePluginParameters( projectId, pomFilename );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ return client.getReleasePluginParameters( projectId, pomFilename );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to retrieve release plugin parameters because build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -123,8 +136,16 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.processProject( projectId, pomFilename, autoVersionSubmodules );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ return client.processProject( projectId, pomFilename, autoVersionSubmodules );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to process project for releasing because build agent " + buildAgentUrl + " is unavailable" );
}
catch ( MalformedURLException e )
{
@@ -139,12 +160,10 @@
}
public String releasePrepare( Project project, Properties releaseProperties, Map<String, String> releaseVersion,
- Map<String, String> developmentVersion, Map<String, String> environments )
+ Map<String, String> developmentVersion, Map<String, String> environments, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException
{
- BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );
-
- String buildAgentUrl = buildResult.getBuildUrl();
+ String buildAgentUrl = environments.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
if ( !checkBuildAgent( buildAgentUrl ) )
{
@@ -153,16 +172,25 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- String releaseId =
- client.releasePrepare( createProjectMap( project ), createPropertiesMap( releaseProperties ),
- releaseVersion, developmentVersion, environments );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+
+ String releaseId =
+ client.releasePrepare( createProjectMap( project ), createPropertiesMap( releaseProperties ),
+ releaseVersion, developmentVersion, environments, username );
+
+ addReleasePrepare( releaseId, buildAgentUrl, releaseVersion.get( releaseId ), "prepare" );
+
+ addReleaseInProgress( releaseId, "prepare", project.getId(), username );
+
+ return releaseId;
+ }
- addReleasePrepare( releaseId, buildAgentUrl, releaseVersion.get( releaseId ) );
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
- addReleaseInProgress( releaseId, "prepare", project.getId() );
-
- return releaseId;
+ throw new ContinuumReleaseException( "Failed to prepare release project because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -188,16 +216,25 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- Map<String, Object> result = client.getReleaseResult( releaseId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ Map<String, Object> result = client.getReleaseResult( releaseId );
+
+ ReleaseResult releaseResult = new ReleaseResult();
+ releaseResult.setStartTime( DistributedReleaseUtil.getStartTime( result ) );
+ releaseResult.setEndTime( DistributedReleaseUtil.getEndTime( result ) );
+ releaseResult.setResultCode( DistributedReleaseUtil.getReleaseResultCode( result ) );
+ releaseResult.getOutputBuffer().append( DistributedReleaseUtil.getReleaseOutput( result ) );
+
+ return releaseResult;
+ }
- ReleaseResult releaseResult = new ReleaseResult();
- releaseResult.setStartTime( DistributedReleaseUtil.getStartTime( result ) );
- releaseResult.setEndTime( DistributedReleaseUtil.getEndTime( result ) );
- releaseResult.setResultCode( DistributedReleaseUtil.getReleaseResultCode( result ) );
- releaseResult.getOutputBuffer().append( DistributedReleaseUtil.getReleaseOutput( result ) );
+ // call reload in case we disable a build agent
+ distributedBuildManager.reload();
- return releaseResult;
+ throw new ContinuumReleaseException( "Failed to get release result of " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -223,8 +260,17 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.getListener( releaseId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ return client.getListener( releaseId );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to get listener for " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -250,8 +296,17 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- client.removeListener( releaseId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ client.removeListener( releaseId );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to remove listener of " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -278,8 +333,17 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- return client.getPreparedReleaseName( releaseId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ return client.getPreparedReleaseName( releaseId );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to get prepared release name of " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -294,9 +358,21 @@
}
public void releasePerform( int projectId, String releaseId, String goals, String arguments,
- boolean useReleaseProfile, LocalRepository repository )
+ boolean useReleaseProfile, LocalRepository repository, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException
{
+ List<PreparedRelease> releases = getPreparedReleases();
+
+ for ( PreparedRelease release: releases )
+ {
+ if ( release.getReleaseId().equals( releaseId ) )
+ {
+ release.setReleaseType( "perform" );
+ savePreparedReleases( releases );
+ break;
+ }
+ }
+
String buildAgentUrl = getBuildAgentUrl( releaseId );
if ( !checkBuildAgent( buildAgentUrl ) )
@@ -315,20 +391,28 @@
}
Map<String, String> map = new HashMap<String, String>();
+ map.put( DistributedReleaseUtil.KEY_USERNAME, username );
if ( repository != null )
- {
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY, repository.getLocation() );
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME, repository.getName() );
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_LAYOUT, repository.getLayout() );
+ {
+ map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME, repository.getName() );
}
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- client.releasePerform( releaseId, goals, arguments, useReleaseProfile, map );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ client.releasePerform( releaseId, goals, arguments, useReleaseProfile, map, username );
+
+ addReleaseInProgress( releaseId, "perform", projectId, username );
+ }
- addReleaseInProgress( releaseId, "perform", projectId );
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to perform release of " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -342,14 +426,12 @@
}
}
- public void releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile,
- LocalRepository repository, String scmUrl, String scmUsername,
- String scmPassword, String scmTag, String scmTagBase, Map environments )
+ public String releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile,
+ LocalRepository repository, String scmUrl, String scmUsername,
+ String scmPassword, String scmTag, String scmTagBase, Map environments, String username )
throws ContinuumReleaseException, BuildAgentConfigurationException
{
- BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId );
-
- String buildAgentUrl = buildResult.getBuildUrl();
+ String buildAgentUrl = (String) environments.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
if ( !checkBuildAgent( buildAgentUrl ) )
{
@@ -367,22 +449,32 @@
}
Map<String, String> map = new HashMap<String, String>();
+ map.put( DistributedReleaseUtil.KEY_USERNAME, username );
if ( repository != null )
- {
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY, repository.getLocation() );
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME, repository.getName() );
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_LAYOUT, repository.getLayout() );
+ {
+ map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME, repository.getName() );
}
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- String releaseId =
- client.releasePerformFromScm( goals, arguments, useReleaseProfile, map, scmUrl, scmUsername,
- scmPassword, scmTag, scmTagBase, environments );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ String releaseId =
+ client.releasePerformFromScm( goals, arguments, useReleaseProfile, map, scmUrl, scmUsername,
+ scmPassword, scmTag, scmTagBase, environments, username );
+
+ addReleasePrepare( releaseId, buildAgentUrl, scmTag, "perform" );
+ addReleaseInProgress( releaseId, "perform", projectId, username );
+
+ return releaseId;
+ }
- addReleaseInProgress( releaseId, "perform", projectId );
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to perform release because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -408,8 +500,17 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- client.releaseRollback( releaseId, projectId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ client.releaseRollback( releaseId, projectId );
+ }
+
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Unable to rollback release " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -435,11 +536,22 @@
try
{
- SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- String result = client.releaseCleanup( releaseId );
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
+ {
+ SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ String result = client.releaseCleanup( releaseId );
+
+ removeFromReleaseInProgress( releaseId );
+ removeFromPreparedReleases( releaseId );
+
+ return result;
+ }
- removeFromReleaseInProgress( releaseId );
- return result;
+ // call reload in case we disable the build agent
+ distributedBuildManager.reload();
+
+ throw new ContinuumReleaseException( "Failed to cleanup release of " + releaseId +
+ " because the build agent " + buildAgentUrl + " is not available" );
}
catch ( MalformedURLException e )
{
@@ -448,8 +560,8 @@
}
catch ( Exception e )
{
- log.error( "Failed to get prepared release name of " + releaseId, e );
- throw new ContinuumReleaseException( "Failed to get prepared release name of " + releaseId, e );
+ log.error( "Failed to cleanup release of " + releaseId, e );
+ throw new ContinuumReleaseException( "Failed to cleanup release of " + releaseId, e );
}
}
@@ -474,19 +586,22 @@
try
{
- SlaveBuildAgentTransportClient client =
- new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
- Map map = client.getListener( releaseId );
-
- if ( map != null && !map.isEmpty() )
+ if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
{
- Map<String, Object> release = releasesInProgress.get( releaseId );
- release.put( DistributedReleaseUtil.KEY_RELEASE_ID, releaseId );
- release.put( DistributedReleaseUtil.KEY_BUILD_AGENT_URL, buildAgentUrl );
-
- releases.add( release );
-
- releasesMap.put( releaseId, releasesInProgress.get( releaseId ) );
+ SlaveBuildAgentTransportClient client =
+ new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+ Map map = client.getListener( releaseId );
+
+ if ( map != null && !map.isEmpty() )
+ {
+ Map<String, Object> release = releasesInProgress.get( releaseId );
+ release.put( DistributedReleaseUtil.KEY_RELEASE_ID, releaseId );
+ release.put( DistributedReleaseUtil.KEY_BUILD_AGENT_URL, buildAgentUrl );
+
+ releases.add( release );
+
+ releasesMap.put( releaseId, releasesInProgress.get( releaseId ) );
+ }
}
}
catch ( MalformedURLException e )
@@ -505,8 +620,25 @@
releasesInProgress = releasesMap;
}
+ try
+ {
+ // call reload in case we disable a build agent
+ distributedBuildManager.reload();
+ }
+ catch ( Exception e )
+ {
+ throw new ContinuumReleaseException( e.getMessage(), e );
+ }
+
return releases;
}
+
+ public String getDefaultBuildagent( int projectId )
+ {
+ BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId );
+
+ return buildResult != null ? buildResult.getBuildUrl() : null;
+ }
private Map createProjectMap( Project project )
{
@@ -518,8 +650,8 @@
map.put( DistributedReleaseUtil.KEY_SCM_URL, project.getScmUrl() );
if ( project.getProjectGroup().getLocalRepository() != null )
{
- map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY,
- project.getProjectGroup().getLocalRepository().getLocation() );
+ map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME,
+ project.getProjectGroup().getLocalRepository().getName() );
}
return map;
@@ -599,10 +731,12 @@
if ( file.exists() )
{
+ FileInputStream fis = null;
try
{
+ fis = new FileInputStream( file );
ContinuumPrepareReleasesModelXpp3Reader reader = new ContinuumPrepareReleasesModelXpp3Reader();
- PreparedReleaseModel model = reader.read( new InputStreamReader( new FileInputStream( file ) ) );
+ PreparedReleaseModel model = reader.read( new InputStreamReader( fis ) );
return model.getPreparedReleases();
}
@@ -616,25 +750,26 @@
log.error( e.getMessage(), e );
throw new ContinuumReleaseException( e.getMessage(), e );
}
+ finally
+ {
+ if ( fis != null )
+ {
+ IOUtil.close( fis );
+ }
+ }
}
return null;
}
- private void addReleasePrepare( String releaseId, String buildAgentUrl, String releaseName )
+ private void addReleasePrepare( String releaseId, String buildAgentUrl, String releaseName, String releaseType )
throws ContinuumReleaseException
{
- File file = getPreparedReleasesFile();
-
- if ( !file.exists() )
- {
- file.getParentFile().mkdirs();
- }
-
PreparedRelease release = new PreparedRelease();
release.setReleaseId( releaseId );
release.setBuildAgentUrl( buildAgentUrl );
release.setReleaseName( releaseName );
+ release.setReleaseType( releaseType );
List<PreparedRelease> preparedReleases = getPreparedReleases();
@@ -642,42 +777,28 @@
{
preparedReleases = new ArrayList<PreparedRelease>();
}
- else
+
+ boolean found = false;
+
+ for ( PreparedRelease preparedRelease : preparedReleases )
{
- boolean found = false;
-
- for ( PreparedRelease preparedRelease : preparedReleases )
+ if ( preparedRelease.getReleaseId().equals( release.getReleaseId() ) &&
+ preparedRelease.getReleaseName().equals( release.getReleaseName() ) )
{
- if ( preparedRelease.getReleaseId().equals( release.getReleaseId() ) &&
- preparedRelease.getReleaseName().equals( release.getReleaseName() ) )
- {
- preparedRelease.setBuildAgentUrl( release.getBuildAgentUrl() );
- found = true;
- }
- }
-
- if ( !found )
- {
- preparedReleases.add( release );
+ preparedRelease.setBuildAgentUrl( release.getBuildAgentUrl() );
+ found = true;
}
}
- PreparedReleaseModel model = new PreparedReleaseModel();
- model.setPreparedReleases( preparedReleases );
+ if ( !found )
+ {
+ preparedReleases.add( release );
+ }
- try
- {
- ContinuumPrepareReleasesModelXpp3Writer writer = new ContinuumPrepareReleasesModelXpp3Writer();
- FileWriter fileWriter = new FileWriter( file );
- writer.write( fileWriter, model );
- }
- catch ( IOException e )
- {
- throw new ContinuumReleaseException( "Failed to write prepared releases in file", e );
- }
+ savePreparedReleases( preparedReleases );
}
- private void addReleaseInProgress( String releaseId, String releaseType, int projectId )
+ private void addReleaseInProgress( String releaseId, String releaseType, int projectId, String username )
{
if ( releasesInProgress == null )
{
@@ -687,6 +808,7 @@
Map<String, Object> map = new HashMap<String, Object>();
map.put( DistributedReleaseUtil.KEY_RELEASE_GOAL, releaseType );
map.put( DistributedReleaseUtil.KEY_PROJECT_ID, projectId );
+ map.put( DistributedReleaseUtil.KEY_USERNAME, username );
releasesInProgress.put( releaseId, map );
}
@@ -733,7 +855,60 @@
return true;
}
- log.info( "Build agent: " + buildAgentUrl + "is either disabled or removed" );
+ log.info( "Build agent: " + buildAgentUrl + " is either disabled or removed" );
return false;
}
+
+ private void removeFromPreparedReleases( String releaseId )
+ throws ContinuumReleaseException
+ {
+ List<PreparedRelease> releases = getPreparedReleases();
+
+ for ( PreparedRelease release : releases )
+ {
+ if ( release.getReleaseId().equals( releaseId ) )
+ {
+ if ( release.getReleaseType().equals( "perform" ) )
+ {
+ releases.remove( release );
+ savePreparedReleases( releases );
+ break;
+ }
+ }
+ }
+ }
+
+ private void savePreparedReleases( List<PreparedRelease> preparedReleases)
+ throws ContinuumReleaseException
+ {
+ File file = getPreparedReleasesFile();
+
+ if ( !file.exists() )
+ {
+ file.getParentFile().mkdirs();
+ }
+
+ PreparedReleaseModel model = new PreparedReleaseModel();
+ model.setPreparedReleases( preparedReleases );
+
+ try
+ {
+ ContinuumPrepareReleasesModelXpp3Writer writer = new ContinuumPrepareReleasesModelXpp3Writer();
+ FileWriter fileWriter = new FileWriter( file );
+ writer.write( fileWriter, model );
+ fileWriter.flush();
+ fileWriter.close();
+ }
+ catch ( IOException e )
+ {
+ throw new ContinuumReleaseException( "Failed to write prepared releases in file", e );
+ }
+ }
+
+ // for unit test
+
+ public void setBuildResultDao( BuildResultDao buildResultDao )
+ {
+ this.buildResultDao = buildResultDao;
+ }
}
\ No newline at end of file
diff --git a/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java b/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
index 8633c76..7850d01 100644
--- a/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
+++ b/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
@@ -27,6 +27,7 @@
import org.apache.commons.lang.ArrayUtils;
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.taskqueue.Task;
@@ -323,9 +324,10 @@
}
/**
- * @see OverallBuildQueue#removeProjectFromBuildQueue(int, int, int, String)
+ * @see OverallBuildQueue#removeProjectFromBuildQueue(int, int, BuildTrigger, String, int)
*/
- public boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
+ public boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+ String projectName, int projectGroupId )
throws TaskQueueException
{
BuildDefinition buildDefinition;
@@ -347,7 +349,8 @@
}
BuildProjectTask buildProjectTask =
- new BuildProjectTask( projectId, buildDefinitionId, trigger, projectName, buildDefinitionLabel, null );
+ new BuildProjectTask( projectId, buildDefinitionId, buildTrigger, projectName,
+ buildDefinitionLabel, null, projectGroupId );
return getBuildQueue().remove( buildProjectTask );
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java b/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
index f18239a..6922b60 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
@@ -19,21 +19,8 @@
* under the License.
*/
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
import org.apache.continuum.buildmanager.BuildManagerException;
import org.apache.continuum.buildmanager.BuildsManager;
@@ -49,16 +36,17 @@
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.continuum.dao.ProjectScmRootDao;
import org.apache.continuum.dao.ScheduleDao;
+import org.apache.continuum.model.project.ProjectGroupSummary;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.purge.ContinuumPurgeManager;
import org.apache.continuum.purge.PurgeConfigurationService;
import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
import org.apache.continuum.repository.RepositoryService;
-import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.build.settings.SchedulesActivationException;
import org.apache.maven.continuum.build.settings.SchedulesActivator;
import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -67,7 +55,9 @@
import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
import org.apache.maven.continuum.core.action.CreateProjectsFromMetadataAction;
+import org.apache.maven.continuum.core.action.StoreProjectAction;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
import org.apache.maven.continuum.initialization.ContinuumInitializationException;
@@ -101,13 +91,27 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
-import org.codehaus.plexus.taskqueue.TaskQueueException;
import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl </a>
@@ -269,16 +273,10 @@
{
Runtime.getRuntime().addShutdownHook( new Thread()
{
+ @Override
public void run()
{
- try
- {
- stopContinuum();
- }
- catch ( StoppingException e )
- {
- e.printStackTrace();
- }
+ stopContinuum();
}
} );
}
@@ -288,16 +286,6 @@
return releaseManager;
}
- public void setActionManager( ActionManager actionManager )
- {
- this.actionManager = actionManager;
- }
-
- public ActionManager getActionManager()
- {
- return actionManager;
- }
-
public ContinuumPurgeManager getPurgeManager()
{
return purgeManager;
@@ -400,6 +388,18 @@
throw new ContinuumException(
"Unable to delete group. At least one project in group is still being checked out." );
}
+
+ if ( parallelBuildsManager.isAnyProjectCurrentlyBuilding( projectIds ) )
+ {
+ throw new ContinuumException(
+ "Unable to delete group. At least one project in group is still building." );
+ }
+
+ if ( isAnyProjectsInReleaseStage( projects ) )
+ {
+ throw new ContinuumException(
+ "Unable to delete group. At least one project in group is in release stage" );
+ }
}
catch ( BuildManagerException e )
{
@@ -411,10 +411,18 @@
removeProject( projectId );
}
+ // check if there are any project scm root left
+ List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( projectGroupId );
+
+ for ( ProjectScmRoot scmRoot : scmRoots )
+ {
+ removeProjectScmRoot( scmRoot );
+ }
+
log.info( "Remove project group " + projectGroup.getName() + "(" + projectGroup.getId() + ")" );
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
executeAction( "remove-assignable-roles", context );
projectGroupDao.removeProjectGroup( projectGroup );
@@ -452,7 +460,7 @@
buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate() );
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new_pg.getId() );
+ AbstractContinuumAction.setProjectGroupId( context, new_pg.getId() );
executeAction( "add-assignable-roles", context );
log.info( "Added new project group: " + new_pg.getName() );
@@ -522,12 +530,18 @@
// Projects
// ----------------------------------------------------------------------
+ /**
+ * TODO: Remove this method
+ */
public Collection<Project> getProjects()
throws ContinuumException
{
return projectDao.getAllProjectsByName();
}
+ /**
+ * TODO: Remove this method
+ */
public Collection<Project> getProjectsWithDependencies()
throws ContinuumException
{
@@ -546,18 +560,6 @@
return result;
}
- public Map<Integer, BuildResult> getLatestBuildResults()
- {
- Map<Integer, BuildResult> result = buildResultDao.getLatestBuildResults();
-
- if ( result == null )
- {
- result = new HashMap<Integer, BuildResult>();
- }
-
- return result;
- }
-
public Map<Integer, BuildResult> getBuildResultsInSuccess( int projectGroupId )
{
Map<Integer, BuildResult> result = buildResultDao.getBuildResultsInSuccessByProjectGroupId( projectGroupId );
@@ -570,18 +572,6 @@
return result;
}
- public Map<Integer, BuildResult> getBuildResultsInSuccess()
- {
- Map<Integer, BuildResult> result = buildResultDao.getBuildResultsInSuccess();
-
- if ( result == null )
- {
- result = new HashMap<Integer, BuildResult>();
- }
-
- return result;
- }
-
public BuildResult getLatestBuildResultForProject( int projectId )
{
return buildResultDao.getLatestBuildResultForProject( projectId );
@@ -604,7 +594,43 @@
{
try
{
- Project project = getProjectWithBuilds( projectId );
+ Project project = getProject( projectId );
+
+ try
+ {
+ if ( parallelBuildsManager.isProjectCurrentlyBeingCheckedOut( projectId ) )
+ {
+ throw new ContinuumException(
+ "Unable to remove project " + projectId + " because it is currently being checked out" );
+ }
+
+ if ( parallelBuildsManager.isProjectInAnyCurrentBuild( projectId ) )
+ {
+ throw new ContinuumException(
+ "Unable to remove project " + projectId + " because it is currently building" );
+ }
+ }
+ catch ( BuildManagerException e )
+ {
+ throw new ContinuumException( e.getMessage(), e );
+ }
+
+ if ( isProjectInReleaseStage( project ) )
+ {
+ throw new ContinuumException(
+ "Unable to remove project " + projectId + " because it is in release stage" );
+ }
+
+ try
+ {
+ parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
+
+ parallelBuildsManager.removeProjectFromBuildQueue( projectId );
+ }
+ catch ( BuildManagerException e )
+ {
+ throw new ContinuumException( e.getMessage(), e );
+ }
List<ContinuumReleaseResult> releaseResults =
releaseResultDao.getContinuumReleaseResultsByProject( projectId );
@@ -637,27 +663,19 @@
log.info( "Remove project " + project.getName() + "(" + projectId + ")" );
- try
+ // remove dependencies first to avoid key clash with build results
+ project = projectDao.getProjectWithDependencies( projectId );
+ project.setParent( null );
+ project.getDependencies().clear();
+ projectDao.updateProject( project );
+
+ Collection<BuildResult> buildResults = getBuildResultsForProject( projectId );
+
+ for ( BuildResult br : buildResults )
{
- parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
-
- parallelBuildsManager.removeProjectFromBuildQueue( projectId );
-
- //parallelBuildsManager.cancelCheckout( projectId );
-
- parallelBuildsManager.cancelBuild( projectId );
- }
- catch ( BuildManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
- }
-
- for ( Object o : project.getBuildResults() )
- {
- BuildResult br = (BuildResult) o;
br.setBuildDefinition( null );
//Remove all modified dependencies to prevent SQL errors
- br.setModifiedDependencies( null );
+ br.getModifiedDependencies().clear();
buildResultDao.updateBuildResult( br );
removeBuildResult( br );
}
@@ -692,12 +710,12 @@
{
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ AbstractContinuumAction.setProjectId( context, projectId );
try
{
BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( projectId );
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
executeAction( "add-project-to-checkout-queue", context );
}
@@ -733,85 +751,86 @@
}
}
- public Collection<Project> getAllProjects( int start, int end )
- throws ContinuumException
+ public Map<Integer, ProjectGroupSummary> getProjectsSummaryByGroups()
{
- return projectDao.getAllProjectsByName();
+ return projectDao.getProjectsSummary();
}
// ----------------------------------------------------------------------
// Building
// ----------------------------------------------------------------------
- public void buildProjects()
- throws ContinuumException
+ public void buildProjects( String username )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
- buildProjects( ContinuumProjectState.TRIGGER_FORCED );
+ buildProjects( new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, username ) );
}
public void buildProjectsWithBuildDefinition( int buildDefinitionId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
- buildProjects( ContinuumProjectState.TRIGGER_FORCED, buildDefinitionId );
+ buildProjects( new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ), buildDefinitionId );
}
public void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projects );
- prepareBuildProjects( filteredProjectsList, bds, true, ContinuumProjectState.TRIGGER_FORCED );
+ prepareBuildProjects( filteredProjectsList, bds, true, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ) );
}
public void buildProjectsWithBuildDefinition( List<Project> projects, int buildDefinitionId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projects );
- prepareBuildProjects( filteredProjectsList, buildDefinitionId, ContinuumProjectState.TRIGGER_FORCED );
+ prepareBuildProjects( filteredProjectsList, buildDefinitionId, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ) );
}
/**
* fire of the builds of all projects across all project groups using their default build definitions
+ * TODO:Remove this method
*
- * @param trigger
+ * @param buildTrigger
* @throws ContinuumException
*/
- public void buildProjects( int trigger )
- throws ContinuumException
+ public void buildProjects( BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Collection<Project> projectsList = getProjectsInBuildOrder();
Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projectsList );
- prepareBuildProjects( filteredProjectsList, null, true, trigger );
+ prepareBuildProjects( filteredProjectsList, null, true, buildTrigger );
}
/**
* fire of the builds of all projects across all project groups using the group build definition
*
- * @param trigger
+ * @param buildTrigger
* @param buildDefinitionId
* @throws ContinuumException
*/
- public void buildProjects( int trigger, int buildDefinitionId )
- throws ContinuumException
+ public void buildProjects( BuildTrigger buildTrigger, int buildDefinitionId )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Collection<Project> projectsList = getProjectsInBuildOrder();
Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projectsList );
- prepareBuildProjects( filteredProjectsList, buildDefinitionId, trigger );
+ prepareBuildProjects( filteredProjectsList, buildDefinitionId, buildTrigger );
}
/**
* fire off a build for all of the projects in a project group using their default builds
*
* @param projectGroupId
+ * @param buildTrigger
* @throws ContinuumException
*/
- public void buildProjectGroup( int projectGroupId )
- throws ContinuumException
+ public void buildProjectGroup( int projectGroupId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
List<BuildDefinition> groupDefaultBDs;
@@ -819,7 +838,7 @@
{
groupDefaultBDs = getDefaultBuildDefinitionsForProjectGroup( projectGroupId );
- buildProjectGroupWithBuildDefinition( projectGroupId, groupDefaultBDs, true );
+ buildProjectGroupWithBuildDefinition( projectGroupId, groupDefaultBDs, true, buildTrigger );
}
}
@@ -828,10 +847,11 @@
*
* @param projectGroupId the project group id
* @param buildDefinitionId the build definition id to use
+ * @param buildTrigger the trigger state and the username
* @throws ContinuumException
*/
- public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId )
- throws ContinuumException
+ public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
if ( !isAnyProjectInGroupInReleaseStage( projectGroupId ) )
{
@@ -841,7 +861,7 @@
{
bds.add( bd );
}
- buildProjectGroupWithBuildDefinition( projectGroupId, bds, false );
+ buildProjectGroupWithBuildDefinition( projectGroupId, bds, false, buildTrigger );
}
}
@@ -849,20 +869,24 @@
* fire off a build for all of the projects in a project group using their default builds
*
* @param projectGroupId
+ * @param bds
+ * @param checkDefaultBuildDefinitionForProject
+ * @param buildTrigger
* @throws ContinuumException
*/
private void buildProjectGroupWithBuildDefinition( int projectGroupId, List<BuildDefinition> bds,
- boolean checkDefaultBuildDefinitionForProject )
- throws ContinuumException
+ boolean checkDefaultBuildDefinitionForProject, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
if ( !isAnyProjectInGroupInReleaseStage( projectGroupId ) )
{
Collection<Project> projectsList;
projectsList = getProjectsInBuildOrder( projectDao.getProjectsWithDependenciesByGroupId( projectGroupId ) );
+
+ buildTrigger.setTrigger( ContinuumProjectState.TRIGGER_FORCED );
- prepareBuildProjects( projectsList, bds, checkDefaultBuildDefinitionForProject,
- ContinuumProjectState.TRIGGER_FORCED );
+ prepareBuildProjects( projectsList, bds, checkDefaultBuildDefinitionForProject, buildTrigger );
}
}
@@ -888,10 +912,21 @@
if ( projectsMap == null || projectsMap.size() == 0 )
{
log.debug( "no builds attached to schedule" );
- // We don't have projects attached to this schedule
+ try
+ {
+ schedulesActivator.unactivateOrphanBuildSchedule( schedule );
+ }
+ catch ( SchedulesActivationException e )
+ {
+ log.debug( "Can't unactivate orphan shcedule for buildDefinitions" );
+ }
+ // We don't have projects attached to this schedule. This is because it's only is setting for a
+ // templateBuildDefinition
return;
}
+ //TODO: As all projects are built in the same queue for a project group, it would be better to get them by
+ // project group and add them in queues in parallel to save few seconds
projectsList = getProjectsInBuildOrder();
}
catch ( ContinuumStoreException e )
@@ -900,6 +935,7 @@
}
Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot, Map<Integer, Integer>>();
+ List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
for ( Project project : projectsList )
{
@@ -909,52 +945,67 @@
{
for ( Integer buildDefId : buildDefIds )
{
- try
+ if ( buildDefId != null && isProjectOkToBuild( project.getId(), buildDefId ) )
{
- if ( buildDefId != null &&
- !parallelBuildsManager.isInAnyBuildQueue( project.getId(), buildDefId ) &&
- !parallelBuildsManager.isInAnyCheckoutQueue( project.getId() ) &&
- !parallelBuildsManager.isInPrepareBuildQueue( project.getId() ) )
+ ProjectScmRoot scmRoot = getProjectScmRootByProject( project.getId() );
+
+ Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );
+
+ if ( projectsAndBuildDefinitionsMap == null )
{
- ProjectScmRoot scmRoot = getProjectScmRootByProject( project.getId() );
-
- Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );
-
- if ( projectsAndBuildDefinitionsMap == null )
- {
- projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
- }
-
- projectsAndBuildDefinitionsMap.put( project.getId(), buildDefId );
-
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
+ projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
}
- }
- catch ( BuildManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
+
+ projectsAndBuildDefinitionsMap.put( project.getId(), buildDefId );
+
+ map.put( scmRoot, projectsAndBuildDefinitionsMap );
+
+ if ( !sortedScmRoot.contains( scmRoot ) )
+ {
+ sortedScmRoot.add( scmRoot );
+ }
}
}
}
}
- prepareBuildProjects( map, ContinuumProjectState.TRIGGER_SCHEDULED );
+ BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" );
+
+ for ( ProjectScmRoot scmRoot : sortedScmRoot )
+ {
+ try
+ {
+ prepareBuildProjects( map.get( scmRoot ), buildTrigger, scmRoot.getScmRootAddress(),
+ scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
+ }
+ catch ( NoBuildAgentException e )
+ {
+ log.error( "Unable to build projects in project group " + scmRoot.getProjectGroup().getName()
+ + " because there is no build agent configured" );
+ }
+ catch ( NoBuildAgentInGroupException e )
+ {
+ log.error( "Unable to build projects in project group " + scmRoot.getProjectGroup().getName()
+ + " because there is no build agent configured in build agent group" );
+ }
+ }
}
- public void buildProject( int projectId )
- throws ContinuumException
+ public void buildProject( int projectId, String username )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
- buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
+ buildProject( projectId, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, username ) );
}
- public void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId )
- throws ContinuumException
+ public void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
- buildProject( projectId, buildDefinitionId, ContinuumProjectState.TRIGGER_FORCED );
+ buildTrigger.setTrigger( ContinuumProjectState.TRIGGER_FORCED );
+ buildProject( projectId, buildDefinitionId, buildTrigger );
}
- public void buildProject( int projectId, int trigger )
- throws ContinuumException
+ public void buildProject( int projectId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Project project = getProject( projectId );
if ( isProjectInReleaseStage( project ) )
@@ -969,30 +1020,24 @@
throw new ContinuumException( "Project (id=" + projectId + " doens't have a default build definition." );
}
- try
+ if ( !isProjectOkToBuild( projectId, buildDef.getId() ) )
{
- if ( parallelBuildsManager.isInAnyBuildQueue( projectId, buildDef.getId() ) ||
- parallelBuildsManager.isInAnyCheckoutQueue( projectId ) ||
- parallelBuildsManager.isInPrepareBuildQueue( projectId ) )
- {
- return;
- }
- }
- catch ( BuildManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
+ return;
}
Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
projectsBuildDefinitionsMap.put( projectId, buildDef.getId() );
ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
- prepareBuildProjects( projectsBuildDefinitionsMap, trigger, scmRoot.getScmRootAddress(),
- scmRoot.getProjectGroup().getId(), scmRoot.getId() );
+ List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
+ sortedScmRoot.add(scmRoot);
+
+ prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
+ scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
}
- public void buildProject( int projectId, int buildDefinitionId, int trigger )
- throws ContinuumException
+ public void buildProject( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Project project = getProject( projectId );
if ( isProjectInReleaseStage( project ) )
@@ -1000,26 +1045,20 @@
throw new ContinuumException( "Project (id=" + projectId + ") is currently in release stage." );
}
- try
+ if ( !isProjectOkToBuild( projectId, buildDefinitionId ) )
{
- if ( parallelBuildsManager.isInAnyBuildQueue( projectId, buildDefinitionId ) ||
- parallelBuildsManager.isInAnyCheckoutQueue( projectId ) ||
- parallelBuildsManager.isInPrepareBuildQueue( projectId ) )
- {
- return;
- }
- }
- catch ( BuildManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
+ return;
}
Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
projectsBuildDefinitionsMap.put( projectId, buildDefinitionId );
ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
- prepareBuildProjects( projectsBuildDefinitionsMap, trigger, scmRoot.getScmRootAddress(),
- scmRoot.getProjectGroup().getId(), scmRoot.getId() );
+ List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
+ sortedScmRoot.add(scmRoot);
+
+ prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
+ scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
}
public BuildResult getBuildResult( int buildId )
@@ -1039,12 +1078,42 @@
throws ContinuumException
{
BuildResult buildResult = getBuildResult( buildId );
+
+ // check first if build result is currently being used by a building project
+ Project project = buildResult.getProject();
+ BuildResult bResult = getLatestBuildResultForProject( project.getId() );
+
+ try
+ {
+ if ( bResult != null && buildResult.getId() == bResult.getId() &&
+ parallelBuildsManager.isProjectInAnyCurrentBuild( project.getId() ) )
+ {
+ throw new ContinuumException(
+ "Unable to remove build result because it is currently being used by" + "a building project " +
+ project.getId() );
+ }
+ }
+ catch ( BuildManagerException e )
+ {
+ throw new ContinuumException( e.getMessage(), e );
+ }
+
+ buildResult.getModifiedDependencies().clear();
+ buildResult.setBuildDefinition( null );
+
+ try
+ {
+ buildResultDao.updateBuildResult( buildResult );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ throw logAndCreateException( "Error while removing build result in database.", e );
+ }
removeBuildResult( buildResult );
}
private void removeBuildResult( BuildResult buildResult )
- throws ContinuumException
{
buildResultDao.removeBuildResult( buildResult );
@@ -1062,7 +1131,7 @@
getConfiguration().getBuildOutputFile( buildResult.getId(), buildResult.getProject().getId() );
if ( buildOutputFile.exists() )
{
- buildOutputFile.delete();
+ FileUtils.forceDelete( buildOutputFile );
}
}
catch ( ConfigurationException e )
@@ -1089,11 +1158,24 @@
}
}
+ /**
+ * TODO: Must be done by build definition
+ */
public List<ChangeSet> getChangesSinceLastSuccess( int projectId, int buildResultId )
throws ContinuumException
{
- ArrayList<BuildResult> buildResults =
- new ArrayList<BuildResult>( buildResultDao.getBuildResultsForProject( projectId, 0 ) );
+ BuildResult previousBuildResult = null;
+ try
+ {
+ previousBuildResult = buildResultDao.getPreviousBuildResultInSuccess( projectId, buildResultId );
+ }
+ catch ( ContinuumStoreException e )
+ {
+ //No previous build in success, Nothing to do
+ }
+ long startTime = previousBuildResult == null ? 0 : previousBuildResult.getStartTime();
+ ArrayList<BuildResult> buildResults = new ArrayList<BuildResult>(
+ buildResultDao.getBuildResultsForProjectWithDetails( projectId, startTime, buildResultId ) );
Collections.reverse( buildResults );
@@ -1101,6 +1183,7 @@
boolean stop = false;
+ //TODO: Shouldn't be used now with the previous call of buildResultDao.getBuildResultsForProjectWithDetails
while ( !stop )
{
if ( buildResultsIterator.hasNext() )
@@ -1161,7 +1244,10 @@
//
// ----------------------------------------------------------------------
- public List<Project> getProjectsInBuildOrder()
+ /**
+ * TODO: Remove this method when it won't be used
+ */
+ private List<Project> getProjectsInBuildOrder()
throws ContinuumException
{
return getProjectsInBuildOrder( getProjectsWithDependencies() );
@@ -1222,7 +1308,7 @@
{
return executeAddProjectsFromMetadataActivity( metadataUrl, MavenOneContinuumProjectBuilder.ID, projectGroupId,
checkProtocol, useCredentialsCache, true,
- buildDefinitionTemplateId, false );
+ buildDefinitionTemplateId );
}
// ----------------------------------------------------------------------
@@ -1271,7 +1357,7 @@
{
return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
projectGroupId, checkProtocol, useCredentialsCache, true,
- buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
+ buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
}
catch ( BuildDefinitionServiceException e )
{
@@ -1289,7 +1375,7 @@
return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
projectGroupId, checkProtocol, useCredentialsCache,
recursiveProjects,
- buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
+ buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
}
catch ( BuildDefinitionServiceException e )
{
@@ -1299,12 +1385,12 @@
public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
boolean checkProtocol, boolean useCredentialsCache,
- boolean recursiveProjects, int buildDefinitionTemplateId, boolean checkoutInSingleDirectory )
+ boolean recursiveProjects, int buildDefinitionTemplateId )
throws ContinuumException
{
return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID, projectGroupId,
checkProtocol, useCredentialsCache, recursiveProjects,
- buildDefinitionTemplateId, checkoutInSingleDirectory );
+ buildDefinitionTemplateId );
}
// ----------------------------------------------------------------------
@@ -1342,19 +1428,52 @@
Map<String, Object> context = new HashMap<String, Object>();
String scmUrl = project.getScmUrl();
- createProjectScmRoot( projectGroup, scmUrl );
+
+ List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( groupId );
+
+ boolean found = false;
+
+ for ( ProjectScmRoot scmRoot : scmRoots )
+ {
+ if ( scmUrl.startsWith( scmRoot.getScmRootAddress() ) )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if ( !found )
+ {
+ createProjectScmRoot( projectGroup, scmUrl );
+ }
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
- context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+ AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
- context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+ AbstractContinuumAction.setUnvalidatedProject( context, project );
- context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+ AbstractContinuumAction.setUnvalidatedProjectGroup( context, projectGroup );
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
+
+ StoreProjectAction.setUseScmCredentialsCache( context, project.isScmUseCache() );
+
+ // set for initial checkout
+ String scmUsername = project.getScmUsername();
+ String scmPassword = project.getScmPassword();
+
+ if( scmUsername != null && !StringUtils.isEmpty( scmUsername ) )
+ {
+ CheckoutProjectContinuumAction.setScmUsername( context, scmUsername );
+ }
+
+ if( scmPassword != null && !StringUtils.isEmpty( scmPassword ) )
+ {
+ CheckoutProjectContinuumAction.setScmPassword( context, scmPassword );
+ }
executeAction( "validate-project", context );
@@ -1389,7 +1508,7 @@
}
buildDefinitionService.addTemplateInProject( bdt.getId(), getProject(
- (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID ) ) );
+ AbstractContinuumAction.getProjectId( context ) ) );
}
catch ( BuildDefinitionServiceException e )
{
@@ -1399,15 +1518,16 @@
if ( !configurationService.isDistributedBuildEnabled() )
{
// used by BuildManager to determine on which build queue will the project be put
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getProjectWithBuildDetails(
- (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID ) ).getBuildDefinitions().get( 0 ) );
+ BuildDefinition bd = (BuildDefinition) getProjectWithBuildDetails(
+ AbstractContinuumAction.getProjectId( context ) ).getBuildDefinitions().get( 0 );
+ AbstractContinuumAction.setBuildDefinition( context, bd );
executeAction( "add-project-to-checkout-queue", context );
}
executeAction( "add-assignable-roles", context );
- return (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID );
+ return AbstractContinuumAction.getProjectId( context );
}
private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
@@ -1418,7 +1538,7 @@
throws ContinuumException
{
return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
- false, false, buildDefinitionTemplateId, false );
+ false, false, buildDefinitionTemplateId );
}
@@ -1429,7 +1549,7 @@
boolean useCredentialsCache,
boolean loadRecursiveProjects,
int buildDefinitionTemplateId,
- boolean addAssignableRoles, boolean checkoutInSingleDirectory )
+ boolean addAssignableRoles )
throws ContinuumException
{
if ( checkProtocol )
@@ -1444,25 +1564,24 @@
Map<String, Object> context = new HashMap<String, Object>();
- context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, projectBuilderId );
+ CreateProjectsFromMetadataAction.setProjectBuilderId( context, projectBuilderId );
- context.put( AbstractContinuumAction.KEY_URL, metadataUrl );
+ CreateProjectsFromMetadataAction.setUrl( context, metadataUrl );
- context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProjects );
+ CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, loadRecursiveProjects );
- context.put( AbstractContinuumAction.KEY_SCM_USE_CREDENTIALS_CACHE, useCredentialsCache );
+ StoreProjectAction.setUseScmCredentialsCache( context, useCredentialsCache );
- context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
-
- context.put( CreateProjectsFromMetadataAction.KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY, checkoutInSingleDirectory );
+ AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
// CreateProjectsFromMetadataAction will check null and use default
if ( buildDefinitionTemplateId > 0 )
{
try
{
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_TEMPLATE,
- buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId ) );
+ AbstractContinuumAction.setBuildDefinitionTemplate( context,
+ buildDefinitionService.getBuildDefinitionTemplate(
+ buildDefinitionTemplateId ) );
}
catch ( BuildDefinitionServiceException e )
{
@@ -1475,9 +1594,7 @@
executeAction( "create-projects-from-metadata", context );
- ContinuumProjectBuildingResult result =
- (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT )
- ;
+ ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
if ( log.isInfoEnabled() )
{
@@ -1515,8 +1632,6 @@
ProjectGroup projectGroup = result.getProjectGroups().iterator().next();
- ProjectScmRoot projectScmRoot;
-
boolean projectGroupCreation = false;
try
@@ -1537,9 +1652,9 @@
Map<String, Object> pgContext = new HashMap<String, Object>();
- pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+ AbstractContinuumAction.setWorkingDirectory( pgContext, getWorkingDirectory() );
- pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+ AbstractContinuumAction.setUnvalidatedProjectGroup( pgContext, projectGroup );
executeAction( "validate-project-group", pgContext );
@@ -1553,11 +1668,22 @@
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
- String url = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, null );
+ String url = CreateProjectsFromMetadataAction.getUrl( context );
- projectScmRoot = getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(), url );
-
- if ( projectScmRoot == null )
+ List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( projectGroup.getId() );
+
+ boolean found = false;
+
+ for ( ProjectScmRoot scmRoot : scmRoots )
+ {
+ if ( url.startsWith( scmRoot.getScmRootAddress() ) )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if ( !found )
{
createProjectScmRoot( projectGroup, url );
}
@@ -1583,8 +1709,17 @@
for ( Project project : projects )
{
+ checkForDuplicateProjectInGroup( projectGroup, project, result );
+
+ if ( result.hasErrors() )
+ {
+ log.info( result.getErrors().size() + " errors during project add: " );
+ log.info( result.getErrorsAsString() );
+ return result;
+ }
+
project.setScmUseCache( useCredentialsCache );
-
+
// values backup for first checkout
scmUserName = project.getScmUsername();
scmPassword = project.getScmPassword();
@@ -1601,44 +1736,78 @@
try
{
projectGroupDao.updateProjectGroup( projectGroup );
-
- if( !checkoutInSingleDirectory )
+
+ for ( Project project : projects )
{
- for ( Project project : projects )
+ context = new HashMap<String, Object>();
+
+ // CONTINUUM-1953 olamy : attached buildDefs from template here
+ // if no group creation
+ if ( !projectGroupCreation && buildDefinitionTemplateId > 0 )
{
- context = new HashMap<String, Object>();
-
- addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context,
- projectGroupCreation, scmUserName, scmPassword, project );
+ buildDefinitionService.addTemplateInProject( buildDefinitionTemplateId,
+ projectDao.getProject( project.getId() ) );
}
- }
- else
- {
- Project project = result.getRootProject();
-
- if( project != null )
+
+ AbstractContinuumAction.setUnvalidatedProject( context, project );
+ //
+ // executeAction( "validate-project", context );
+ //
+ // executeAction( "store-project", context );
+ //
+ AbstractContinuumAction.setProjectId( context, project.getId() );
+
+ if ( !StringUtils.isEmpty( scmUserName ) )
{
- String scmRootUrl = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, null );
-
- context = new HashMap<String, Object>();
+ project.setScmUsername( scmUserName );
+ CheckoutProjectContinuumAction.setScmUsername( context, scmUserName );
+ }
+ if ( !StringUtils.isEmpty( scmPassword ) )
+ {
+ project.setScmPassword( scmPassword );
+ CheckoutProjectContinuumAction.setScmPassword( context, scmPassword );
+ }
+ // 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
+ AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId() ) );
- context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, scmRootUrl );
-
- Project rootProject = result.getRootProject();
-
- if( rootProject != null )
- {
- List<Project> projectsWithSimilarScmRoot = new ArrayList<Project>();
- for( Project projectWithSimilarScmRoot : projects )
- {
- projectsWithSimilarScmRoot.add( projectWithSimilarScmRoot );
- }
+ BuildDefinition defaultBuildDefinition = null;
+ BuildDefinitionTemplate template = null;
+ if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
+ {
+ template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();
- context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, projectsWithSimilarScmRoot );
+ if( template != null && template.getBuildDefinitions().size() > 0 )
+ {
+ defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
}
-
- addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context, projectGroupCreation,
- scmUserName, scmPassword, project );
+ }
+ else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
+ {
+ template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();
+
+ if ( template != null && template.getBuildDefinitions().size() > 0 )
+ {
+ defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+ }
+ }
+
+ if ( defaultBuildDefinition == null )
+ {
+ // do not throw exception
+ // project already added so might as well continue with the rest
+ log.warn( "No default build definition found in the template. Project cannot be checked out." );
+ }
+ else
+ {
+ // used by BuildManager to determine on which build queue will the project be put
+ AbstractContinuumAction.setBuildDefinition( context, defaultBuildDefinition );
+
+ if ( !configurationService.isDistributedBuildEnabled() )
+ {
+ executeAction( "add-project-to-checkout-queue", context );
+ }
}
}
}
@@ -1651,7 +1820,7 @@
throw new ContinuumException( "Error adding projects from modules", e );
}
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
// add the relevent security administration roles for this project
if ( addAssignableRoles )
{
@@ -1660,78 +1829,18 @@
return result;
}
- private void addProjectToCheckoutQueue( String projectBuilderId, int buildDefinitionTemplateId,
- Map<String, Object> context, boolean projectGroupCreation,
- String scmUserName, String scmPassword, Project project )
- throws BuildDefinitionServiceException, ContinuumStoreException, ContinuumException
- {
- // CONTINUUM-1953 olamy : attached buildDefs from template here
- // if no group creation
- if ( !projectGroupCreation && buildDefinitionTemplateId > 0 )
- {
- buildDefinitionService.addTemplateInProject( buildDefinitionTemplateId,
- projectDao.getProject( project.getId() ) );
- }
-
- context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
- //
- // executeAction( "validate-project", context );
- //
- // executeAction( "store-project", context );
- //
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, project.getId() );
-
- // does the scm username & password really have to be set in the project?
- if ( !StringUtils.isEmpty( scmUserName ) )
- {
- project.setScmUsername( scmUserName );
- context.put( AbstractContinuumAction.KEY_SCM_USERNAME, scmUserName );
- }
- if ( !StringUtils.isEmpty( scmPassword ) )
- {
- project.setScmPassword( scmPassword );
- context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, scmPassword );
- }
- // 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, projectDao.getProject( project.getId() ) );
-
- BuildDefinition defaultBuildDefinition = null;
- if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
- {
- defaultBuildDefinition =
- (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
- 0 );
- }
- else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
- {
- defaultBuildDefinition =
- (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
- 0 );
- }
-
- // used by BuildManager to determine on which build queue will the project be put
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, defaultBuildDefinition );
-
- if ( !configurationService.isDistributedBuildEnabled() )
- {
- executeAction( "add-project-to-checkout-queue", context );
- }
- }
-
- protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
- String projectBuilderId,
- int projectGroupId,
- boolean checkProtocol,
- boolean useCredentialsCache,
- boolean loadRecursiveProjects,
- int buildDefinitionTemplateId, boolean checkoutInSingleDirectory )
+ private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
+ String projectBuilderId,
+ int projectGroupId,
+ boolean checkProtocol,
+ boolean useCredentialsCache,
+ boolean loadRecursiveProjects,
+ int buildDefinitionTemplateId )
throws ContinuumException
{
return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
useCredentialsCache, loadRecursiveProjects,
- buildDefinitionTemplateId, true, checkoutInSingleDirectory );
+ buildDefinitionTemplateId, true );
}
// ----------------------------------------------------------------------
@@ -2049,22 +2158,26 @@
throws ContinuumException
{
HashMap<String, Object> context = new HashMap<String, Object>();
+ Schedule schedule = buildDefinition.getSchedule();
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+ AbstractContinuumAction.setProjectId( context, projectId );
executeAction( "add-build-definition-to-project", context );
- return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+ activeBuildDefinitionSchedule( schedule );
+
+ return AbstractContinuumAction.getBuildDefinition( context );
}
public void removeBuildDefinitionFromProject( int projectId, int buildDefinitionId )
throws ContinuumException
{
HashMap<String, Object> context = new HashMap<String, Object>();
+ BuildDefinition buildDefinition = getBuildDefinition( buildDefinitionId );
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getBuildDefinition( buildDefinitionId ) );
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+ AbstractContinuumAction.setProjectId( context, projectId );
executeAction( "remove-build-definition-from-project", context );
}
@@ -2073,26 +2186,32 @@
throws ContinuumException
{
HashMap<String, Object> context = new HashMap<String, Object>();
+ Schedule schedule = buildDefinition.getSchedule();
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+ AbstractContinuumAction.setProjectId( context, projectId );
executeAction( "update-build-definition-from-project", context );
- return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+ activeBuildDefinitionSchedule( schedule );
+
+ return AbstractContinuumAction.getBuildDefinition( context );
}
public BuildDefinition addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
throws ContinuumException
{
HashMap<String, Object> context = new HashMap<String, Object>();
+ Schedule schedule = buildDefinition.getSchedule();
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
executeAction( "add-build-definition-to-project-group", context );
- return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+ activeBuildDefinitionSchedule( schedule );
+
+ return AbstractContinuumAction.getBuildDefinition( context );
}
public void removeBuildDefinitionFromProjectGroup( int projectGroupId, int buildDefinitionId )
@@ -2100,8 +2219,8 @@
{
HashMap<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getBuildDefinition( buildDefinitionId ) );
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+ AbstractContinuumAction.setBuildDefinition( context, getBuildDefinition( buildDefinitionId ) );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
executeAction( "remove-build-definition-from-project-group", context );
}
@@ -2110,13 +2229,16 @@
throws ContinuumException
{
HashMap<String, Object> context = new HashMap<String, Object>();
+ Schedule schedule = buildDefinition.getSchedule();
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
executeAction( "update-build-definition-from-project-group", context );
- return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+ activeBuildDefinitionSchedule( schedule );
+
+ return AbstractContinuumAction.getBuildDefinition( context );
}
public void removeBuildDefinition( int projectId, int buildDefinitionId )
@@ -2134,19 +2256,6 @@
}
}
- public void removeBuildDefinition( BuildDefinition buildDefinition )
- throws ContinuumException
- {
- try
- {
- buildDefinitionDao.removeBuildDefinition( buildDefinition );
- }
- catch ( ContinuumStoreException ex )
- {
- throw logAndCreateException( "Error while removing build definition.", ex );
- }
- }
-
// ----------------------------------------------------------------------
// Schedule
// ----------------------------------------------------------------------
@@ -2216,6 +2325,9 @@
private void updateSchedule( Schedule schedule, boolean updateScheduler )
throws ContinuumException
{
+
+ Schedule old = getSchedule( schedule.getId() );
+
storeSchedule( schedule );
if ( updateScheduler )
@@ -2224,14 +2336,15 @@
{
if ( schedule.isActive() )
{
- // I unactivate it before if it's already active
- schedulesActivator.unactivateSchedule( schedule, this );
+ // I unactivate old shcedule (could change name) before if it's already active
+ schedulesActivator.unactivateSchedule( old, this );
schedulesActivator.activateSchedule( schedule, this );
}
else
{
- schedulesActivator.unactivateSchedule( schedule, this );
+ // Unactivate old because could change name in new schedule
+ schedulesActivator.unactivateSchedule( old, this );
}
}
catch ( SchedulesActivationException e )
@@ -2293,7 +2406,7 @@
}
}
- public Schedule storeSchedule( Schedule schedule )
+ private Schedule storeSchedule( Schedule schedule )
throws ContinuumException
{
try
@@ -2306,6 +2419,29 @@
}
}
+ public void activePurgeSchedule( Schedule schedule )
+ {
+ try
+ {
+ schedulesActivator.activatePurgeSchedule( schedule, this );
+ }
+ catch ( SchedulesActivationException e )
+ {
+ log.error( "Can't activate schedule for purgeConfiguration" );
+ }
+ }
+
+ public void activeBuildDefinitionSchedule( Schedule schedule )
+ {
+ try
+ {
+ schedulesActivator.activateBuildSchedule( schedule, this );
+ }
+ catch ( SchedulesActivationException e )
+ {
+ log.error( "Can't activate schedule for buildDefinition" );
+ }
+ }
// ----------------------------------------------------------------------
// Working copy
// ----------------------------------------------------------------------
@@ -2597,9 +2733,9 @@
}
}
- public void stopContinuum()
- throws StoppingException
+ private void stopContinuum()
{
+ //TODO: Remove all projects from queues, stop scheduler and wait the end of current builds so build results will be ok
if ( stopped )
{
return;
@@ -2764,20 +2900,7 @@
}
}
- public void removeNotifier( ProjectNotifier notifier )
- throws ContinuumException
- {
- try
- {
- notifierDao.removeNotifier( notifier );
- }
- catch ( ContinuumStoreException ex )
- {
- throw logAndCreateException( "Error while removing notifier.", ex );
- }
- }
-
- public ProjectNotifier storeNotifier( ProjectNotifier notifier )
+ private ProjectNotifier storeNotifier( ProjectNotifier notifier )
throws ContinuumException
{
try
@@ -2790,7 +2913,7 @@
}
}
- public String getWorkingDirectory()
+ private String getWorkingDirectory()
{
return configurationService.getWorkingDirectory().getAbsolutePath();
}
@@ -2812,11 +2935,6 @@
}
}
- public List<Project> getAllProjectsWithAllDetails( int start, int end )
- {
- return projectDao.getAllProjectsWithAllDetails();
- }
-
public Project getProjectWithAllDetails( int projectId )
throws ContinuumException
{
@@ -2868,12 +2986,6 @@
}
}
- public Collection<ProjectGroup> getAllProjectGroupsWithProjects()
- {
- //TODO: check why this interface isn't throwing exceptions on this guy
- return projectGroupDao.getAllProjectGroupsWithProjects();
- }
-
public List<ProjectGroup> getAllProjectGroupsWithBuildDetails()
{
return projectGroupDao.getAllProjectGroupsWithBuildDetails();
@@ -2953,13 +3065,14 @@
private String getVersion()
{
+ InputStream resourceAsStream = null;
try
{
Properties properties = new Properties();
String name = "META-INF/maven/org.apache.continuum/continuum-core/pom.properties";
- InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream( name );
+ resourceAsStream = getClass().getClassLoader().getResourceAsStream( name );
if ( resourceAsStream == null )
{
@@ -2974,6 +3087,13 @@
{
return "unknown";
}
+ finally
+ {
+ if ( resourceAsStream != null )
+ {
+ IOUtil.close( resourceAsStream );
+ }
+ }
}
public InstallationService getInstallationService()
@@ -3028,7 +3148,14 @@
if ( releaseFile.exists() )
{
- releaseFile.delete();
+ try
+ {
+ FileUtils.forceDelete( releaseFile );
+ }
+ catch ( IOException e )
+ {
+ throw new ContinuumException( "Can't delete " + releaseFile.getAbsolutePath(), e );
+ }
}
}
catch ( ConfigurationException e )
@@ -3127,7 +3254,7 @@
ProjectGroup group = getProjectGroupByProjectId( projectId );
List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( group.getId() );
-
+
for ( ProjectScmRoot scmRoot : scmRoots )
{
if ( project.getScmUrl() != null && project.getScmUrl().startsWith( scmRoot.getScmRootAddress() ) )
@@ -3154,6 +3281,11 @@
private void removeProjectScmRoot( ProjectScmRoot projectScmRoot )
throws ContinuumException
{
+ if ( projectScmRoot == null )
+ {
+ return;
+ }
+
//get all projects in the group
ProjectGroup group = getProjectGroupWithProjects( projectScmRoot.getProjectGroup().getId() );
@@ -3269,34 +3401,16 @@
}
private void prepareBuildProjects( Collection<Project> projects, List<BuildDefinition> bds,
- boolean checkDefaultBuildDefinitionForProject, int trigger )
- throws ContinuumException
+ boolean checkDefaultBuildDefinitionForProject, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot, Map<Integer, Integer>>();
+ List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
for ( Project project : projects )
{
int projectId = project.getId();
- try
- {
- // check if project already in queue
- if ( parallelBuildsManager.isInAnyBuildQueue( projectId ) ||
- parallelBuildsManager.isProjectInAnyCurrentBuild( projectId ) )
- {
- continue;
- }
-
- if ( parallelBuildsManager.isInAnyCheckoutQueue( projectId ) )
- {
- parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
- }
- }
- catch ( BuildManagerException e )
- {
- throw new ContinuumException( e.getMessage(), e );
- }
-
int buildDefId = -1;
if ( bds != null )
@@ -3339,7 +3453,13 @@
if ( buildDefId == -1 )
{
log.info( "Project " + projectId +
- " don't have a default build definition defined in the project or project group, will not be included in group prepare." );
+ " don't have a default build definition defined in the project or project group, will not be included in group build." );
+ continue;
+ }
+
+ // check if project already in queue
+ if ( !isProjectOkToBuild( projectId, buildDefId ) )
+ {
continue;
}
@@ -3351,147 +3471,89 @@
{
projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
}
-
- if( project.isCheckedOutInSingleDirectory() )
+
+ projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
+
+ map.put( scmRoot, projectsAndBuildDefinitionsMap );
+
+ if ( !sortedScmRoot.contains( scmRoot ) )
{
- Set<Integer> keys = projectsAndBuildDefinitionsMap.keySet();
- if( keys != null && !keys.isEmpty() )
- {
- for( Integer key : keys )
- {
- if( key.intValue() > projectId )
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
- }
- }
- }
- else
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
- }
- }
- else
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
+ sortedScmRoot.add( scmRoot );
}
}
- prepareBuildProjects( map, trigger );
+ prepareBuildProjects( map, buildTrigger, sortedScmRoot );
}
- private void prepareBuildProjects( Collection<Project> projects, int buildDefinitionId, int trigger )
- throws ContinuumException
+ private void prepareBuildProjects( Collection<Project> projects, int buildDefinitionId, BuildTrigger buildTrigger )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot, Map<Integer, Integer>>();
+ List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
for ( Project project : projects )
{
int projectId = project.getId();
- try
+ // check if project already in queue
+ if ( !isProjectOkToBuild( projectId, buildDefinitionId ) )
{
- // check if project already in queue
- if ( parallelBuildsManager.isInAnyBuildQueue( projectId ) ||
- parallelBuildsManager.isProjectInAnyCurrentBuild( projectId ) )
- {
- continue;
- }
-
- if ( parallelBuildsManager.isInAnyCheckoutQueue( projectId ) )
- {
- parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
- }
-
- ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
-
- Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );
-
- if ( projectsAndBuildDefinitionsMap == null )
- {
- projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
- }
-
- if( project.isCheckedOutInSingleDirectory() )
- {
- Set<Integer> keys = projectsAndBuildDefinitionsMap.keySet();
- if( keys != null && !keys.isEmpty() )
- {
- for( Integer key : keys )
- {
- if( key.intValue() > projectId )
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
- }
- }
- }
- else
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
- }
- }
- else
- {
- projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );
- map.put( scmRoot, projectsAndBuildDefinitionsMap );
- }
+ log.info( "not building" );
+ continue;
}
- catch ( BuildManagerException e )
+
+ ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
+
+ Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );
+
+ if ( projectsAndBuildDefinitionsMap == null )
{
- throw new ContinuumException( e.getMessage(), e );
+ projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
+ }
+
+ projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );
+
+ map.put( scmRoot, projectsAndBuildDefinitionsMap );
+
+ if ( !sortedScmRoot.contains( scmRoot ) )
+ {
+ sortedScmRoot.add( scmRoot );
}
}
- prepareBuildProjects( map, trigger );
+ prepareBuildProjects( map, buildTrigger, sortedScmRoot );
}
- private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>> map, int trigger )
- throws ContinuumException
- {
- for ( ProjectScmRoot scmRoot : map.keySet() )
- {
- prepareBuildProjects( map.get( scmRoot ), trigger, scmRoot.getScmRootAddress(),
- scmRoot.getProjectGroup().getId(), scmRoot.getId() );
+ private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>> map, BuildTrigger buildTrigger,
+ List<ProjectScmRoot> scmRoots )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
+ {
+ for ( ProjectScmRoot scmRoot : scmRoots )
+ {
+ prepareBuildProjects( map.get( scmRoot ), buildTrigger, scmRoot.getScmRootAddress(),
+ scmRoot.getProjectGroup().getId(), scmRoot.getId(), scmRoots );
}
}
- private void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger,
- String scmRootAddress, int projectGroupId, int scmRootId )
- throws ContinuumException
+ private void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
+ String scmRootAddress, int projectGroupId, int scmRootId, List<ProjectScmRoot> scmRoots )
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectGroup group = getProjectGroup( projectGroupId );
-
+
try
{
if ( configurationService.isDistributedBuildEnabled() )
{
- if ( !taskQueueManager.isInDistributedBuildQueue( projectGroupId, scmRootAddress ) )
- {
- PrepareBuildProjectsTask task =
- new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger, projectGroupId,
- group.getName(), scmRootAddress, scmRootId );
-
- taskQueueManager.getDistributedBuildQueue().put( task );
- }
+ distributedBuildManager.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, projectGroupId,
+ group.getName(), scmRootAddress, scmRootId, scmRoots );
}
else
{
- parallelBuildsManager.prepareBuildProjects( projectsBuildDefinitionsMap, trigger, projectGroupId,
+ parallelBuildsManager.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, projectGroupId,
group.getName(), scmRootAddress, scmRootId );
}
}
- catch ( TaskQueueManagerException e )
- {
- throw logAndCreateException( e.getMessage(), e );
- }
- catch ( TaskQueueException e )
- {
- throw logAndCreateException( "Error while creating enqueuing object.", e );
- }
catch ( BuildManagerException e )
{
throw logAndCreateException( "Error while creating enqueuing object.", e );
@@ -3510,7 +3572,7 @@
for ( Project project : projectsList )
{
- if ( !project.getScmUrl().startsWith( url ) )
+ if ( StringUtils.isEmpty( url ) || !project.getScmUrl().startsWith( url ) )
{
// this is a root
url = project.getScmUrl();
@@ -3537,7 +3599,7 @@
projectScmRoot.setProjectGroup( projectGroup );
projectScmRoot.setScmRootAddress( url );
-
+
return projectScmRootDao.addProjectScmRoot( projectScmRoot );
}
catch ( ContinuumStoreException e )
@@ -3605,6 +3667,20 @@
return false;
}
+ private boolean isAnyProjectsInReleaseStage( List<Project> projects )
+ throws ContinuumException
+ {
+ for ( Project project : projects )
+ {
+ if ( isProjectInReleaseStage( project ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
private Collection<Project> getProjectsNotInReleaseStage( Collection<Project> projectsList )
throws ContinuumException
{
@@ -3626,6 +3702,67 @@
return filteredProjectsList;
}
+ private void checkForDuplicateProjectInGroup( ProjectGroup projectGroup, Project projectToCheck,
+ ContinuumProjectBuildingResult result )
+ {
+ List<Project> projectsInGroup = projectGroup.getProjects();
+
+ if ( projectsInGroup == null )
+ {
+ return;
+ }
+
+ for ( Project project : projectGroup.getProjects() )
+ {
+ // projectToCheck is first in the equals check, as projectToCheck must be a Maven project and will have
+ // non-null values for each. project may be an Ant or Shell project and have null values.
+ if ( projectToCheck.getGroupId().equals( project.getGroupId() ) && projectToCheck.getArtifactId().equals(
+ project.getArtifactId() ) && projectToCheck.getVersion().equals( project.getVersion() ) )
+ {
+ result.addError( ContinuumProjectBuildingResult.ERROR_DUPLICATE_PROJECTS );
+ return;
+ }
+ }
+ }
+
+ private boolean isProjectOkToBuild( int projectId, int buildDefinitionId )
+ throws ContinuumException
+ {
+ if ( configurationService.isDistributedBuildEnabled() )
+ {
+ if ( !distributedBuildManager.isProjectInAnyPrepareBuildQueue( projectId, buildDefinitionId ) &&
+ !distributedBuildManager.isProjectInAnyBuildQueue( projectId, buildDefinitionId ) &&
+ !distributedBuildManager.isProjectCurrentlyPreparingBuild( projectId, buildDefinitionId ) &&
+ !distributedBuildManager.isProjectCurrentlyBuilding( projectId, buildDefinitionId ) )
+ {
+ return true;
+ }
+ }
+ else
+ {
+ try
+ {
+ if ( !parallelBuildsManager.isInAnyBuildQueue( projectId, buildDefinitionId ) &&
+ !parallelBuildsManager.isInAnyCheckoutQueue( projectId ) &&
+ !parallelBuildsManager.isInPrepareBuildQueue( projectId ) &&
+ !parallelBuildsManager.isProjectCurrentlyPreparingBuild( projectId ) )
+ {
+ if ( parallelBuildsManager.isInAnyCheckoutQueue( projectId ) )
+ {
+ parallelBuildsManager.removeProjectFromCheckoutQueue( projectId );
+ }
+
+ return true;
+ }
+ }
+ catch ( BuildManagerException e )
+ {
+ throw new ContinuumException( e.getMessage(), e );
+ }
+ }
+
+ return false;
+ }
void setTaskQueueManager( TaskQueueManager taskQueueManager )
{
this.taskQueueManager = taskQueueManager;
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java b/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
index c1e251b..d897779 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
@@ -82,7 +82,7 @@
*/
private Scheduler scheduler;
- //private int delay = 3600;
+ // private int delay = 3600;
private static final int delay = 1;
public void activateSchedules( Continuum continuum )
@@ -94,42 +94,27 @@
for ( Schedule schedule : schedules )
{
- if ( StringUtils.isEmpty( schedule.getCronExpression() ) )
+ if ( schedule.isActive() )
{
- // TODO: this can possibly be removed but it's here now to
- // weed out any bugs
- log.info( "Not scheduling " + schedule.getName() );
-
- continue;
- }
-
- try
- {
- // check schedule job class
- if ( isScheduleFromBuildJob( schedule ) )
- {
- schedule( schedule, continuum, ContinuumBuildJob.class );
- }
-
- if ( isScheduleFromPurgeJob( schedule ) )
- {
- schedule( schedule, continuum, ContinuumPurgeJob.class );
- }
- }
- catch ( SchedulesActivationException e )
- {
- log.error( "Can't activate schedule '" + schedule.getName() + "'", e );
-
- schedule.setActive( false );
-
try
{
- scheduleDao.storeSchedule( schedule );
+ activateSchedule( schedule, continuum );
}
- catch ( ContinuumStoreException e1 )
+ catch ( SchedulesActivationException e )
{
- throw new SchedulesActivationException( "Can't desactivate schedule '" + schedule.getName() + "'",
- e );
+ log.error( "Can't activate schedule '" + schedule.getName() + "'", e );
+
+ schedule.setActive( false );
+
+ try
+ {
+ scheduleDao.storeSchedule( schedule );
+ }
+ catch ( ContinuumStoreException e1 )
+ {
+ throw new SchedulesActivationException( "Can't desactivate schedule '" + schedule.getName()
+ + "'", e );
+ }
}
}
}
@@ -138,16 +123,31 @@
public void activateSchedule( Schedule schedule, Continuum continuum )
throws SchedulesActivationException
{
- log.info( "Activating schedule " + schedule.getName() );
-
- if ( isScheduleFromBuildJob( schedule ) )
+ if ( schedule != null )
{
- schedule( schedule, continuum, ContinuumBuildJob.class );
+ log.info( "Activating schedule " + schedule.getName() );
+
+ activateBuildSchedule( schedule, continuum );
+
+ activatePurgeSchedule( schedule, continuum );
}
+ }
- if ( isScheduleFromPurgeJob( schedule ) )
+ public void activateBuildSchedule( Schedule schedule, Continuum continuum )
+ throws SchedulesActivationException
+ {
+ if ( schedule != null && schedule.isActive() && isScheduleFromBuildJob( schedule ) )
{
- schedule( schedule, continuum, ContinuumPurgeJob.class );
+ schedule( schedule, continuum, ContinuumBuildJob.class, ContinuumBuildJob.BUILD_GROUP );
+ }
+ }
+
+ public void activatePurgeSchedule( Schedule schedule, Continuum continuum )
+ throws SchedulesActivationException
+ {
+ if ( schedule != null && schedule.isActive() && isScheduleFromPurgeJob( schedule ) )
+ {
+ schedule( schedule, continuum, ContinuumPurgeJob.class, ContinuumPurgeJob.PURGE_GROUP );
}
}
@@ -156,16 +156,50 @@
{
log.info( "Deactivating schedule " + schedule.getName() );
- unschedule( schedule );
+ unactivateBuildSchedule( schedule );
+ unactivatePurgeSchedule( schedule );
}
- protected void schedule( Schedule schedule, Continuum continuum, Class jobClass )
+ public void unactivateOrphanBuildSchedule( Schedule schedule )
throws SchedulesActivationException
{
- if ( !schedule.isActive() )
+ if ( schedule != null && !isScheduleFromBuildJob( schedule ) )
{
- log.info( "Schedule \"" + schedule.getName() + "\" is disabled." );
+ unactivateBuildSchedule( schedule );
+ }
+ }
+ public void unactivateOrphanPurgeSchedule( Schedule schedule )
+ throws SchedulesActivationException
+ {
+ if ( schedule != null && !isScheduleFromPurgeJob( schedule ) )
+ {
+ unactivatePurgeSchedule( schedule );
+ }
+ }
+
+ private void unactivateBuildSchedule( Schedule schedule )
+ throws SchedulesActivationException
+ {
+ log.debug( "Deactivating schedule " + schedule.getName() + " for Build Process" );
+
+ unschedule( schedule, ContinuumBuildJob.BUILD_GROUP );
+ }
+
+ private void unactivatePurgeSchedule( Schedule schedule )
+ throws SchedulesActivationException
+ {
+ log.debug( "Deactivating schedule " + schedule.getName() + " for Purge Process" );
+
+ unschedule( schedule, ContinuumPurgeJob.PURGE_GROUP );
+ }
+
+ protected void schedule( Schedule schedule, Continuum continuum, Class jobClass, String group )
+ throws SchedulesActivationException
+ {
+ if ( StringUtils.isEmpty( schedule.getCronExpression() ) )
+ {
+ log.info( "Not scheduling " + schedule.getName() );
return;
}
@@ -177,9 +211,9 @@
dataMap.put( ContinuumSchedulerConstants.SCHEDULE, schedule );
- //the name + group makes the job unique
+ // the name + group makes the job unique
- JobDetail jobDetail = new JobDetail( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP, jobClass );
+ JobDetail jobDetail = new JobDetail( schedule.getName(), group, jobClass );
jobDetail.setJobDataMap( dataMap );
@@ -189,7 +223,7 @@
trigger.setName( schedule.getName() );
- trigger.setGroup( org.quartz.Scheduler.DEFAULT_GROUP );
+ trigger.setGroup( group );
Date startTime = new Date( System.currentTimeMillis() + delay * 1000 );
@@ -218,7 +252,7 @@
}
}
- private void unschedule( Schedule schedule )
+ private void unschedule( Schedule schedule, String group )
throws SchedulesActivationException
{
try
@@ -227,10 +261,10 @@
{
log.info( "Stopping active schedule \"" + schedule.getName() + "\"." );
- scheduler.interruptSchedule( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP );
+ scheduler.interruptSchedule( schedule.getName(), group );
}
- scheduler.unscheduleJob( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP );
+ scheduler.unscheduleJob( schedule.getName(), group );
}
catch ( SchedulerException e )
{
@@ -241,7 +275,9 @@
private boolean isScheduleFromBuildJob( Schedule schedule )
{
List<BuildDefinition> buildDef = buildDefinitionDao.getBuildDefinitionsBySchedule( schedule.getId() );
-
+ // Take account templateBuildDefinition too.
+ // A improvement will be add schedule only for active buildDefinition, but it would need activate
+ // schedule job in add project and add group process
return buildDef.size() > 0;
}
@@ -249,9 +285,9 @@
private boolean isScheduleFromPurgeJob( Schedule schedule )
{
List<RepositoryPurgeConfiguration> repoPurgeConfigs =
- repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsBySchedule( schedule.getId() );
+ repositoryPurgeConfigurationDao.getEnableRepositoryPurgeConfigurationsBySchedule( schedule.getId() );
List<DirectoryPurgeConfiguration> dirPurgeConfigs =
- directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsBySchedule( schedule.getId() );
+ directoryPurgeConfigurationDao.getEnableDirectoryPurgeConfigurationsBySchedule( schedule.getId() );
return repoPurgeConfigs.size() > 0 || dirPurgeConfigs.size() > 0;
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
index 4a9ef64..b9950c2 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
@@ -19,6 +19,7 @@
* under the License.
*/
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
@@ -51,7 +52,7 @@
private ScmResult scmResult;
- private int trigger;
+ private BuildTrigger buildTrigger;
private BuildResult buildResult;
@@ -138,14 +139,14 @@
return actionContext;
}
- public int getTrigger()
+ public BuildTrigger getBuildTrigger()
{
- return trigger;
+ return buildTrigger;
}
- public void setTrigger( int trigger )
+ public void setBuildTrigger( BuildTrigger buildTrigger )
{
- this.trigger = trigger;
+ this.buildTrigger = buildTrigger;
}
public List<ProjectDependency> getModifiedDependencies()
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
index a6977de..7383172 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
@@ -19,6 +19,7 @@
* under the License.
*/
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.scm.ScmResult;
import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
@@ -30,6 +31,6 @@
{
String ROLE = BuildController.class.getName();
- void build( int projectId, int buildDefinitionId, int trigger, ScmResult scmResult )
+ void build( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, ScmResult scmResult )
throws TaskExecutionException;
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
index 1067e28..60d68c7 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
@@ -46,6 +46,6 @@
BuildProjectTask buildProjectTask = (BuildProjectTask) task;
controller.build( buildProjectTask.getProjectId(), buildProjectTask.getBuildDefinitionId(), buildProjectTask
- .getTrigger(), buildProjectTask.getScmResult() );
+ .getBuildTrigger(), buildProjectTask.getScmResult() );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
index f1e7aee..e956b32 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
@@ -27,11 +27,12 @@
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.continuum.dao.ProjectScmRootDao;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.utils.ContinuumUtils;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.ExecuteBuilderContinuumAction;
import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
@@ -39,7 +40,6 @@
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectDependency;
-import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.model.scm.ChangeFile;
import org.apache.maven.continuum.model.scm.ChangeSet;
import org.apache.maven.continuum.model.scm.ScmResult;
@@ -84,11 +84,6 @@
/**
* @plexus.requirement
*/
- private ProjectGroupDao projectGroupDao;
-
- /**
- * @plexus.requirement
- */
private ProjectScmRootDao projectScmRootDao;
/**
@@ -118,14 +113,15 @@
/**
* @param projectId
* @param buildDefinitionId
- * @param trigger
+ * @param buildTrigger
+ * @param scmResult
* @throws TaskExecutionException
*/
- public void build( int projectId, int buildDefinitionId, int trigger, ScmResult scmResult )
+ public void build( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, ScmResult scmResult )
throws TaskExecutionException
{
log.info( "Initializing build" );
- BuildContext context = initializeBuildContext( projectId, buildDefinitionId, trigger, scmResult );
+ BuildContext context = initializeBuildContext( projectId, buildDefinitionId, buildTrigger, scmResult );
// ignore this if AlwaysBuild ?
if ( !checkScmResult( context ) )
@@ -164,9 +160,9 @@
performAction( "deploy-artifact", context );
- context.setCancelled( (Boolean) actionContext.get( AbstractContinuumAction.KEY_CANCELLED ) );
+ context.setCancelled( ExecuteBuilderContinuumAction.isCancelled( actionContext ) );
- String s = AbstractContinuumAction.getBuildId( actionContext );
+ String s = AbstractContinuumAction.getBuildId( actionContext, null );
if ( s != null && !context.isCancelled() )
{
@@ -214,19 +210,14 @@
{
try
{
- String s = AbstractContinuumAction.getBuildId( context.getActionContext() );
+ String s = AbstractContinuumAction.getBuildId( context.getActionContext(), null );
if ( s != null )
{
BuildResult buildResult = buildResultDao.getBuildResult( Integer.valueOf( s ) );
project.setState( buildResult.getState() );
+ projectDao.updateProject( project );
}
- else
- {
- project.setState( ContinuumProjectState.ERROR );
- }
-
- projectDao.updateProject( project );
}
catch ( ContinuumStoreException e )
{
@@ -325,11 +316,12 @@
*
* @param projectId
* @param buildDefinitionId
- * @param trigger
+ * @param buildTrigger
+ * @param scmResult
* @return
* @throws TaskExecutionException
*/
- protected BuildContext initializeBuildContext( int projectId, int buildDefinitionId, int trigger,
+ protected BuildContext initializeBuildContext( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
ScmResult scmResult )
throws TaskExecutionException
{
@@ -337,10 +329,8 @@
context.setStartTime( System.currentTimeMillis() );
- context.setTrigger( trigger );
+ context.setBuildTrigger( buildTrigger );
- Map<String, Object> actionContext = context.getActionContext();
-
try
{
Project project = projectDao.getProject( projectId );
@@ -357,37 +347,6 @@
context.setOldBuildResult( oldBuildResult );
context.setScmResult( scmResult );
-
- // CONTINUUM-2193
- ProjectGroup projectGroup = project.getProjectGroup();
- List<ProjectScmRoot> scmRoots = projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
- String projectScmUrl = project.getScmUrl();
- String projectScmRootAddress = "";
-
- for ( ProjectScmRoot projectScmRoot : scmRoots )
- {
- projectScmRootAddress = projectScmRoot.getScmRootAddress();
- if ( projectScmUrl.contains( projectScmRoot.getScmRootAddress() ) )
- {
- actionContext.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, projectScmRoot.getScmRootAddress() );
- break;
- }
- }
-
- if( project.isCheckedOutInSingleDirectory() )
- {
- List<Project> projectsInGroup =
- projectGroupDao.getProjectGroupWithProjects( projectGroup.getId() ).getProjects();
- List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();
- for( Project projectInGroup : projectsInGroup )
- {
- if( projectInGroup.getScmUrl().contains( projectScmRootAddress ) )
- {
- projectsWithCommonScmRoot.add( projectInGroup );
- }
- }
- actionContext.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, projectsWithCommonScmRoot );
- }
// CONTINUUM-1871 olamy if continuum is killed during building oldBuildResult will have a endTime 0
// this means all changes since the project has been loaded in continuum will be in memory
@@ -403,23 +362,23 @@
throw new TaskExecutionException( "Error initializing the build context", e );
}
- actionContext.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ Map<String, Object> actionContext = context.getActionContext();
- actionContext.put( AbstractContinuumAction.KEY_PROJECT, context.getProject() );
+ AbstractContinuumAction.setProjectId( actionContext, projectId );
- actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
+ AbstractContinuumAction.setProject( actionContext, context.getProject() );
- actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, context.getBuildDefinition() );
+ AbstractContinuumAction.setBuildDefinitionId( actionContext, buildDefinitionId );
- actionContext.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
+ AbstractContinuumAction.setBuildDefinition( actionContext, context.getBuildDefinition() );
- actionContext.put( AbstractContinuumAction.KEY_FIRST_RUN, context.getOldBuildResult() == null );
+ AbstractContinuumAction.setBuildTrigger( actionContext, buildTrigger );
- actionContext.put( AbstractContinuumAction.KEY_SCM_RESULT, context.getScmResult() );
-
+ AbstractContinuumAction.setScmResult( actionContext, context.getScmResult() );
+
if ( context.getOldBuildResult() != null )
{
- actionContext.put( AbstractContinuumAction.KEY_OLD_BUILD_ID, context.getOldBuildResult().getId() );
+ AbstractContinuumAction.setOldBuildId( actionContext, context.getOldBuildResult().getId() );
}
return context;
@@ -495,7 +454,7 @@
}
if ( context.getOldBuildResult() == null )
{
- log.info( "The project was never be built with the current build definition, building" );
+ log.info( "The project has never been built with the current build definition, building" );
return true;
}
@@ -509,7 +468,7 @@
return true;
}
- if ( context.getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
+ if ( context.getBuildTrigger().getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
{
log.info( "The project build is forced, building" );
return true;
@@ -521,15 +480,18 @@
if ( project.getOldState() != ContinuumProjectState.NEW &&
project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
- context.getTrigger() != ContinuumProjectState.TRIGGER_FORCED &&
+ context.getBuildTrigger().getTrigger() != ContinuumProjectState.TRIGGER_FORCED &&
project.getState() != ContinuumProjectState.NEW && project.getState() != ContinuumProjectState.CHECKEDOUT )
{
// Check SCM changes
- allChangesUnknown = checkAllChangesUnknown( context.getScmResult().getChanges() );
+ if ( context.getScmResult() != null )
+ {
+ allChangesUnknown = checkAllChangesUnknown( context.getScmResult().getChanges() );
+ }
if ( allChangesUnknown )
{
- if ( !context.getScmResult().getChanges().isEmpty() )
+ if ( context.getScmResult() != null && !context.getScmResult().getChanges().isEmpty() )
{
log.info(
"The project was not built because all changes are unknown (maybe local modifications or ignored files not defined in your SCM tool." );
@@ -550,19 +512,24 @@
}
// Check changes
- if ( !shouldBuild && ( ( !allChangesUnknown && !context.getScmResult().getChanges().isEmpty() ) ||
+ if ( !shouldBuild && ( ( !allChangesUnknown && context.getScmResult() != null && !context.getScmResult().getChanges().isEmpty() ) ||
project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
{
try
{
ContinuumBuildExecutor executor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );
-
- Map<String, Object> actionContext = context.getActionContext();
- List<Project> projectsWithCommonScmRoot = AbstractContinuumAction.getListOfProjectsInGroupWithCommonScmRoot( actionContext );
- String projectScmRootUrl = AbstractContinuumAction.getString( actionContext, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
- shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(), project,
- workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot ), context.getBuildDefinition() );
+ if ( executor == null )
+ {
+ log.warn( "No continuum build executor found for project " + project.getId() +
+ " with executor '" + project.getExecutorId() + "'" );
+ }
+ else if ( context.getScmResult() != null )
+ {
+ shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(), project,
+ workingDirectoryService.getWorkingDirectory( project ),
+ context.getBuildDefinition() );
+ }
}
catch ( Exception e )
{
@@ -644,7 +611,7 @@
try
{
- Project project = projectDao.getProjectWithAllDetails( context.getProject().getId() );
+ Project project = projectDao.getProjectWithDependencies( context.getProject().getId() );
List<ProjectDependency> dependencies = project.getDependencies();
if ( dependencies == null )
@@ -671,10 +638,9 @@
if ( dependencyProject != null )
{
- List<BuildResult> buildResults =
- buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
- context.getOldBuildResult().getEndTime() );
- if ( buildResults != null && !buildResults.isEmpty() )
+ long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+ context.getOldBuildResult().getEndTime() );
+ if ( nbBuild > 0 )
{
log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
dep.getVersion() );
@@ -694,7 +660,7 @@
}
context.setModifiedDependencies( modifiedDependencies );
- context.getActionContext().put( AbstractContinuumAction.KEY_UPDATE_DEPENDENCIES, modifiedDependencies );
+ AbstractContinuumAction.setUpdatedDependencies( context.getActionContext(), modifiedDependencies );
}
catch ( ContinuumStoreException e )
{
@@ -716,7 +682,9 @@
build.setState( ContinuumProjectState.ERROR );
- build.setTrigger( context.getTrigger() );
+ build.setTrigger( context.getBuildTrigger().getTrigger() );
+
+ build.setUsername( context.getBuildTrigger().getUsername() );
build.setStartTime( context.getStartTime() );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java b/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
index bc67c79..ff26b10 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
@@ -195,6 +195,7 @@
storedBuildDefinition.setProfile( buildDefinition.getProfile() );
storedBuildDefinition.setSchedule( buildDefinition.getSchedule() );
storedBuildDefinition.setType( buildDefinition.getType() );
+ storedBuildDefinition.setUpdatePolicy( buildDefinition.getUpdatePolicy() );
buildDefinitionDao.storeBuildDefinition( storedBuildDefinition );
}
catch ( ContinuumStoreException e )
@@ -248,6 +249,7 @@
cloned.setSchedule( buildDefinition.getSchedule() );
cloned.setType( buildDefinition.getType() );
cloned.setTemplate( buildDefinition.isTemplate() );
+ cloned.setUpdatePolicy( buildDefinition.getUpdatePolicy() );
return cloned;
}
@@ -489,15 +491,20 @@
{
try
{
- BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
- stored.setName( buildDefinitionTemplate.getName() );
- stored.setBuildDefinitions( buildDefinitionTemplate.getBuildDefinitions() );
- return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
+ if ( !hasDuplicateTemplateName( buildDefinitionTemplate ) )
+ {
+ BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
+ stored.setName( buildDefinitionTemplate.getName() );
+ stored.setBuildDefinitions( buildDefinitionTemplate.getBuildDefinitions() );
+ return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
+ }
}
catch ( ContinuumStoreException e )
{
throw new BuildDefinitionServiceException( e.getMessage(), e );
}
+
+ return null;
}
public BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
@@ -505,12 +512,17 @@
{
try
{
- return buildDefinitionTemplateDao.addBuildDefinitionTemplate( buildDefinitionTemplate );
+ if ( !hasDuplicateTemplateName( buildDefinitionTemplate ) )
+ {
+ return buildDefinitionTemplateDao.addBuildDefinitionTemplate( buildDefinitionTemplate );
+ }
}
catch ( ContinuumStoreException e )
{
throw new BuildDefinitionServiceException( e.getMessage(), e );
}
+
+ return null;
}
public BuildDefinitionTemplate addBuildDefinitionInTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
@@ -645,4 +657,22 @@
throw new BuildDefinitionServiceException( e.getMessage(), e );
}
}
+
+ private boolean hasDuplicateTemplateName( BuildDefinitionTemplate buildDefinitionTemplate )
+ throws BuildDefinitionServiceException
+ {
+ boolean isDuplicate = false;
+ List<BuildDefinitionTemplate> allBuildDefinitionTemplate = this.getAllBuildDefinitionTemplate();
+
+ for ( BuildDefinitionTemplate template : allBuildDefinitionTemplate )
+ {
+ String name = buildDefinitionTemplate.getName();
+ if ( ( template.getId() != buildDefinitionTemplate.getId() ) && ( template.getName().equals( name ) ) )
+ {
+ isDuplicate = true;
+ break;
+ }
+ }
+ return isDuplicate;
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java b/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
index 1933849..fcde571 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
@@ -117,7 +117,7 @@
// If this build is forces, don't remove it
// ----------------------------------------------------------------------
- if ( task.getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
+ if ( task.getBuildTrigger().getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
{
continue;
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
index 3a237bb..91d0c29 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
@@ -170,6 +170,7 @@
storedDefinition.setArguments( buildDefinition.getArguments() );
storedDefinition.setBuildFile( buildDefinition.getBuildFile() );
storedDefinition.setBuildFresh( buildDefinition.isBuildFresh() );
+ storedDefinition.setUpdatePolicy( buildDefinition.getUpdatePolicy() );
// special case of this is resolved in the resolveDefaultBuildDefinitionsForProjectGroup method
storedDefinition.setDefaultForProject( buildDefinition.isDefaultForProject() );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
index 9f13f85..31dab4b 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
@@ -20,11 +20,11 @@
*/
import java.io.File;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
import org.apache.maven.continuum.model.project.Project;
@@ -44,78 +44,43 @@
// Keys for the values that can be in the context
// ----------------------------------------------------------------------
- public static final String KEY_PROJECT_ID = "project-id";
+ private static final String KEY_PROJECT_ID = "project-id";
- public static final String KEY_PROJECT = "project";
+ private static final String KEY_PROJECT = "project";
- public static final String KEY_PROJECTS = "projects";
+ private static final String KEY_PROJECTS = "projects";
- public static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
+ private static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
- public static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
+ private static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
- public static final String KEY_BUILD_DEFINITION = "build-definition";
+ private static final String KEY_BUILD_DEFINITION = "build-definition";
- public static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
+ private static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
- public static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
+ private static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
- public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+ private static final String KEY_PROJECT_GROUP_ID = "project-group-id";
- public static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
+ private static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
- public static final String KEY_BUILD_ID = "build-id";
+ private static final String KEY_BUILD_ID = "build-id";
- public static final String KEY_WORKING_DIRECTORY = "working-directory";
+ private static final String KEY_WORKING_DIRECTORY = "working-directory";
- public static final String KEY_WORKING_DIRECTORY_EXISTS = "working-directory-exists";
+ private static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
- public static final String KEY_CHECKOUT_SCM_RESULT = "checkout-result";
+ private static final String KEY_BUILD_TRIGGER = "buildTrigger";
- public static final String KEY_UPDATE_SCM_RESULT = "update-result";
+ private static final String KEY_SCM_RESULT = "scmResult";
- public static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
+ private static final String KEY_OLD_SCM_RESULT = "old-scmResult";
- public static final String KEY_TRIGGER = "trigger";
+ private static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
- public static final String KEY_FIRST_RUN = "first-run";
+ private static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
- public static final String KEY_PROJECT_RELATIVE_PATH = "project-relative-path";
-
- public static final String KEY_SCM_USE_CREDENTIALS_CACHE = "useCredentialsCache";
-
- public static final String KEY_SCM_USERNAME = "scmUserName";
-
- public static final String KEY_SCM_PASSWORD = "scmUserPassword";
-
- public static final String KEY_SCM_RESULT = "scmResult";
-
- public static final String KEY_OLD_SCM_RESULT = "old-scmResult";
-
- public static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
-
- /**
- * SCM root url. Used in these actions add-project-to-checkout-queue, checkout-project, clean-working-directory,
- * create-projects-from-metadata, update-project-from-working-directory,
- * update-working-directory-from-scm
- */
- public static final String KEY_PROJECT_SCM_ROOT_URL = "projectScmRootUrl";
-
- public static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
-
- public static final String KEY_CANCELLED = "cancelled";
-
- public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
-
- /**
- * Metadata url for adding projects.
- */
- public static final String KEY_URL = "url";
-
- /**
- * List of projects in a project group with a common scm root url.
- */
- public static final String KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT = "projects-in-group-with-common-scm-root";
+ private static final String KEY_SCM_RESULT_MAP = "scm-result-map";
// ----------------------------------------------------------------------
//
@@ -126,39 +91,90 @@
return getInteger( context, KEY_PROJECT_ID );
}
+ public static void setProjectId( Map<String, Object> context, int projectId )
+ {
+ context.put( KEY_PROJECT_ID, projectId );
+ }
+
public static Project getProject( Map<String, Object> context )
{
return (Project) getObject( context, KEY_PROJECT );
}
+ public static Project getProject( Map<String, Object> context, Project defaultValue )
+ {
+ return (Project) getObject( context, KEY_PROJECT, defaultValue );
+ }
+
+ public static void setProject( Map<String, Object> context, Project p )
+ {
+ context.put( KEY_PROJECT, p );
+ }
+
public static int getProjectGroupId( Map<String, Object> context )
{
return getInteger( context, KEY_PROJECT_GROUP_ID );
}
+ public static void setProjectGroupId( Map<String, Object> context, int projectGroupId )
+ {
+ context.put( KEY_PROJECT_GROUP_ID, projectGroupId );
+ }
+
public static BuildDefinitionTemplate getBuildDefinitionTemplate( Map<String, Object> context )
{
return (BuildDefinitionTemplate) getObject( context, KEY_BUILD_DEFINITION_TEMPLATE, null );
}
+ public static void setBuildDefinitionTemplate( Map<String, Object> context, BuildDefinitionTemplate bdt )
+ {
+ context.put( KEY_BUILD_DEFINITION_TEMPLATE, bdt );
+ }
+
public static BuildDefinition getBuildDefinition( Map<String, Object> context )
{
return (BuildDefinition) getObject( context, KEY_BUILD_DEFINITION, null );
}
+ public static void setBuildDefinition( Map<String, Object> context, BuildDefinition bd )
+ {
+ context.put( KEY_BUILD_DEFINITION, bd );
+ }
+
public static int getBuildDefinitionId( Map<String, Object> context )
{
return getInteger( context, KEY_BUILD_DEFINITION_ID );
}
+ public static void setBuildDefinitionId( Map<String, Object> context, int buildDefintionId )
+ {
+ context.put( KEY_BUILD_DEFINITION_ID, buildDefintionId );
+ }
+
public static String getBuildId( Map<String, Object> context )
{
return getString( context, KEY_BUILD_ID );
}
- public static int getTrigger( Map<String, Object> context )
+ public static String getBuildId( Map<String, Object> context, String defaultValue )
{
- return getInteger( context, KEY_TRIGGER );
+ return getString( context, KEY_BUILD_ID, defaultValue );
+ }
+
+ public static void setBuildId( Map<String, Object> context, String buildId )
+ {
+ context.put( KEY_BUILD_ID, buildId );
+ }
+
+ public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+ {
+ BuildTrigger defaultValue = new BuildTrigger( 0, "" );
+ return (BuildTrigger) getObject( context, KEY_BUILD_TRIGGER, defaultValue );
+ }
+
+ public static void setBuildTrigger( Map<String, Object> context, BuildTrigger buildTrigger )
+ {
+ context.put( KEY_BUILD_TRIGGER, buildTrigger );
}
public static Project getUnvalidatedProject( Map<String, Object> context )
@@ -166,29 +182,29 @@
return (Project) getObject( context, KEY_UNVALIDATED_PROJECT );
}
+ public static void setUnvalidatedProject( Map<String, Object> context, Project p )
+ {
+ context.put( KEY_UNVALIDATED_PROJECT, p );
+ }
+
public static ProjectGroup getUnvalidatedProjectGroup( Map<String, Object> context )
{
return (ProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP );
}
+ public static void setUnvalidatedProjectGroup( Map<String, Object> context, ProjectGroup pg )
+ {
+ context.put( KEY_UNVALIDATED_PROJECT_GROUP, pg );
+ }
+
public static File getWorkingDirectory( Map<String, Object> context )
{
return new File( getString( context, KEY_WORKING_DIRECTORY ) );
}
- public static ScmResult getCheckoutResult( Map<String, Object> context, Object defaultValue )
+ public static void setWorkingDirectory( Map<String, Object> context, String workingDirectory )
{
- return (ScmResult) getObject( context, KEY_CHECKOUT_SCM_RESULT, defaultValue );
- }
-
- public static ScmResult getUpdateScmResult( Map<String, Object> context )
- {
- return getUpdateScmResult( context, null );
- }
-
- public static ScmResult getUpdateScmResult( Map<String, Object> context, ScmResult defaultValue )
- {
- return (ScmResult) getObject( context, KEY_UPDATE_SCM_RESULT, defaultValue );
+ context.put( KEY_WORKING_DIRECTORY, workingDirectory );
}
public static List<ProjectDependency> getUpdatedDependencies( Map<String, Object> context )
@@ -202,6 +218,11 @@
return (List<ProjectDependency>) getObject( context, KEY_UPDATE_DEPENDENCIES, defaultValue );
}
+ public static void setUpdatedDependencies( Map<String, Object> context, List<ProjectDependency> dependencies )
+ {
+ context.put( KEY_UPDATE_DEPENDENCIES, dependencies );
+ }
+
public static ScmResult getScmResult( Map<String, Object> context )
{
return getScmResult( context, null );
@@ -212,6 +233,11 @@
return (ScmResult) getObject( context, KEY_SCM_RESULT, defaultValue );
}
+ public static void setScmResult( Map<String, Object> context, ScmResult scmResult )
+ {
+ context.put( KEY_SCM_RESULT, scmResult );
+ }
+
public static ScmResult getOldScmResult( Map<String, Object> context )
{
return getOldScmResult( context, null );
@@ -222,47 +248,72 @@
return (ScmResult) getObject( context, KEY_OLD_SCM_RESULT, defaultValue );
}
+ public static void setOldScmResult( Map<String, Object> context, ScmResult oldScmResult )
+ {
+ context.put( KEY_OLD_SCM_RESULT, oldScmResult );
+ }
+
public static ProjectScmRoot getProjectScmRoot( Map<String, Object> context )
{
return (ProjectScmRoot) getObject( context, KEY_PROJECT_SCM_ROOT );
}
+ public static void setProjectScmRoot( Map<String, Object> context, ProjectScmRoot projectScmRoot )
+ {
+ context.put( KEY_PROJECT_SCM_ROOT, projectScmRoot );
+ }
+
public static int getOldBuildId( Map<String, Object> context )
{
return getInteger( context, KEY_OLD_BUILD_ID );
}
+ public static void setOldBuildId( Map<String, Object> context, int oldBuildId )
+ {
+ context.put( KEY_OLD_BUILD_ID, oldBuildId );
+ }
+
public static List<Project> getListOfProjects( Map<String, Object> context )
{
return (List<Project>) getObject( context, KEY_PROJECTS );
}
+ public static void setListOfProjects( Map<String, Object> context, List<Project> projects )
+ {
+ context.put( KEY_PROJECTS, projects );
+ }
+
public static Map<Integer, BuildDefinition> getProjectsBuildDefinitionsMap( Map<String, Object> context )
{
return (Map<Integer, BuildDefinition>) getObject( context, KEY_PROJECTS_BUILD_DEFINITIONS_MAP );
}
+ public static void setProjectsBuildDefinitionsMap( Map<String, Object> context,
+ Map<Integer, BuildDefinition> projectsBuildDefinitionsMap )
+ {
+ context.put( KEY_PROJECTS_BUILD_DEFINITIONS_MAP, projectsBuildDefinitionsMap );
+ }
+
public static Map<Integer, ScmResult> getScmResultMap( Map<String, Object> context )
{
return (Map<Integer, ScmResult>) getObject( context, KEY_SCM_RESULT_MAP );
}
-
- public static List<Project> getListOfProjectsInGroupWithCommonScmRoot( Map<String, Object> context )
+
+ public static void setScmResultMap( Map<String, Object> context, Map<Integer, ScmResult> scmResultMap )
{
- return (List<Project>) getObject( context, KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, new ArrayList<Integer>() );
+ context.put( KEY_SCM_RESULT_MAP, scmResultMap );
}
-
-
+
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
- public static String getString( Map<String, Object> context, String key )
+ protected static String getString( Map<String, Object> context, String key )
{
return (String) getObject( context, key );
}
- public static String getString( Map<String, Object> context, String key, String defaultValue )
+ protected static String getString( Map<String, Object> context, String key, String defaultValue )
{
return (String) getObject( context, key, defaultValue );
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
index 4d47e7e..f7eb582 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
@@ -19,6 +19,8 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -26,8 +28,6 @@
import org.codehaus.plexus.redback.role.RoleManager;
import org.codehaus.plexus.redback.role.RoleManagerException;
-import java.util.Map;
-
/**
* AddAssignableRolesAction:
*
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
index a246ee2..6d38627 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
@@ -39,13 +39,13 @@
*/
private ProjectDao projectDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- int projectId = getProjectId( map );
+ int projectId = getProjectId( context );
Project project = projectDao.getProjectWithAllDetails( projectId );
- BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
+ BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
if ( buildDefinitionTemplate != null )
{
@@ -55,23 +55,23 @@
project.addBuildDefinition( buildDefinition );
- projectDao.updateProject( project );
if ( buildDefinition.isDefaultForProject() )
{
- map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
}
}
}
else
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
resolveDefaultBuildDefinitionsForProject( buildDefinition, project );
project.addBuildDefinition( buildDefinition );
- projectDao.updateProject( project );
- map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
}
+ // Save the project
+ projectDao.updateProject( project );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
index c0454dd..ebbeaf4 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
@@ -44,12 +44,12 @@
private ProjectGroupDao projectGroupDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- int projectGroupId = getProjectGroupId( map );
+ int projectGroupId = getProjectGroupId( context );
ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
- BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
+ BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
if ( buildDefinitionTemplate != null )
{
for ( BuildDefinition buildDefinition : (List<BuildDefinition>) buildDefinitionTemplate.getBuildDefinitions() )
@@ -57,20 +57,20 @@
resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
projectGroup.addBuildDefinition( buildDefinition );
-
- projectGroupDao.updateProjectGroup( projectGroup );
}
}
else
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
projectGroup.addBuildDefinition( buildDefinition );
-
- projectGroupDao.updateProjectGroup( projectGroup );
}
+
+ // Save the project group
+ projectGroupDao.updateProjectGroup( projectGroup );
+
//map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
index cd66d86..eaaf428 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
@@ -21,6 +21,7 @@
import java.util.Map;
+import org.apache.commons.lang.StringUtils;
import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -55,18 +56,28 @@
public void execute( Map context )
throws Exception
{
- Project project = (Project) getObject( context, KEY_PROJECT, null );
+ Project project = getProject( context, null );
if ( project == null )
{
project = projectDao.getProject( getProjectId( context ) );
}
- String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, null );
+ String scmUsername = project.getScmUsername();
+ String scmPassword = project.getScmPassword();
+
+ if( scmUsername == null || StringUtils.isEmpty( scmUsername ) )
+ {
+ scmUsername = CheckoutProjectContinuumAction.getScmUsername( context, null );
+ }
+
+ if( scmPassword == null || StringUtils.isEmpty( scmPassword ) )
+ {
+ scmPassword = CheckoutProjectContinuumAction.getScmPassword( context, null );
+ }
BuildDefinition defaultBuildDefinition = getBuildDefinition( context );
parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
workingDirectoryService.getWorkingDirectory( project ),
- scmRootUrl, project.getScmUsername(),
- project.getScmPassword(), defaultBuildDefinition, getListOfProjectsInGroupWithCommonScmRoot( context ) );
+ scmUsername, scmPassword, defaultBuildDefinition );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
index ca113df..334a83d 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
@@ -20,10 +20,10 @@
*/
import java.io.File;
-import java.util.List;
import java.util.Map;
import org.apache.continuum.dao.ProjectDao;
+import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.utils.WorkingDirectoryService;
@@ -35,7 +35,9 @@
*/
public class CheckWorkingDirectoryAction
extends AbstractContinuumAction
-{
+{
+ private static final String KEY_WORKING_DIRECTORY_EXISTS = "working-directory-exists";
+
/**
* @plexus.requirement
*/
@@ -50,22 +52,36 @@
throws Exception
{
Project project = projectDao.getProject( getProjectId( context ) );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
-
- File workingDirectory =
- workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
- projectsWithCommonScmRoot );
-
+
+ File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+
if ( !workingDirectory.exists() )
{
- context.put( KEY_WORKING_DIRECTORY_EXISTS, Boolean.FALSE );
+ setWorkingDirectoryExist( context, false );
return;
}
File[] files = workingDirectory.listFiles();
- context.put( KEY_WORKING_DIRECTORY_EXISTS, files.length > 0 );
+ if ( files == null )
+ {
+ //workingDirectory isn't a directory but a file. Not possible in theory.
+ String msg = workingDirectory.getAbsolutePath() + " isn't a directory but a file.";
+ getLogger().error( msg );
+ throw new ContinuumException( msg );
+ }
+
+ setWorkingDirectoryExist( context, files.length > 0 );
+ }
+
+ public static boolean isWorkingDirectoryExist( Map<String, Object> context )
+ {
+ return getBoolean( context, KEY_WORKING_DIRECTORY_EXISTS );
+ }
+
+ private static void setWorkingDirectoryExist( Map<String, Object> context, boolean exists )
+ {
+ context.put( KEY_WORKING_DIRECTORY_EXISTS, exists );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
index 96b6d74..b39adf3 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
@@ -49,6 +49,14 @@
public class CheckoutProjectContinuumAction
extends AbstractContinuumAction
{
+ private static final String KEY_SCM_USERNAME = "scmUserName";
+
+ private static final String KEY_SCM_PASSWORD = "scmUserPassword";
+
+ private static final String KEY_CHECKOUT_SCM_RESULT = "checkout-result";
+
+ private static final String KEY_PROJECT_RELATIVE_PATH = "project-relative-path";
+
/**
* @plexus.requirement
*/
@@ -71,7 +79,7 @@
public void execute( Map context )
throws ContinuumStoreException
- {
+ {
Project project = projectDao.getProject( getProject( context ).getId() );
BuildDefinition buildDefinition = getBuildDefinition( context );
@@ -81,6 +89,8 @@
buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinition.getId() );
}
+ int originalState = project.getState();
+
project.setState( ContinuumProjectState.CHECKING_OUT );
projectDao.updateProject( project );
@@ -93,16 +103,12 @@
ScmResult result;
- List<Project> projectsWithSimilarScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
-
try
{
- String scmUserName = getString( context, KEY_SCM_USERNAME, project.getScmUsername() );
- String scmPassword = getString( context, KEY_SCM_PASSWORD, project.getScmPassword() );
- String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
-
+ String scmUserName = getScmUsername( context, project.getScmUsername() );
+ String scmPassword = getScmPassword( context, project.getScmPassword() );
ContinuumScmConfiguration config =
- createScmConfiguration( project, workingDirectory, scmUserName, scmPassword, scmRootUrl );
+ createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
String tag = config.getTag();
getLogger().info(
@@ -110,13 +116,11 @@
workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
CheckOutScmResult checkoutResult = scm.checkout( config );
-
if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
{
- context.put( AbstractContinuumAction.KEY_PROJECT_RELATIVE_PATH,
- checkoutResult.getRelativePathProjectDirectory() );
+ context.put( KEY_PROJECT_RELATIVE_PATH, checkoutResult.getRelativePathProjectDirectory() );
}
-
+
if ( !checkoutResult.isSuccess() )
{
// TODO: is it more appropriate to return this in the converted result so that it can be presented to
@@ -182,41 +186,37 @@
}
finally
{
- String relativePath = (String) getObject( context, KEY_PROJECT_RELATIVE_PATH, "" );
+ String relativePath = getString( context, KEY_PROJECT_RELATIVE_PATH, "" );
if ( StringUtils.isNotEmpty( relativePath ) )
{
project.setRelativePath( relativePath );
}
project = projectDao.getProject( project.getId() );
-
- project.setState( ContinuumProjectState.CHECKEDOUT );
+
+ if ( originalState == ContinuumProjectState.NEW )
+ {
+ project.setState( ContinuumProjectState.CHECKEDOUT );
+ }
+ else
+ {
+ project.setState( originalState );
+ }
projectDao.updateProject( project );
-
- // update state of sub-projects
- // if multi-module project was checked out in a single directory, these must not be null
- for( Project projectWithCommonScmRoot : projectsWithSimilarScmRoot )
- {
- projectWithCommonScmRoot = projectDao.getProject( projectWithCommonScmRoot.getId() );
- if( projectWithCommonScmRoot != null && projectWithCommonScmRoot.getId() != project.getId() )
- {
- projectWithCommonScmRoot.setState( ContinuumProjectState.CHECKEDOUT );
- projectDao.updateProject( projectWithCommonScmRoot );
- }
- }
+
notifier.checkoutComplete( project, buildDefinition );
}
- context.put( KEY_CHECKOUT_SCM_RESULT, result );
- context.put( KEY_PROJECT, project );
+ setCheckoutResult( context, result );
+ setProject( context, project );
}
private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory,
- String scmUserName, String scmPassword, String scmRootUrl )
+ String scmUserName, String scmPassword )
{
ContinuumScmConfiguration config = new ContinuumScmConfiguration();
- config.setUrl( scmRootUrl );
+ config.setUrl( project.getScmUrl() );
config.setUsername( scmUserName );
config.setPassword( scmPassword );
config.setUseCredentialsCache( project.isScmUseCache() );
@@ -282,4 +282,34 @@
}
return message.toString();
}
+
+ public static String getScmUsername( Map<String, Object> context, String defaultValue )
+ {
+ return getString( context, KEY_SCM_USERNAME, defaultValue );
+ }
+
+ public static void setScmUsername( Map<String, Object> context, String scmUsername )
+ {
+ context.put( KEY_SCM_USERNAME, scmUsername );
+ }
+
+ public static String getScmPassword( Map<String, Object> context, String defaultValue )
+ {
+ return getString( context, KEY_SCM_PASSWORD, defaultValue );
+ }
+
+ public static void setScmPassword( Map<String, Object> context, String scmPassword )
+ {
+ context.put( KEY_SCM_PASSWORD, scmPassword );
+ }
+
+ public static ScmResult getCheckoutResult( Map<String, Object> context, Object defaultValue )
+ {
+ return (ScmResult) getObject( context, KEY_CHECKOUT_SCM_RESULT, defaultValue );
+ }
+
+ public static void setCheckoutResult( Map<String, Object> context, ScmResult checkoutResult )
+ {
+ context.put( KEY_CHECKOUT_SCM_RESULT, checkoutResult );
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
index bfee441..3419f87 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
@@ -26,7 +26,6 @@
import org.apache.maven.shared.model.fileset.util.FileSetManager;
import java.io.File;
-import java.util.List;
import java.util.Map;
/**
@@ -52,12 +51,8 @@
throws Exception
{
Project project = projectDao.getProject( getProjectId( context ) );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
- File workingDirectory =
- workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
- projectsWithCommonScmRoot );
+ File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
if ( workingDirectory.exists() )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
index c60b09c..70a3b33 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
@@ -25,6 +25,7 @@
import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -50,28 +51,28 @@
* @plexus.requirement
*/
private ProjectDao projectDao;
-
+
/**
* @plexus.requirement role-hint="parallel"
*/
private BuildsManager parallelBuildsManager;
-
+
public synchronized void execute( Map context )
throws Exception
{
List<Project> projects = AbstractContinuumAction.getListOfProjects( context );
Map<Integer, BuildDefinition> projectsBuildDefinitionsMap =
AbstractContinuumAction.getProjectsBuildDefinitionsMap( context );
- Map<Integer, ScmResult> scmResultMap =
- AbstractContinuumAction.getScmResultMap( context );
+ Map<Integer, ScmResult> scmResultMap = AbstractContinuumAction.getScmResultMap( context );
List<Project> projectsToBeBuilt = new ArrayList<Project>();
- int trigger = AbstractContinuumAction.getTrigger( context );
-
+ BuildTrigger buildTrigger = AbstractContinuumAction.getBuildTrigger( context );
+ int projectGroupId = AbstractContinuumAction.getProjectGroupId( context );
+
// update state of each project first
- for( Project project : projects )
- {
+ for ( Project project : projects )
+ {
BuildDefinition buildDefinition = projectsBuildDefinitionsMap.get( project.getId() );
-
+
if ( parallelBuildsManager.isInAnyBuildQueue( project.getId(), buildDefinition.getId() ) )
{
return;
@@ -81,12 +82,13 @@
{
parallelBuildsManager.removeProjectFromCheckoutQueue( project.getId() );
}
-
+
try
{
if ( project.getState() != ContinuumProjectState.NEW &&
project.getState() != ContinuumProjectState.CHECKEDOUT &&
- project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
+ project.getState() != ContinuumProjectState.OK &&
+ project.getState() != ContinuumProjectState.FAILED &&
project.getState() != ContinuumProjectState.ERROR )
{
ContinuumBuildExecutor executor = executorManager.getBuildExecutor( project.getExecutorId() );
@@ -100,25 +102,16 @@
}
else
{
- project.setOldState( project.getState() );
-
project.setState( ContinuumProjectState.ERROR );
-
- projectDao.updateProject( project );
-
- project = projectDao.getProject( project.getId() );
}
}
- else
- {
- project.setOldState( project.getState() );
+ project.setOldState( project.getState() );
- projectDao.updateProject( project );
+ projectDao.updateProject( project );
- project = projectDao.getProject( project.getId() );
- }
+ project = projectDao.getProject( project.getId() );
- projectsToBeBuilt.add( project );
+ projectsToBeBuilt.add( project );
}
catch ( ContinuumStoreException e )
{
@@ -126,7 +119,8 @@
//throw new ContinuumException( "Error while creating build object.", e );
}
}
-
- parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap, trigger, scmResultMap );
+
+ parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap, buildTrigger, scmResultMap,
+ projectGroupId );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
index 9eeddd3..e53ec99 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
@@ -61,6 +61,14 @@
public class CreateProjectsFromMetadataAction
extends AbstractContinuumAction
{
+ private static final String KEY_URL = "url";
+
+ private static final String KEY_PROJECT_BUILDER_ID = "builderId";
+
+ private static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
+
+ private static final String KEY_LOAD_RECURSIVE_PROJECTS = "loadRecursiveProjects";
+
/**
* @plexus.requirement
*/
@@ -70,30 +78,20 @@
* @plexus.requirement
*/
private MavenSettingsBuilder mavenSettingsBuilder;
-
+
/**
* @plexus.requirement role-hint="continuumUrl"
*/
- private ContinuumUrlValidator urlValidator;
-
- public static final String KEY_PROJECT_BUILDER_ID = "builderId";
-
- public static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
-
- public static final String KEY_LOAD_RECURSIVE_PROJECTS = "loadRecursiveProjects";
-
- public static final String KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY = "checkoutProjectsInSingleDirectory";
+ private ContinuumUrlValidator urlValidator;
public void execute( Map context )
throws ContinuumException, ContinuumProjectBuilderManagerException, ContinuumProjectBuilderException
{
- String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID );
+ String projectBuilderId = getProjectBuilderId( context );
- boolean loadRecursiveProjects = getBoolean( context, KEY_LOAD_RECURSIVE_PROJECTS );
-
- boolean checkoutProjectsInSingleDirectory = getBoolean( context, KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY );
+ boolean loadRecursiveProjects = isLoadRecursiveProject( context );
- String curl = getString( context, KEY_URL );
+ String curl = getUrl( context );
URL url;
@@ -107,13 +105,13 @@
if ( buildDefinitionTemplate == null )
{
buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
- }
+ }
if ( !curl.startsWith( "http" ) )
{
url = new URL( curl );
result = projectBuilder.buildProjectsFromMetadata( url, null, null, loadRecursiveProjects,
- buildDefinitionTemplate, checkoutProjectsInSingleDirectory );
+ buildDefinitionTemplate );
}
else
@@ -152,7 +150,7 @@
{
result = projectBuilder.buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
- buildDefinitionTemplate, checkoutProjectsInSingleDirectory );
+ buildDefinitionTemplate );
}
else
@@ -162,11 +160,11 @@
result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
}
}
-
+
if ( result.getProjects() != null )
{
String scmRootUrl = getScmRootUrl( result.getProjects() );
-
+
if ( scmRootUrl == null || scmRootUrl.equals( "" ) )
{
if ( curl.indexOf( "pom.xml" ) > 0 )
@@ -178,8 +176,8 @@
scmRootUrl = curl;
}
}
-
- context.put( KEY_PROJECT_SCM_ROOT_URL, scmRootUrl );
+
+ setUrl( context, scmRootUrl );
}
}
catch ( MalformedURLException e )
@@ -195,7 +193,7 @@
result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
}
- context.put( KEY_PROJECT_BUILDING_RESULT, result );
+ setProjectBuildingResult( context, result );
}
private String hidePasswordInUrl( String url )
@@ -235,14 +233,14 @@
private String getScmRootUrl( List<Project> projects )
{
String scmRootUrl = "";
-
+
for ( Project project : projects )
{
String scmUrl = project.getScmUrl();
-
+
scmRootUrl = getCommonPath( scmUrl, scmRootUrl );
}
-
+
return scmRootUrl;
}
@@ -255,7 +253,19 @@
else
{
int indexDiff = StringUtils.differenceAt( path1, path2 );
- return path1.substring( 0, indexDiff );
+ String commonPath = path1.substring( 0, indexDiff );
+
+ if ( commonPath.lastIndexOf( '/' ) != commonPath.length() - 1 &&
+ !( path1.contains( new String( commonPath + "/" ) ) ||
+ path2.contains( new String( commonPath + "/" ) ) ) )
+ {
+ while ( commonPath.lastIndexOf( '/' ) != commonPath.length() - 1 )
+ {
+ commonPath = commonPath.substring( 0, commonPath.length() - 1 );
+ }
+ }
+
+ return commonPath;
}
}
@@ -288,4 +298,44 @@
{
this.urlValidator = urlValidator;
}
+
+ public static ContinuumProjectBuildingResult getProjectBuildingResult( Map<String, Object> context )
+ {
+ return (ContinuumProjectBuildingResult) getObject( context, KEY_PROJECT_BUILDING_RESULT );
+ }
+
+ private static void setProjectBuildingResult( Map<String, Object> context, ContinuumProjectBuildingResult result )
+ {
+ context.put( KEY_PROJECT_BUILDING_RESULT, result );
+ }
+
+ public static String getUrl( Map<String, Object> context )
+ {
+ return getString( context, KEY_URL );
+ }
+
+ public static void setUrl( Map<String, Object> context, String url )
+ {
+ context.put( KEY_URL, url );
+ }
+
+ public static String getProjectBuilderId( Map<String, Object> context )
+ {
+ return getString( context, KEY_PROJECT_BUILDER_ID );
+ }
+
+ public static void setProjectBuilderId( Map<String, Object> context, String projectBuilderId )
+ {
+ context.put( KEY_PROJECT_BUILDER_ID, projectBuilderId );
+ }
+
+ public static boolean isLoadRecursiveProject( Map<String, Object> context )
+ {
+ return getBoolean( context, KEY_LOAD_RECURSIVE_PROJECTS );
+ }
+
+ public static void setLoadRecursiveProject( Map<String, Object> context, boolean loadRecursiveProject )
+ {
+ context.put( KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProject );
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
index b359150..46bfe70 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
@@ -19,6 +19,10 @@
* under the License.
*/
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
import org.apache.continuum.model.repository.LocalRepository;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.deployer.ArtifactDeployer;
@@ -35,11 +39,6 @@
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.utils.WorkingDirectoryService;
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
/**
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
@@ -103,19 +102,16 @@
{
BuildDefinition buildDefinition = getBuildDefinition( context );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
-
List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
- workingDirectoryService.getWorkingDirectory(
- project, projectScmRootUrl, projectsWithCommonScmRoot ), buildDefinition );
+ workingDirectoryService.getWorkingDirectory(
+ project ), buildDefinition );
LocalRepository repository = project.getProjectGroup().getLocalRepository();
-
+
builderHelper.setLocalRepository( repository );
-
+
ArtifactRepository localRepository = builderHelper.getLocalRepository();
-
+
for ( Artifact artifact : artifacts )
{
ArtifactRepositoryLayout repositoryLayout = new DefaultRepositoryLayout();
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
index e6ce0fa..3c3bf92 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
@@ -27,6 +27,7 @@
import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.utils.ContinuumUtils;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.execution.ContinuumBuildCancelledException;
import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
@@ -49,6 +50,8 @@
public class ExecuteBuilderContinuumAction
extends AbstractContinuumAction
{
+ private static final String KEY_CANCELLED = "cancelled";
+
/**
* @plexus.requirement
*/
@@ -85,7 +88,7 @@
BuildDefinition buildDefinition = getBuildDefinition( context );
- int trigger = getTrigger( context );
+ BuildTrigger buildTrigger = getBuildTrigger( context );
ScmResult scmResult = getScmResult( context );
@@ -103,7 +106,9 @@
buildResult.setState( ContinuumProjectState.BUILDING );
- buildResult.setTrigger( trigger );
+ buildResult.setTrigger( buildTrigger.getTrigger() );
+
+ buildResult.setUsername( buildTrigger.getUsername() );
buildResult.setScmResult( scmResult );
@@ -113,9 +118,9 @@
buildResultDao.addBuildResult( project, buildResult );
- context.put( KEY_BUILD_ID, Integer.toString( buildResult.getId() ) );
+ AbstractContinuumAction.setBuildId( context, Integer.toString( buildResult.getId() ) );
- context.put( KEY_CANCELLED, false );
+ setCancelled( context, false );
buildResult = buildResultDao.getBuildResult( buildResult.getId() );
@@ -137,7 +142,7 @@
buildResult.setState( ContinuumProjectState.CANCELLED );
- context.put( KEY_CANCELLED, true );
+ setCancelled( context, true );
}
catch ( Throwable e )
{
@@ -196,18 +201,25 @@
notifier.goalsCompleted( project, buildDefinition, buildResult );
}
- context.put( KEY_PROJECT, project );
+ AbstractContinuumAction.setProject( context, project );
projectDao.updateProject( project );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
-
// ----------------------------------------------------------------------
// Backup test result files
// ----------------------------------------------------------------------
//TODO: Move as a plugin
- buildExecutor.backupTestFiles( project, buildResult.getId(), projectScmRootUrl, projectsWithCommonScmRoot );
+ buildExecutor.backupTestFiles( project, buildResult.getId() );
}
}
+
+ public static boolean isCancelled( Map<String, Object> context )
+ {
+ return getBoolean( context, KEY_CANCELLED );
+ }
+
+ private static void setCancelled( Map<String, Object> context, boolean cancelled )
+ {
+ context.put( KEY_CANCELLED, cancelled );
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
index 427f26b..df5fb40 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
@@ -19,6 +19,8 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -26,8 +28,6 @@
import org.codehaus.plexus.redback.role.RoleManager;
import org.codehaus.plexus.redback.role.RoleManagerException;
-import java.util.Map;
-
/**
* AddAssignableRolesAction:
*
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
index dda3935..4ad5728 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
@@ -19,12 +19,12 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
-import java.util.Map;
-
/**
* AddBuildDefinitionToProjectAction:
*
@@ -41,11 +41,11 @@
*/
private ProjectDao projectDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
- int projectId = getProjectId( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
+ int projectId = getProjectId( context );
Project project = projectDao.getProjectWithAllDetails( projectId );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
index bf3238e..44367e7 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
@@ -19,13 +19,13 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.ProjectGroup;
-import java.util.Map;
-
/**
* AddBuildDefinitionToProjectAction:
*
@@ -43,11 +43,11 @@
private ProjectGroupDao projectGroupDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
- int projectGroupId = getProjectGroupId( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
+ int projectGroupId = getProjectGroupId( context );
ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
index fa0f088..d9d23a2 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
@@ -19,14 +19,14 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-import java.util.Map;
-
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
@@ -50,7 +50,7 @@
//
// ----------------------------------------------------------------------
- ScmResult scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
+ ScmResult scmResult = CheckoutProjectContinuumAction.getCheckoutResult( context, null );
Project project = projectDao.getProject( getProjectId( context ) );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
index 4df778f..bb52fe4 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
@@ -36,6 +36,8 @@
public class StoreProjectAction
extends AbstractContinuumAction
{
+ private static final String KEY_SCM_USE_CREDENTIALS_CACHE = "useCredentialsCache";
+
/**
* @plexus.requirement
*/
@@ -52,20 +54,20 @@
//
// ----------------------------------------------------------------------
- boolean useCredentialsCache = getBoolean( context, KEY_SCM_USE_CREDENTIALS_CACHE, false );
+ boolean useCredentialsCache = isUseScmCredentialsCache( context, false );
// CONTINUUM-1605 don't store username/password
- if ( !useCredentialsCache )
+ if ( useCredentialsCache )
{
project.setScmUsername( null );
project.setScmPassword( null );
- project.setScmUseCache( false );
+ project.setScmUseCache( true );
}
projectGroup.addProject( project );
projectGroupDao.updateProjectGroup( projectGroup );
- context.put( KEY_PROJECT_ID, project.getId() );
+ setProjectId( context, project.getId() );
// ----------------------------------------------------------------------
// Set the working directory
@@ -86,4 +88,14 @@
*/
// store.updateProject( project );
}
+
+ public static boolean isUseScmCredentialsCache( Map<String, Object> context, boolean defaultValue )
+ {
+ return getBoolean( context, KEY_SCM_USE_CREDENTIALS_CACHE, defaultValue );
+ }
+
+ public static void setUseScmCredentialsCache( Map<String, Object> context, boolean useScmCredentialsCache )
+ {
+ context.put( KEY_SCM_USE_CREDENTIALS_CACHE, useScmCredentialsCache );
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
index a54f783..ed7dc0c 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
@@ -51,6 +51,6 @@
projectGroup = projectGroupDao.addProjectGroup( projectGroup );
- context.put( KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
index 9720e39..529c1ea 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
@@ -19,12 +19,12 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
-import java.util.Map;
-
/**
* AddBuildDefinitionToProjectAction:
*
@@ -41,11 +41,11 @@
*/
private ProjectDao projectDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
- int projectId = getProjectId( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
+ int projectId = getProjectId( context );
Project project = projectDao.getProjectWithAllDetails( projectId );
@@ -53,7 +53,7 @@
updateBuildDefinitionInList( project.getBuildDefinitions(), buildDefinition );
- map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
index f83d614..d03e9cb 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
@@ -19,12 +19,12 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.ProjectGroup;
-import java.util.Map;
-
/**
* AddBuildDefinitionToProjectAction:
*
@@ -41,11 +41,11 @@
*/
private ProjectGroupDao projectGroupDao;
- public void execute( Map map )
+ public void execute( Map context )
throws Exception
{
- BuildDefinition buildDefinition = getBuildDefinition( map );
- int projectGroupId = getProjectGroupId( map );
+ BuildDefinition buildDefinition = getBuildDefinition( context );
+ int projectGroupId = getProjectGroupId( context );
ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
@@ -53,6 +53,6 @@
updateBuildDefinitionInList( projectGroup.getBuildDefinitions(), buildDefinition );
- map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+ AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
index d9827dc..ba94ab9 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
@@ -19,6 +19,8 @@
* under the License.
*/
+import java.util.Map;
+
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.ContinuumException;
@@ -27,12 +29,10 @@
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.apache.maven.continuum.utils.WorkingDirectoryService;
-import java.util.List;
-import java.util.Map;
-
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
@@ -79,11 +79,9 @@
ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
-
- builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project,
- projectScmRootUrl, projectsWithCommonScmRoot ), project, buildDefinition );
+ ScmResult scmResult = (ScmResult) context.get( "scmResult" );
+ builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project,
+ buildDefinition, scmResult );
// ----------------------------------------------------------------------
// Store the new descriptor
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
index b16320a..8e5f3eb 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
@@ -19,6 +19,12 @@
* under the License.
*/
+import java.io.File;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.scm.ContinuumScm;
@@ -31,6 +37,7 @@
import org.apache.maven.continuum.model.scm.ChangeSet;
import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
+import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.apache.maven.continuum.utils.WorkingDirectoryService;
@@ -40,12 +47,6 @@
import org.apache.maven.scm.manager.NoSuchScmProviderException;
import org.apache.maven.scm.repository.ScmRepositoryException;
-import java.io.File;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
@@ -53,7 +54,9 @@
*/
public class UpdateWorkingDirectoryFromScmContinuumAction
extends AbstractContinuumAction
-{
+{
+ private static final String KEY_UPDATE_SCM_RESULT = "update-result";
+
/**
* @plexus.requirement
*/
@@ -93,6 +96,12 @@
Date latestUpdateDate = null;
+ int originalState = project.getState();
+
+ project.setState( ContinuumProjectState.UPDATING );
+
+ projectDao.updateProject( project );
+
try
{
BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );
@@ -102,24 +111,19 @@
catch ( Exception e )
{
}
-
+
try
{
notifier.checkoutStarted( project, buildDefinition );
- List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
- String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
-
- // TODO: not sure why this is different to the context, but it all needs to change
- File workingDirectory =
- workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
- projectsWithCommonScmRoot );
-
- ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory, projectScmRootUrl );
+ // TODO: not sure why this is different to the context, but it all needs to change
+ File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+ ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
config.setLatestUpdateDate( latestUpdateDate );
String tag = config.getTag();
- String msg = project.getName() + "', id: '" + project.getId() + "' to '" +
- workingDirectory.getAbsolutePath() + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." );
+ String msg =
+ project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" +
+ ( tag != null ? " with branch/tag " + tag + "." : "." );
getLogger().info( "Updating project: " + msg );
scmResult = scm.update( config );
@@ -146,8 +150,8 @@
result.setSuccess( false );
result.setProviderMessage( e.getMessage() + ": " + getValidationMessages( e ) );
-
- getLogger().error( e.getMessage(), e);
+
+ getLogger().error( e.getMessage(), e );
}
catch ( NoSuchScmProviderException e )
{
@@ -157,8 +161,8 @@
result.setSuccess( false );
result.setProviderMessage( e.getMessage() );
-
- getLogger().error( e.getMessage(), e);
+
+ getLogger().error( e.getMessage(), e );
}
catch ( ScmException e )
{
@@ -167,47 +171,37 @@
result.setSuccess( false );
result.setException( ContinuumUtils.throwableMessagesToString( e ) );
-
- getLogger().error( e.getMessage(), e);
+
+ getLogger().error( e.getMessage(), e );
}
finally
{
// set back to the original state
- // TODO: transient states!
- //try
- //{
- // project = projectDao.getProject( project.getId() );
+ try
+ {
+ project = projectDao.getProject( project.getId() );
- // project.setState( state );
+ project.setState( originalState );
- // projectDao.updateProject( project );
- //}
- //catch ( Exception e )
- //{
- // nasty nasty, but we're in finally, so just sacrifice the state to keep the original exception
- // getLogger().error( e.getMessage(), e );
- //}
+ projectDao.updateProject( project );
+ }
+ catch ( Exception e )
+ {
+ // nasty nasty, but we're in finally, so just sacrifice the state to keep the original exception
+ getLogger().error( e.getMessage(), e );
+ }
notifier.checkoutComplete( project, buildDefinition );
}
-
+
context.put( KEY_UPDATE_SCM_RESULT, result );
- context.put( KEY_PROJECT, project );
+ AbstractContinuumAction.setProject( context, project );
}
- private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory, String scmRootUrl )
+ private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory )
{
ContinuumScmConfiguration config = new ContinuumScmConfiguration();
-
- if( project.isCheckedOutInSingleDirectory() && scmRootUrl!= null && !"".equals( scmRootUrl ) )
- {
- config.setUrl( scmRootUrl );
- }
- else
- {
- config.setUrl( project.getScmUrl() );
- }
-
+ config.setUrl( project.getScmUrl() );
config.setUsername( project.getScmUsername() );
config.setPassword( project.getScmPassword() );
config.setUseCredentialsCache( project.isScmUseCache() );
@@ -322,7 +316,7 @@
return cmd;
}
-
+
private String getValidationMessages( ScmRepositoryException ex )
{
List<String> messages = ex.getValidationMessages();
@@ -343,4 +337,14 @@
}
return message.toString();
}
+
+ public static ScmResult getUpdateScmResult( Map<String, Object> context )
+ {
+ return getUpdateScmResult( context, null );
+ }
+
+ public static ScmResult getUpdateScmResult( Map<String, Object> context, ScmResult defaultValue )
+ {
+ return (ScmResult) getObject( context, KEY_UPDATE_SCM_RESULT, defaultValue );
+ }
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
index 66b7686..b45e245 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
@@ -19,15 +19,15 @@
* under the License.
*/
+import java.util.List;
+import java.util.Map;
+
import org.apache.continuum.dao.ProjectDao;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
import org.apache.maven.continuum.model.project.Project;
import org.codehaus.plexus.util.StringUtils;
-import java.util.List;
-import java.util.Map;
-
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
index 945b847..3b62336 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
@@ -19,10 +19,10 @@
* under the License.
*/
-import org.apache.maven.continuum.model.project.ProjectGroup;
-
import java.util.Map;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
index 6ad1cce..390178f 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
@@ -22,6 +22,7 @@
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -29,10 +30,13 @@
import org.apache.continuum.utils.shell.ExecutionResult;
import org.apache.continuum.utils.shell.ShellCommandHelper;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.continuum.builddefinition.BuildDefinitionUpdatePolicyConstants;
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ChangeFile;
import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.project.ContinuumProjectState;
@@ -244,7 +248,7 @@
throws ContinuumBuildExecutorException
{
- File workingDirectory = getWorkingDirectory( project, null, null );
+ File workingDirectory = getWorkingDirectory( project );
String actualExecutable = findExecutable( executable, defaultExecutable, resolveExecutable, workingDirectory );
@@ -336,7 +340,7 @@
return jdk.getVarValue();
}
- public void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot )
+ public void backupTestFiles( Project project, int buildId )
{
//Nothing to do, by default
}
@@ -396,6 +400,42 @@
return relPath + File.separator + buildFile;
}
+
+ protected boolean isDescriptionUpdated( BuildDefinition buildDefinition, ScmResult scmResult, Project project )
+ {
+ boolean update = true;
+ if ( buildDefinition != null && scmResult != null )
+ {
+ int policy = buildDefinition.getUpdatePolicy();
+ if ( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_NEVER == policy )
+ {
+ update = false;
+ }
+ else if ( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ONLY_FOR_NEW_POM == policy )
+ {
+ update = pomUpdated( buildDefinition.getBuildFile(), scmResult, project );
+ }
+ }
+ return update;
+ }
+
+ private boolean pomUpdated( String buildFile, ScmResult scmResult, Project project )
+ {
+ String filename = project.getScmUrl() + "/" + buildFile;
+ for ( Iterator changeIt = scmResult.getChanges().listIterator(); changeIt.hasNext(); )
+ {
+ ChangeSet change = (ChangeSet) changeIt.next();
+ for ( Iterator fileIt = change.getFiles().listIterator(); fileIt.hasNext(); )
+ {
+ ChangeFile changeFile = (ChangeFile) fileIt.next();
+ if ( filename.endsWith( changeFile.getName() ) )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
public boolean isBuilding( Project project )
{
@@ -416,9 +456,9 @@
return Collections.EMPTY_LIST;
}
- public File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot )
+ public File getWorkingDirectory( Project project )
{
- return getWorkingDirectoryService().getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot );
+ return getWorkingDirectoryService().getWorkingDirectory( project );
}
public InstallationService getInstallationService()
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
index 3c1abfc..2945da2 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
@@ -27,6 +27,7 @@
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.codehaus.plexus.util.StringUtils;
@@ -130,7 +131,8 @@
}
- public void updateProjectFromCheckOut( File workingDirectory, Project p, BuildDefinition buildDefinition )
+ public void updateProjectFromCheckOut( File workingDirectory, Project p, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException
{
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
index 6aca63d..6d75249 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
@@ -61,10 +61,10 @@
public void mapMetadata( File metadata, Project project )
throws MavenOneMetadataHelperException
{
- mapMetadata( new ContinuumProjectBuildingResult(), metadata, project );
+ mapMetadata( new ContinuumProjectBuildingResult(), metadata, project, true );
}
- public void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project )
+ public void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project, boolean updateDefinition )
throws MavenOneMetadataHelperException
{
Xpp3Dom mavenProject;
@@ -348,10 +348,13 @@
project.setGroupId( groupId );
project.setArtifactId( artifactId );
+
+ if ( updateDefinition )
+ {
+ project.setVersion( version );
- project.setVersion( version );
-
- project.setName( name );
+ project.setName( name );
+ }
if ( StringUtils.isEmpty( shortDescription ) )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
index 3af1a45..df18326 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
@@ -35,6 +35,7 @@
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -149,7 +150,8 @@
}
- public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
+ public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException
{
File projectXmlFile = null;
@@ -176,7 +178,8 @@
try
{
- metadataHelper.mapMetadata( new ContinuumProjectBuildingResult(), projectXmlFile, project );
+ boolean update = isDescriptionUpdated( buildDefinition, scmResult, project );
+ metadataHelper.mapMetadata( new ContinuumProjectBuildingResult(), projectXmlFile, project, update );
}
catch ( MavenOneMetadataHelperException e )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
index 16b034a..b39e769 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
@@ -45,6 +45,6 @@
* @throws MavenOneMetadataHelperException
*
*/
- void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project )
+ void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project, boolean updateDefinition)
throws MavenOneMetadataHelperException;
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
index 442b369..4deac02 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
@@ -118,7 +118,7 @@
// MavenBuilderHelper Implementation
// ----------------------------------------------------------------------
- public void mapMetadataToProject( ContinuumProjectBuildingResult result, File metadata, Project continuumProject )
+ public void mapMetadataToProject( ContinuumProjectBuildingResult result, File metadata, Project continuumProject, boolean update )
{
MavenProject mavenProject = getMavenProject( result, metadata );
@@ -129,11 +129,11 @@
return;
}
- mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, false );
+ mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, update);
}
public void mapMavenProjectToContinuumProject( ContinuumProjectBuildingResult result, MavenProject mavenProject,
- Project continuumProject, boolean groupPom )
+ Project continuumProject, boolean update)
{
if ( mavenProject == null )
{
@@ -141,18 +141,26 @@
return;
}
- // ----------------------------------------------------------------------
- // Name
- // ----------------------------------------------------------------------
+ if (update){
+ // ----------------------------------------------------------------------
+ // Name
+ // ----------------------------------------------------------------------
+
+ continuumProject.setName( getProjectName( mavenProject ) );
+
+ // ----------------------------------------------------------------------
+ // Version
+ // ----------------------------------------------------------------------
+
+ continuumProject.setVersion( getVersion( mavenProject ) );
+
+ // ----------------------------------------------------------------------
+ // Description
+ // ----------------------------------------------------------------------
- continuumProject.setName( getProjectName( mavenProject ) );
-
- // ----------------------------------------------------------------------
- // Description
- // ----------------------------------------------------------------------
-
- continuumProject.setDescription( mavenProject.getDescription() );
-
+ continuumProject.setDescription( mavenProject.getDescription() );
+ }
+
// ----------------------------------------------------------------------
// SCM Url
// ----------------------------------------------------------------------
@@ -171,12 +179,6 @@
}
// ----------------------------------------------------------------------
- // Version
- // ----------------------------------------------------------------------
-
- continuumProject.setVersion( getVersion( mavenProject ) );
-
- // ----------------------------------------------------------------------
// GroupId
// ----------------------------------------------------------------------
@@ -387,7 +389,7 @@
ProfileManager profileManager = new DefaultProfileManager( container, settings );
- project = projectBuilder.build( file, getLocalRepository(), profileManager, false );
+ project = projectBuilder.build( file, getLocalRepository(), profileManager, true);
if ( log.isDebugEnabled() )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java
index 456155a..5259656 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenBuilderHelper.java
@@ -35,7 +35,7 @@
{
String ROLE = MavenBuilderHelper.class.getName();
- void mapMetadataToProject( ContinuumProjectBuildingResult result, File metadata, Project project );
+ void mapMetadataToProject( ContinuumProjectBuildingResult result, File metadata, Project project, boolean updateDefinition);
MavenProject getMavenProject( ContinuumProjectBuildingResult result, File file );
@@ -46,7 +46,7 @@
* @param groupPom map this project as if it is being used to initialize a project group
*/
void mapMavenProjectToContinuumProject( ContinuumProjectBuildingResult result, MavenProject mavenProject,
- Project continuumProject, boolean groupPom );
+ Project continuumProject, boolean updateDefinition);
ArtifactRepository getLocalRepository()
throws SettingsConfigurationException;
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
index 3d435b1..6cc1ddf 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
@@ -25,6 +25,7 @@
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -32,6 +33,7 @@
import org.apache.continuum.model.repository.LocalRepository;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.continuum.builddefinition.BuildDefinitionUpdatePolicyConstants;
import org.apache.maven.continuum.configuration.ConfigurationException;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.execution.AbstractBuildExecutor;
@@ -44,6 +46,7 @@
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.scm.ChangeFile;
import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -177,7 +180,8 @@
return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments );
}
- public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
+ public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException
{
File f = getPomFile( getBuildFileForProject( project, buildDefinition ), workingDirectory );
@@ -186,17 +190,16 @@
{
throw new ContinuumBuildExecutorException( "Could not find Maven project descriptor." );
}
-
ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
-
- builderHelper.mapMetadataToProject( result, f, project );
+ boolean update = isDescriptionUpdated( buildDefinition, scmResult, project );
+ builderHelper.mapMetadataToProject( result, f, project, update );
if ( result.hasErrors() )
{
throw new ContinuumBuildExecutorException( "Error while mapping metadata:" + result.getErrorsAsString() );
}
}
-
+
private static File getPomFile( String projectBuildFile, File workingDirectory )
{
File f = null;
@@ -335,7 +338,7 @@
}
@Override
- public void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot )
+ public void backupTestFiles( Project project, int buildId )
{
File backupDirectory = null;
try
@@ -350,7 +353,7 @@
{
log.info( "error on surefire backup directory creation skip backup " + e.getMessage(), e );
}
- backupTestFiles( getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot ), backupDirectory );
+ backupTestFiles( getWorkingDirectory( project ), backupDirectory );
}
private void backupTestFiles( File workingDir, File backupDirectory )
@@ -395,10 +398,10 @@
//Check if it's a recursive build
boolean isRecursive = false;
if (StringUtils.isNotEmpty( buildDefinition.getArguments() ) )
- {
+ {
isRecursive = buildDefinition.getArguments().indexOf( "-N" ) < 0 &&
buildDefinition.getArguments().indexOf( "--non-recursive" ) < 0 ;
- }
+ }
if ( isRecursive && changes != null && !changes.isEmpty() )
{
if ( log.isInfoEnabled() )
@@ -410,14 +413,7 @@
MavenProject project = getMavenProject( continuumProject, workingDirectory, buildDefinition );
- //CONTINUUM-1815: additional check for projects recently released
- if ( !continuumProject.getVersion().equals( project.getVersion() ) )
- {
- log.info( "Found changes in project's version ( maybe project was recently released ), building" );
- return true;
- }
-
- if ( changes.isEmpty() )
+ if ( changes == null || changes.isEmpty() )
{
if ( log.isInfoEnabled() )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
index 08fcd5e..44f5b58 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
@@ -27,6 +27,7 @@
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
import org.codehaus.plexus.util.StringUtils;
@@ -99,7 +100,8 @@
}
- public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
+ public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException
{
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java b/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
index f2080f8..b6a9221 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
@@ -27,8 +27,10 @@
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.mail.Message;
import javax.mail.MessagingException;
@@ -136,11 +138,6 @@
/**
* @plexus.configuration
*/
- private boolean includeBuildResult = true;
-
- /**
- * @plexus.configuration
- */
private boolean includeBuildSummary = true;
/**
@@ -151,7 +148,7 @@
/**
* @plexus.configuration
*/
- private boolean includeOutput = false;
+ private boolean includeBuildOutput = false;
/**
* Customizable mail subject. Use any combination of literal text, project or build attributes.
@@ -170,7 +167,7 @@
*
* @plexus.configuration
*/
- private String prepareBuildSubjectFormat = "[continuum] PREPARE BUILD ${state]";
+ private String prepareBuildSubjectFormat = "[continuum] PREPARE BUILD ${state]: ${projectScmRoot.projectGroup.name}";
// ----------------------------------------------------------------------
//
@@ -254,7 +251,8 @@
Project project = context.getProject();
List<ProjectNotifier> notifiers = context.getNotifiers();
BuildResult build = context.getBuildResult();
- String buildOutput = getBuildOutput( project, build );
+ log.error( "br state="+build.getState() );
+ log.error( "project state="+project.getState() );
BuildDefinition buildDefinition = context.getBuildDefinition();
ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
@@ -281,7 +279,7 @@
if ( messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE ) )
{
- buildComplete( project, notifiers, build, buildOutput, messageId, context, buildDefinition );
+ buildComplete( project, notifiers, build, messageId, context, buildDefinition );
}
else if ( isPrepareBuildComplete )
{
@@ -289,8 +287,8 @@
}
}
- private void buildComplete( Project project, List<ProjectNotifier> notifiers, BuildResult build, String buildOutput,
- String messageId, MessageContext context, BuildDefinition buildDefinition )
+ private void buildComplete( Project project, List<ProjectNotifier> notifiers, BuildResult build, String messageId,
+ MessageContext context, BuildDefinition buildDefinition )
throws NotificationException
{
BuildResult previousBuild = getPreviousBuild( project, buildDefinition, build );
@@ -307,12 +305,12 @@
notifiersList.add( notifier );
}
}
- buildComplete( project, notifiersList, build, previousBuild, buildOutput, messageId, context, buildDefinition );
+ buildComplete( project, notifiersList, build, previousBuild, messageId, context, buildDefinition );
}
private void buildComplete( Project project, List<ProjectNotifier> notifiers, BuildResult build,
- BuildResult previousBuild, String buildOutput, String messageId,
- MessageContext messageContext, BuildDefinition buildDefinition )
+ BuildResult previousBuild, String messageId, MessageContext messageContext,
+ BuildDefinition buildDefinition )
throws NotificationException
{
// ----------------------------------------------------------------------
@@ -333,11 +331,11 @@
context.put( "includeTestSummary", includeTestSummary );
- context.put( "includeOutput", includeOutput );
+ context.put( "includeOutput", includeBuildOutput );
- if ( includeBuildResult )
+ if ( includeBuildOutput )
{
- context.put( "buildOutput", buildOutput );
+ context.put( "buildOutput", getBuildOutput( project, build ) );
}
if ( includeBuildSummary )
@@ -457,8 +455,6 @@
context.put( "reportUrl",
getReportUrl( projectScmRoot.getProjectGroup(), projectScmRoot, configurationService ) );
- context.put( "projectGroup", projectScmRoot.getProjectGroup() );
-
context.put( "projectScmRoot", projectScmRoot );
// TODO put other profile env var could be a security if they provide passwords ?
@@ -698,6 +694,7 @@
if ( StringUtils.isEmpty( toOverride ) )
{
+ Set<String> listRecipents = new HashSet<String>();
for ( ProjectNotifier notifier : notifiers )
{
Map<String, String> conf = notifier.getConfiguration();
@@ -710,19 +707,45 @@
String[] addresses = StringUtils.split( addressField, "," );
for ( String address : addresses )
{
- // TODO: set a proper name
- InternetAddress to = new InternetAddress( address.trim() );
+ if (!listRecipents.contains(address.trim())) {
+ // [CONTINUUM-2281] Dont repeat addesss in recipents.
+ // TODO: set a proper name
+ InternetAddress to = new InternetAddress(address.trim());
- log.info( "Recipient: To '" + to + "'." );
- message.addRecipient( Message.RecipientType.TO, to );
+ log.info("Recipient: To '" + to + "'.");
+ message.addRecipient(Message.RecipientType.TO, to);
+ listRecipents.add(address.trim());
+ }
}
}
- String committerField = (String) notifier.getConfiguration().get( COMMITTER_FIELD );
- if ( StringUtils.isNotEmpty( committerField ) && context.getBuildResult() != null )
+ if (context.getBuildResult() != null)
{
- if ( Boolean.parseBoolean( committerField ) )
+ String committerField = (String) notifier.getConfiguration().get(COMMITTER_FIELD);
+ String developerField = (String) notifier.getConfiguration().get(DEVELOPER_FIELD);
+ // Developers constains committers.
+ if (StringUtils.isNotEmpty(developerField) && Boolean.parseBoolean(developerField))
+ {
+ List<ProjectDeveloper> developers = project.getDevelopers();
+ if (developers == null || developers.isEmpty())
+ {
+ log.warn("No developers have been configured...notifcation email will not be sent");
+ return;
+ }
+ Map<String, String> developerToEmailMap = mapDevelopersToRecipients(developers);
+ for (String email : developerToEmailMap.values())
+ {
+ if (!listRecipents.contains(email.trim()))
+ {
+ InternetAddress to = new InternetAddress(email.trim());
+ log.info("Recipient: To '" + to + "'.");
+ message.addRecipient(Message.RecipientType.TO, to);
+ listRecipents.add(email.trim());
+ }
+ }
+ }
+ else if (StringUtils.isNotEmpty(committerField) && Boolean.parseBoolean(committerField))
{
ScmResult scmResult = context.getBuildResult().getScmResult();
if ( scmResult != null && scmResult.getChanges() != null &&
@@ -743,7 +766,7 @@
for ( ChangeSet changeSet : changes )
{
String scmId = changeSet.getAuthor();
- if ( StringUtils.isNotEmpty( scmId ) )
+ if (StringUtils.isNotEmpty(scmId))
{
String email = developerToEmailMap.get( scmId );
if ( StringUtils.isEmpty( email ) )
@@ -753,13 +776,15 @@
"no email address is defined in developers list for '" + scmId +
"' scm id." );
}
- else
- {
+ else if (!listRecipents.contains(email.trim()))
+ {
+ // [CONTINUUM-2281] Dont repeat addesss in recipents.)
// TODO: set a proper name
InternetAddress to = new InternetAddress( email.trim() );
log.info( "Recipient: To '" + to + "'." );
message.addRecipient( Message.RecipientType.TO, to );
+ listRecipents.add(email.trim());
}
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
index a69960f..a6a00ab 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
@@ -109,6 +109,8 @@
URI uri = metadata.toURI();
HttpGet httpGet = new HttpGet( uri );
+ httpClient.getCredentialsProvider().clear();
+
// basic auth
if ( username != null && password != null )
{
@@ -127,7 +129,7 @@
case 200:
break;
case 401:
- log.error( "Error adding project: Unauthorized " + metadata );
+ log.error( "Error adding project: Unauthorized " + url );
result.addError( ContinuumProjectBuildingResult.ERROR_UNAUTHORIZED );
return null;
default:
@@ -230,38 +232,45 @@
protected File createMetadataFile( ContinuumProjectBuildingResult result, URL metadata, String username,
String password )
{
+ String url = metadata.toExternalForm();
+
+ if ( metadata.getProtocol().startsWith( "http" ) )
+ {
+ url = hidePasswordInUrl( url );
+ }
+
try
{
return createMetadataFile( metadata, username, password, result );
}
catch ( FileNotFoundException e )
{
- log.info( "URL not found: " + metadata, e );
+ log.info( "URL not found: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_POM_NOT_FOUND );
}
catch ( MalformedURLException e )
{
- log.info( "Malformed URL: " + metadata, e );
+ log.info( "Malformed URL: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
}
catch ( URISyntaxException e )
{
- log.info( "Malformed URL: " + metadata, e );
+ log.info( "Malformed URL: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
}
catch ( UnknownHostException e )
{
- log.info( "Unknown host: " + metadata, e );
+ log.info( "Unknown host: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN_HOST );
}
catch ( IOException e )
{
- log.warn( "Could not download the URL: " + metadata, e );
+ log.warn( "Could not download the URL: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN );
}
catch ( HttpException e )
{
- log.warn( "Could not download the URL: " + metadata, e );
+ log.warn( "Could not download the URL: " + url, e );
result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN );
}
return null;
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
index 940e068..72340d8 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
@@ -67,17 +67,17 @@
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
throws ContinuumProjectBuilderException
{
- return buildProjectsFromMetadata( url, username, password, true, false );
+ return buildProjectsFromMetadata( url, username, password, true );
}
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
- boolean recursiveProjects, boolean checkoutInSingleDirectory )
+ boolean recursiveProjects )
throws ContinuumProjectBuilderException
{
try
{
return buildProjectsFromMetadata( url, username, password, recursiveProjects,
- buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate(), checkoutInSingleDirectory );
+ buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate() );
}
catch ( BuildDefinitionServiceException e )
{
@@ -87,7 +87,7 @@
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
boolean recursiveProjects,
- BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+ BuildDefinitionTemplate buildDefinitionTemplate )
throws ContinuumProjectBuilderException
{
ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
@@ -105,7 +105,7 @@
try
{
- metadataHelper.mapMetadata( result, pomFile, project );
+ metadataHelper.mapMetadata( result, pomFile, project, true);
if ( result.hasErrors() )
{
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
index 4b3cae7..cbd1c76 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
@@ -83,8 +83,6 @@
* @plexus.configuration
*/
private List<String> excludedPackagingTypes = new ArrayList<String>();
-
- private Project rootProject;
// ----------------------------------------------------------------------
// AbstractContinuumProjectBuilder Implementation
@@ -92,17 +90,17 @@
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
throws ContinuumProjectBuilderException
{
- return buildProjectsFromMetadata( url, username, password, true, false );
+ return buildProjectsFromMetadata( url, username, password, true );
}
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
- boolean loadRecursiveProjects, boolean checkoutInSingleDirectory )
+ boolean loadRecursiveProjects )
throws ContinuumProjectBuilderException
{
try
{
return buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
- buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate(), checkoutInSingleDirectory );
+ buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate() );
}
catch ( BuildDefinitionServiceException e )
{
@@ -112,7 +110,7 @@
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
boolean loadRecursiveProjects,
- BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+ BuildDefinitionTemplate buildDefinitionTemplate )
throws ContinuumProjectBuilderException
{
// ----------------------------------------------------------------------
@@ -123,7 +121,7 @@
try
{
- readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate, checkoutInSingleDirectory );
+ readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate );
}
catch ( BuildDefinitionServiceException e )
{
@@ -138,7 +136,7 @@
private void readModules( URL url, ContinuumProjectBuildingResult result, boolean groupPom, String username,
String password, String scmUrl, boolean loadRecursiveProjects,
- BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+ BuildDefinitionTemplate buildDefinitionTemplate )
throws ContinuumProjectBuilderException, BuildDefinitionServiceException
{
@@ -156,7 +154,7 @@
}
mavenProject = builderHelper.getMavenProject( result, pomFile );
-
+
if ( result.hasErrors() )
{
return;
@@ -240,10 +238,8 @@
continuumProject.setScmPassword( password );
}
}
-
- continuumProject.setCheckedOutInSingleDirectory( checkoutInSingleDirectory );
-
- builderHelper.mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, groupPom );
+ // New project
+ builderHelper.mapMavenProjectToContinuumProject( result, mavenProject, continuumProject, true);
if ( result.hasErrors() )
{
@@ -268,12 +264,6 @@
continuumProject.setScmTag( mavenProject.getScm().getTag() );
}
result.addProject( continuumProject, MavenTwoBuildExecutor.ID );
-
- if( checkoutInSingleDirectory && rootProject == null )
- {
- rootProject = continuumProject;
- result.setRootProject( rootProject );
- }
}
List<String> modules = mavenProject.getModules();
@@ -299,13 +289,13 @@
prefix = prefix.substring( 0, lastSlash );
if ( loadRecursiveProjects )
- {
+ {
for ( String module : modules )
{
if ( StringUtils.isNotEmpty( module ) )
- {
+ {
String urlString = prefix + "/" + module + POM_PART + suffix;
-
+
URL moduleUrl;
try
@@ -319,33 +309,18 @@
continue;
}
- String moduleScmUrl = "";
-
- String modulePath = StringUtils.replace( new String( module ), '\\', '/' );
-
- // check if module is relative
- if( modulePath.indexOf( "/" ) != -1 )
- {
- int depth =
- StringUtils.countMatches( StringUtils.substring( modulePath, 0,
- modulePath.lastIndexOf( '/' ) + 1 ), "/" );
-
- String baseUrl = "";
- for( int j = 1; j <= depth; j++ )
- {
- scmUrl = StringUtils.chompLast( new String( scmUrl ), "/" );
- baseUrl = StringUtils.substring( scmUrl, 0, scmUrl.lastIndexOf( '/' ) );
- }
- moduleScmUrl = baseUrl + "/" + StringUtils.substring( modulePath, modulePath.lastIndexOf( '/' ) + 1 );
+ String moduleScmUrl;
+ if ( scmUrl.endsWith( "/" ) )
+ {
+ moduleScmUrl = scmUrl + module;
}
else
{
- scmUrl = StringUtils.chompLast( scmUrl, "/" );
moduleScmUrl = scmUrl + "/" + module;
}
// we are in recursive loading mode
readModules( moduleUrl, result, false, username, password, moduleScmUrl, true,
- buildDefinitionTemplate, checkoutInSingleDirectory );
+ buildDefinitionTemplate );
}
}
}
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java b/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
index 4288a0f..75dfd98 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
@@ -34,6 +34,8 @@
public class ContinuumBuildJob
extends AbstractJob
{
+ public static final String BUILD_GROUP = "BUILD_GROUP";
+
public void execute( JobExecutionContext context )
{
if ( isInterrupted() )
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java b/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java
index d5a9b9f..f8aa330 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumPurgeJob.java
@@ -36,6 +36,8 @@
public class ContinuumPurgeJob
extends AbstractJob
{
+ public static final String PURGE_GROUP = "PURGE_GROUP";
+
public void execute( JobExecutionContext context )
{
if ( isInterrupted() )
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
index b5f178c..b3daaed 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
@@ -25,6 +25,7 @@
import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.taskqueue.CheckOutTask;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.action.ActionManager;
@@ -85,18 +86,16 @@
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+ AbstractContinuumAction.setProjectId( context, projectId );
- context.put( AbstractContinuumAction.KEY_PROJECT, project );
+ AbstractContinuumAction.setProject( context, project );
- context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, workingDirectory );
+ AbstractContinuumAction.setWorkingDirectory( context, workingDirectory );
- context.put( AbstractContinuumAction.KEY_SCM_USERNAME, task.getScmUserName() );
+ CheckoutProjectContinuumAction.setScmUsername( context, task.getScmUserName() );
- context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, task.getScmRootUrl() );
+ CheckoutProjectContinuumAction.setScmPassword( context, task.getScmPassword() );
- context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, task.getProjectsWithCommonScmRoot() );
-
try
{
actionManager.lookup( "checkout-project" ).execute( context );
diff --git a/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java b/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
index dc8e8ff..3456c3a 100644
--- a/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
+++ b/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
@@ -28,13 +28,16 @@
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectGroupDao;
import org.apache.continuum.dao.ProjectScmRootDao;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
import org.apache.continuum.utils.ContinuumUtils;
import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckWorkingDirectoryAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
+import org.apache.maven.continuum.core.action.UpdateWorkingDirectoryFromScmContinuumAction;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
@@ -99,11 +102,6 @@
* @plexus.requirement
*/
private ContinuumNotificationDispatcher notifierDispatcher;
-
- /**
- * @plexus.requirement
- */
- private ProjectGroupDao projectGroupDao;
public void executeTask( Task task )
throws TaskExecutionException
@@ -111,7 +109,7 @@
PrepareBuildProjectsTask prepareTask = (PrepareBuildProjectsTask) task;
Map<Integer, Integer> projectsBuildDefinitionsMap = prepareTask.getProjectsBuildDefinitionsMap();
- int trigger = prepareTask.getTrigger();
+ BuildTrigger buildTrigger = prepareTask.getBuildTrigger();
Set<Integer> projectsId = projectsBuildDefinitionsMap.keySet();
Map<String, Object> context = new HashMap<String, Object>();
Map<Integer, ScmResult> scmResultMap = new HashMap<Integer, ScmResult>();
@@ -123,7 +121,7 @@
int buildDefinitionId = projectsBuildDefinitionsMap.get( projectId );
log.info( "Initializing prepare build" );
- context = initializeContext( projectId, buildDefinitionId );
+ context = initializeContext( projectId, buildDefinitionId, prepareTask.getBuildTrigger() );
log.info(
"Starting prepare build of project: " + AbstractContinuumAction.getProject( context ).getName() );
@@ -162,7 +160,7 @@
log.info(
"Ending prepare build of project: " + AbstractContinuumAction.getProject( context ).getName() );
scmResultMap.put( AbstractContinuumAction.getProjectId( context ),
- AbstractContinuumAction.getScmResult( context, null ) );
+ AbstractContinuumAction.getScmResult( context, new ScmResult() ) );
endProjectPrepareBuild( context );
}
}
@@ -176,11 +174,11 @@
if ( checkProjectScmRoot( context ) )
{
int projectGroupId = AbstractContinuumAction.getProjectGroupId( context );
- buildProjects( projectGroupId, projectsBuildDefinitionsMap, trigger, scmResultMap );
+ buildProjects( projectGroupId, projectsBuildDefinitionsMap, buildTrigger, scmResultMap );
}
}
- private Map<String, Object> initializeContext( int projectId, int buildDefinitionId )
+ private Map<String, Object> initializeContext( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
throws TaskExecutionException
{
Map<String, Object> context = new HashMap<String, Object>();
@@ -192,54 +190,37 @@
List<ProjectScmRoot> scmRoots = projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
String projectScmUrl = project.getScmUrl();
- String projectScmRootAddress = "";
-
+
for ( ProjectScmRoot projectScmRoot : scmRoots )
{
- projectScmRootAddress = projectScmRoot.getScmRootAddress();
if ( projectScmUrl.startsWith( projectScmRoot.getScmRootAddress() ) )
- {
- context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot );
- context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, projectScmRootAddress );
+ {
+ AbstractContinuumAction.setProjectScmRoot( context, projectScmRoot );
break;
}
}
- context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
- context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
- context.put( AbstractContinuumAction.KEY_PROJECT, project );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
+ AbstractContinuumAction.setProjectId( context, projectId );
+ AbstractContinuumAction.setProject( context, project );
+ AbstractContinuumAction.setBuildTrigger( context, buildTrigger );
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
- context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION,
- buildDefinitionDao.getBuildDefinition( buildDefinitionId ) );
+ AbstractContinuumAction.setBuildDefinitionId( context, buildDefinitionId );
+ AbstractContinuumAction.setBuildDefinition( context,
+ buildDefinitionDao.getBuildDefinition( buildDefinitionId ) );
- if( project.isCheckedOutInSingleDirectory() )
- {
- List<Project> projectsInGroup =
- projectGroupDao.getProjectGroupWithProjects( projectGroup.getId() ).getProjects();
- List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();
- for( Project projectInGroup : projectsInGroup )
- {
- if( projectInGroup.getScmUrl().startsWith( projectScmRootAddress ) )
- {
- projectsWithCommonScmRoot.add( projectInGroup );
- }
- }
- context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, projectsWithCommonScmRoot );
- }
-
BuildResult oldBuildResult =
buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
if ( oldBuildResult != null )
{
- context.put( AbstractContinuumAction.KEY_OLD_SCM_RESULT,
- getOldScmResults( projectId, oldBuildResult.getBuildNumber(),
- oldBuildResult.getEndTime() ) );
+ AbstractContinuumAction.setOldScmResult( context,
+ getOldScmResults( projectId, oldBuildResult.getBuildNumber(),
+ oldBuildResult.getEndTime() ) );
}
else
{
- context.put( AbstractContinuumAction.KEY_OLD_SCM_RESULT, null );
+ AbstractContinuumAction.setOldScmResult( context, null );
}
}
catch ( ContinuumStoreException e )
@@ -261,8 +242,7 @@
{
performAction( "check-working-directory", context );
- boolean workingDirectoryExists =
- AbstractContinuumAction.getBoolean( context, AbstractContinuumAction.KEY_WORKING_DIRECTORY_EXISTS );
+ boolean workingDirectoryExists = CheckWorkingDirectoryAction.isWorkingDirectoryExist( context );
ScmResult scmResult;
@@ -270,21 +250,28 @@
{
performAction( "update-working-directory-from-scm", context );
- scmResult = AbstractContinuumAction.getUpdateScmResult( context );
+ scmResult = UpdateWorkingDirectoryFromScmContinuumAction.getUpdateScmResult( context );
}
else
{
Project project = AbstractContinuumAction.getProject( context );
- context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY,
- workingDirectoryService.getWorkingDirectory( project ).getAbsolutePath() );
-
+ AbstractContinuumAction.setWorkingDirectory( context, workingDirectoryService.getWorkingDirectory(
+ project ).getAbsolutePath() );
+
performAction( "checkout-project", context );
- scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
+ scmResult = CheckoutProjectContinuumAction.getCheckoutResult( context, null );
}
- context.put( AbstractContinuumAction.KEY_SCM_RESULT, scmResult );
+ // [CONTINUUM-2207] when returned scmResult is null, this causes a problem when building the project
+ if ( scmResult == null )
+ {
+ log.debug( "Returned ScmResult is null when updating the working directory" );
+ scmResult = new ScmResult();
+ }
+
+ AbstractContinuumAction.setScmResult( context, scmResult );
}
private boolean checkProjectScmRoot( Map<String, Object> context )
@@ -294,6 +281,7 @@
// check state of scm root
return projectScmRoot.getState() != ContinuumProjectState.ERROR;
+
}
private void startPrepareBuild( Map<String, Object> context )
@@ -407,7 +395,7 @@
{
if ( newScmResult == null )
{
- context.put( AbstractContinuumAction.KEY_SCM_RESULT, oldScmResult );
+ AbstractContinuumAction.setScmResult( context, oldScmResult );
}
else
{
@@ -454,7 +442,7 @@
result.setException( ContinuumUtils.throwableToString( exception ) );
- context.put( AbstractContinuumAction.KEY_SCM_RESULT, result );
+ AbstractContinuumAction.setScmResult( context, result );
throw exception;
}
@@ -513,7 +501,7 @@
projectScmRootDao.updateProjectScmRoot( projectScmRoot );
- context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot );
+ AbstractContinuumAction.setProjectScmRoot( context, projectScmRoot );
}
catch ( ContinuumStoreException e )
{
@@ -521,8 +509,8 @@
}
}
- private void buildProjects( int projectGroupId, Map<Integer, Integer> projectsAndBuildDefinitionsMap, int trigger,
- Map<Integer, ScmResult> scmResultMap )
+ private void buildProjects( int projectGroupId, Map<Integer, Integer> projectsAndBuildDefinitionsMap,
+ BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap )
throws TaskExecutionException
{
List<Project> projects = projectDao.getProjectsWithDependenciesByGroupId( projectGroupId );
@@ -536,7 +524,7 @@
for ( Project project : projectList )
{
int buildDefinitionId;
-
+
if ( projectsAndBuildDefinitionsMap.get( project.getId() ) != null )
{
buildDefinitionId = projectsAndBuildDefinitionsMap.get( project.getId() );
@@ -553,36 +541,16 @@
throw new TaskExecutionException( "Error while creating build object", e );
}
}
- else if ( project.getState() == ContinuumProjectState.CHECKEDOUT ||
- project.getState() == ContinuumProjectState.NEW || project.isCheckedOutInSingleDirectory() ) //check if no build result yet for project
- {
- try
- {
- //get default build definition for project
- BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( project.getId() );
- projectsBuildDefinitionsMap.put( project.getId(), buildDefinition );
- projectsToBeBuilt.add( project );
- }
- catch ( ContinuumStoreException e )
- {
- log.error( "Error while creating build object", e );
- throw new TaskExecutionException( "Error while creating build object", e );
- }
- catch ( Exception e )
- {
- log.error( e.getMessage(), e );
- throw new TaskExecutionException( "Error executing action 'build-project'", e );
- }
- }
}
try
{
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_PROJECTS, projectsToBeBuilt );
- context.put( AbstractContinuumAction.KEY_PROJECTS_BUILD_DEFINITIONS_MAP, projectsBuildDefinitionsMap );
- context.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
- context.put( AbstractContinuumAction.KEY_SCM_RESULT_MAP, scmResultMap );
+ AbstractContinuumAction.setListOfProjects( context, projectsToBeBuilt );
+ AbstractContinuumAction.setProjectsBuildDefinitionsMap( context, projectsBuildDefinitionsMap );
+ AbstractContinuumAction.setBuildTrigger( context, buildTrigger );
+ AbstractContinuumAction.setScmResultMap( context, scmResultMap );
+ AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
log.info( "Performing action create-build-project-task" );
actionManager.lookup( "create-build-project-task" ).execute( context );
diff --git a/continuum-core/src/main/resources/META-INF/plexus/components.xml b/continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml
similarity index 100%
rename from continuum-core/src/main/resources/META-INF/plexus/components.xml
rename to continuum-core/src/main/resources/META-INF/plexus/components-fragment.xml
diff --git a/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/PrepareBuildComplete.vm b/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/PrepareBuildComplete.vm
index 68779d3..aca1877 100644
--- a/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/PrepareBuildComplete.vm
+++ b/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/PrepareBuildComplete.vm
@@ -15,7 +15,7 @@
*#
Online report : $reportUrl
- Project Group: $projectGroup.name
+ Project Group: $projectScmRoot.projectGroup.name
SCM Root URL: $projectScmRoot.scmRootAddress
#if ($projectScmRoot.state == 4)
diff --git a/continuum-core/src/test-projects/multi-module/module-A/pom.xml b/continuum-core/src/test-projects/multi-module/module-A/pom.xml
new file mode 100644
index 0000000..58d607c
--- /dev/null
+++ b/continuum-core/src/test-projects/multi-module/module-A/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0"?><project>
+<!--
+ ~ 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.
+ -->
+ <parent>
+ <artifactId>multi-module-parent</artifactId>
+ <groupId>org.apache.continuum</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>module-A</artifactId>
+ <name>module-A</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java b/continuum-core/src/test-projects/multi-module/module-A/src/main/java/org/apache/continuum/module/a/App.java
similarity index 65%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
copy to continuum-core/src/test-projects/multi-module/module-A/src/main/java/org/apache/continuum/module/a/App.java
index c829c6d..de2c49d 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
+++ b/continuum-core/src/test-projects/multi-module/module-A/src/main/java/org/apache/continuum/module/a/App.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.continuum.module.a;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,14 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-
/**
- * Goal which add a Shell Project.
+ * Hello world!
*
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-shell-project
*/
-public class AddShellProject
- extends AbstractAddProject
+public class App
{
- protected String getProjectType()
+ public static void main( String[] args )
{
- return ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
+ System.out.println( "Hello World!" );
}
}
diff --git a/continuum-core/src/test-projects/multi-module/module-A/test/java/org/apache/continuum/module/a/AppTest.java b/continuum-core/src/test-projects/multi-module/module-A/test/java/org/apache/continuum/module/a/AppTest.java
new file mode 100644
index 0000000..876714b
--- /dev/null
+++ b/continuum-core/src/test-projects/multi-module/module-A/test/java/org/apache/continuum/module/a/AppTest.java
@@ -0,0 +1,57 @@
+package org.apache.continuum.module.a;
+
+/*
+ * 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.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/continuum-core/src/test-projects/multi-module/module-B/pom.xml b/continuum-core/src/test-projects/multi-module/module-B/pom.xml
new file mode 100644
index 0000000..aca86b7
--- /dev/null
+++ b/continuum-core/src/test-projects/multi-module/module-B/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?><project>
+<!--
+ ~ 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.
+ -->
+
+ <parent>
+ <artifactId>multi-module-parent</artifactId>
+ <groupId>org.apache.continuum</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>module-B</artifactId>
+ <name>module-B</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java b/continuum-core/src/test-projects/multi-module/module-B/src/main/java/org/apache/continuum/module/b/App.java
similarity index 65%
rename from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
rename to continuum-core/src/test-projects/multi-module/module-B/src/main/java/org/apache/continuum/module/b/App.java
index c829c6d..4a35254 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
+++ b/continuum-core/src/test-projects/multi-module/module-B/src/main/java/org/apache/continuum/module/b/App.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.continuum.module.b;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,14 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-
/**
- * Goal which add a Shell Project.
+ * Hello world!
*
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-shell-project
*/
-public class AddShellProject
- extends AbstractAddProject
+public class App
{
- protected String getProjectType()
+ public static void main( String[] args )
{
- return ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
+ System.out.println( "Hello World!" );
}
}
diff --git a/continuum-core/src/test-projects/multi-module/module-B/src/test/java/org/apache/continuum/module/b/AppTest.java b/continuum-core/src/test-projects/multi-module/module-B/src/test/java/org/apache/continuum/module/b/AppTest.java
new file mode 100644
index 0000000..0e8d12f
--- /dev/null
+++ b/continuum-core/src/test-projects/multi-module/module-B/src/test/java/org/apache/continuum/module/b/AppTest.java
@@ -0,0 +1,57 @@
+package org.apache.continuum.module.b;
+
+/*
+ * 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.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/continuum-core/src/test-projects/multi-module/pom.xml b/continuum-core/src/test-projects/multi-module/pom.xml
new file mode 100644
index 0000000..e288ab0
--- /dev/null
+++ b/continuum-core/src/test-projects/multi-module/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>multi-module-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>multi-module-parent</name>
+ <url>http://maven.apache.org</url>
+ <scm>
+ <connection>scm:local:src/test-projects:multi-module</connection>
+ <url>http://cvs.plexus.codehaus.org/plexus-components/native/continuum/src/test-projects/multi-module</url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <modules>
+ <module>module-A</module>
+ <module>module-B</module>
+ </modules>
+</project>
diff --git a/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
new file mode 100644
index 0000000..846507a
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
@@ -0,0 +1,517 @@
+package org.apache.continuum.builder.distributed.manager;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.builder.distributed.executor.ThreadedDistributedBuildTaskQueueExecutor;
+import org.apache.continuum.builder.distributed.stubs.SlaveBuildAgentTransportClientStub;
+import org.apache.continuum.builder.distributed.stubs.DefaultDistributedBuildManagerStub;
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
+import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.taskqueue.OverallDistributedBuildQueue;
+import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.model.system.Profile;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit3.JUnit3Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+
+public class DefaultDistributedBuildManagerTest
+ extends PlexusInSpringTestCase
+{
+ private final String TEST_BUILD_AGENT1 = "http://sampleagent";
+
+ private final String TEST_BUILD_AGENT2 = "http://testagent";
+
+ private final String TEST_BUILD_AGENT_GROUP1 = "buildAgentGroup1";
+
+ private DefaultDistributedBuildManager distributedBuildManager;
+
+ private DefaultDistributedBuildManager distributedBuildManagerStub = new DefaultDistributedBuildManagerStub();
+
+ private Mockery context;
+
+ private OverallDistributedBuildQueue overallDistributedBuildQueue1;
+
+ private OverallDistributedBuildQueue overallDistributedBuildQueue2;
+
+ private BuildDefinitionDao buildDefinitionDao;
+
+ private BuildResultDao buildResultDao;
+
+ private ProjectDao projectDao;
+
+ private ConfigurationService configurationService;
+
+ private List<BuildAgentConfiguration> buildAgents;
+
+ private BuildAgentConfiguration buildAgent1;
+
+ private BuildAgentConfiguration buildAgent2;
+
+ private ThreadedDistributedBuildTaskQueueExecutor distributedBuildTaskQueueExecutor;
+
+ private TaskQueue distributedBuildQueue;
+
+ private Project project;
+
+ private Project project2;
+
+ private ProjectGroup projectGroup;
+
+ private BuildDefinition buildDefinition;
+
+ private BuildAgentGroupConfiguration buildAgentGroup;
+
+ @Override
+ public void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ context = new JUnit3Mockery();
+ context.setImposteriser( ClassImposteriser.INSTANCE );
+
+ distributedBuildManager = (DefaultDistributedBuildManager) lookup( DistributedBuildManager.class );
+
+ buildDefinitionDao = context.mock( BuildDefinitionDao.class );
+ distributedBuildManager.setBuildDefinitionDao( buildDefinitionDao );
+ distributedBuildManagerStub.setBuildDefinitionDao( buildDefinitionDao );
+
+ buildResultDao = context.mock( BuildResultDao.class );
+ distributedBuildManager.setBuildResultDao( buildResultDao );
+ distributedBuildManagerStub.setBuildResultDao( buildResultDao );
+
+ projectDao = context.mock( ProjectDao.class );
+ distributedBuildManager.setProjectDao( projectDao );
+ distributedBuildManagerStub.setProjectDao( projectDao );
+
+ distributedBuildManagerStub.setContainer( getContainer() );
+
+ configurationService = context.mock( ConfigurationService.class );
+
+ distributedBuildManager.setConfigurationService( configurationService );
+ distributedBuildManagerStub.setConfigurationService( configurationService );
+
+ distributedBuildTaskQueueExecutor = (ThreadedDistributedBuildTaskQueueExecutor) context.mock( ThreadedDistributedBuildTaskQueueExecutor.class, "distributed-build-project" );
+
+ distributedBuildQueue = context.mock( TaskQueue.class, "distributed-build-queue" );
+
+ overallDistributedBuildQueue1 = context.mock( OverallDistributedBuildQueue.class, TEST_BUILD_AGENT1 );
+ overallDistributedBuildQueue2 = context.mock( OverallDistributedBuildQueue.class, TEST_BUILD_AGENT2 );
+
+ init();
+ }
+
+ private void init()
+ {
+ buildAgent1 = new BuildAgentConfiguration();
+ buildAgent1.setEnabled( true );
+ buildAgent1.setUrl( TEST_BUILD_AGENT1 );
+
+ buildAgent2 = new BuildAgentConfiguration();
+ buildAgent2.setEnabled( true );
+ buildAgent2.setUrl( TEST_BUILD_AGENT2 );
+
+ List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
+ buildAgents.add( buildAgent1 );
+ buildAgents.add( buildAgent2 );
+
+ setUpBuildAgentGroup( buildAgents );
+ setupBuildDefinition();
+
+ projectGroup = new ProjectGroup();
+ projectGroup.setId( 1 );
+ projectGroup.setGroupId( "group" );
+
+ project = new Project();
+ project.setId( 1 );
+ project.setGroupId( "groupId" );
+ project.setArtifactId( "artifactId" );
+ project.setVersion( "1.0" );
+ project.setProjectGroup( projectGroup );
+
+ project2 = new Project();
+ project2.setId( 2 );
+ project2.setGroupId( "groupId" );
+ project2.setArtifactId( "artifactId" );
+ project2.setVersion( "1.0" );
+ project2.setProjectGroup( projectGroup );
+ }
+
+ public void testViewQueuesAfterBuildAgentIsLost()
+ throws Exception
+ {
+ distributedBuildManager.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 1 ) );
+
+ recordViewQueuesAfterBuildAgentIsLost();
+
+ Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues = distributedBuildManager.getProjectsInPrepareBuildQueue();
+ Map<String, List<BuildProjectTask>> buildQueues = distributedBuildManager.getProjectsInBuildQueue();
+ Map<String, PrepareBuildProjectsTask> currentPrepareBuild = distributedBuildManager.getProjectsCurrentlyPreparingBuild();
+ Map<String, BuildProjectTask> currentBuild = distributedBuildManager.getProjectsCurrentlyBuilding();
+
+ assertEquals( prepareBuildQueues.size(), 0 );
+ assertEquals( buildQueues.size(), 0 );
+ assertEquals( currentPrepareBuild.size(), 0 );
+ assertEquals( currentBuild.size(), 0 );
+
+ context.assertIsSatisfied();
+ }
+
+ public void testDisableBuildAgentWhenUnavailableToPing()
+ throws Exception
+ {
+ distributedBuildManager.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 1 ) );
+
+ recordDisableOfBuildAgent();
+
+ distributedBuildManager.isAgentAvailable( TEST_BUILD_AGENT1 );
+
+ context.assertIsSatisfied();
+ }
+
+ public void testViewQueuesWhen2BuildAgentsAreLost()
+ throws Exception
+ {
+ distributedBuildManager.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 2 ) );
+
+ recordViewQueuesAfter2BuildAgentsAreLost();
+
+ Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues = distributedBuildManager.getProjectsInPrepareBuildQueue();
+ Map<String, List<BuildProjectTask>> buildQueues = distributedBuildManager.getProjectsInBuildQueue();
+ Map<String, PrepareBuildProjectsTask> currentPrepareBuild = distributedBuildManager.getProjectsCurrentlyPreparingBuild();
+ Map<String, BuildProjectTask> currentBuild = distributedBuildManager.getProjectsCurrentlyBuilding();
+
+ assertEquals( prepareBuildQueues.size(), 0 );
+ assertEquals( buildQueues.size(), 0 );
+ assertEquals( currentPrepareBuild.size(), 0 );
+ assertEquals( currentBuild.size(), 0 );
+
+ context.assertIsSatisfied();
+ }
+
+ public void testBuildProjectWithBuildAgentGroupWithNoCurrentBuilds()
+ throws Exception
+ {
+ distributedBuildManagerStub.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 2 ) );
+
+ Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
+ projectsBuildDefinitionsMap.put( 1, 1 );
+ projectsBuildDefinitionsMap.put( 2, 1 );
+
+ BuildTrigger buildTrigger = new BuildTrigger( 1 );
+
+ recordBuildOfProjectWithBuildAgentGroupWithNoCurrentBuilds();
+
+ List<ProjectScmRoot> scmRoots = new ArrayList<ProjectScmRoot>();
+ ProjectScmRoot scmRoot = new ProjectScmRoot();
+ scmRoot.setId( 1 );
+ scmRoot.setProjectGroup( projectGroup );
+ scmRoot.setScmRootAddress( "scmRootAddress1" );
+ scmRoots.add( scmRoot );
+
+ scmRoot = new ProjectScmRoot();
+ scmRoot.setId( 2 );
+ scmRoot.setProjectGroup( projectGroup );
+ scmRoot.setScmRootAddress( "scmRootAddress2" );
+ scmRoots.add( scmRoot );
+
+ distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress1", 1, scmRoots );
+
+ context.assertIsSatisfied();
+ }
+
+ public void testBuildProjectWithBuildAgentGroupWithCurrentBuild()
+ throws Exception
+ {
+ distributedBuildManagerStub.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 2 ) );
+
+ Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
+ projectsBuildDefinitionsMap.put( 1, 1 );
+
+ BuildTrigger buildTrigger = new BuildTrigger( 1 );
+
+ recordBuildOfProjectWithBuildAgentGroupWithCurrentBuild();
+
+ List<ProjectScmRoot> scmRoots = new ArrayList<ProjectScmRoot>();
+ ProjectScmRoot scmRoot = new ProjectScmRoot();
+ scmRoot.setId( 2 );
+ scmRoot.setProjectGroup( projectGroup );
+ scmRoot.setScmRootAddress( "scmRootAddress2" );
+ scmRoots.add( scmRoot );
+
+ scmRoot = new ProjectScmRoot();
+ scmRoot.setId( 1 );
+ scmRoot.setProjectGroup( projectGroup );
+ scmRoot.setScmRootAddress( "scmRootAddress1" );
+ scmRoots.add( scmRoot );
+
+ distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress1", 1, scmRoots );
+
+ context.assertIsSatisfied();
+ }
+
+ // CONTINUUM-2494
+ public void testBuildProjectWithTheSecondBuildAgentAttachedToTheBuildAgentGroup()
+ throws Exception
+ {
+ distributedBuildManagerStub.setOverallDistributedBuildQueues( getMockOverallDistributedBuildQueues( 2 ) );
+
+ List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
+ buildAgents.add( buildAgent2 );
+
+ setUpBuildAgentGroup( buildAgents );
+ setupBuildDefinition();
+
+ Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
+ projectsBuildDefinitionsMap.put( 1, 1 );
+
+ BuildTrigger buildTrigger = new BuildTrigger( 1 );
+
+ recordBuildProjectWithTheSecondBuildAgentAttachedToTheBuildAgentGroup();
+
+ List<ProjectScmRoot> scmRoots = new ArrayList<ProjectScmRoot>();
+ ProjectScmRoot scmRoot = new ProjectScmRoot();
+ scmRoot.setId( 1 );
+ scmRoot.setProjectGroup( projectGroup );
+ scmRoot.setScmRootAddress( "scmRootAddress1" );
+ scmRoots.add( scmRoot );
+
+ distributedBuildManagerStub.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, 1, "sample", "scmRootAddress", 1, scmRoots );
+ }
+
+ private Map<String, OverallDistributedBuildQueue> getMockOverallDistributedBuildQueues( int size )
+ {
+ Map<String, OverallDistributedBuildQueue> overallDistributedBuildQueues =
+ Collections.synchronizedMap( new LinkedHashMap<String, OverallDistributedBuildQueue>() );
+
+ buildAgents = new ArrayList<BuildAgentConfiguration>();
+ buildAgents.add( buildAgent1 );
+
+ overallDistributedBuildQueues.put( TEST_BUILD_AGENT1, overallDistributedBuildQueue1 );
+
+ if( size == 2 )
+ {
+ buildAgents.add( buildAgent2 );
+ overallDistributedBuildQueues.put( TEST_BUILD_AGENT2, overallDistributedBuildQueue2 );
+ }
+
+ return overallDistributedBuildQueues;
+ }
+
+ private void setUpBuildAgentGroup( List<BuildAgentConfiguration> buildAgents )
+ {
+ buildAgentGroup = new BuildAgentGroupConfiguration();
+ buildAgentGroup.setName( TEST_BUILD_AGENT_GROUP1 );
+ buildAgentGroup.setBuildAgents( buildAgents );
+ }
+
+ private void setupBuildDefinition()
+ {
+ Profile buildEnv1 = new Profile();
+ buildEnv1.setBuildAgentGroup( TEST_BUILD_AGENT_GROUP1 );
+
+ buildDefinition = new BuildDefinition();
+ buildDefinition.setId( 1 );
+ buildDefinition.setProfile( buildEnv1 );
+ }
+
+ private void recordDisableOfBuildAgent()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ one( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( configurationService ).updateBuildAgent( buildAgent1 );
+ one( configurationService ).store();
+ }
+ } );
+ }
+
+ private void recordViewQueuesAfterBuildAgentIsLost()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ exactly( 5 ).of( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( configurationService ).updateBuildAgent( buildAgent1 );
+ one( configurationService ).store();
+
+ exactly( 2 ).of( overallDistributedBuildQueue1 ).getDistributedBuildTaskQueueExecutor();
+ will( returnValue( distributedBuildTaskQueueExecutor ) );
+
+ one( distributedBuildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( overallDistributedBuildQueue1 ).getProjectsInQueue();
+ will( returnValue( new ArrayList<PrepareBuildProjectsTask>() ) );
+
+ one( overallDistributedBuildQueue1 ).getDistributedBuildQueue();
+ will( returnValue( distributedBuildQueue ) );
+
+ one( distributedBuildQueue ).removeAll( new ArrayList<PrepareBuildProjectsTask>() );
+
+ one( distributedBuildTaskQueueExecutor ).stop();
+ }
+ } );
+ }
+
+ private void recordViewQueuesAfter2BuildAgentsAreLost()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ exactly( 6 ).of( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( configurationService ).updateBuildAgent( buildAgent1 );
+ one( configurationService ).updateBuildAgent( buildAgent2 );
+ exactly( 2 ).of( configurationService ).store();
+
+ exactly( 2 ).of( overallDistributedBuildQueue1 ).getDistributedBuildTaskQueueExecutor();
+ will( returnValue( distributedBuildTaskQueueExecutor ) );
+
+ exactly( 2 ).of( overallDistributedBuildQueue2 ).getDistributedBuildTaskQueueExecutor();
+ will( returnValue( distributedBuildTaskQueueExecutor ) );
+
+ exactly( 2 ).of( distributedBuildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( overallDistributedBuildQueue1 ).getProjectsInQueue();
+ will( returnValue( new ArrayList<PrepareBuildProjectsTask>() ) );
+
+ one( overallDistributedBuildQueue2 ).getProjectsInQueue();
+ will( returnValue( new ArrayList<PrepareBuildProjectsTask>() ) );
+
+ one( overallDistributedBuildQueue1 ).getDistributedBuildQueue();
+ will( returnValue( distributedBuildQueue ) );
+
+ one( overallDistributedBuildQueue2 ).getDistributedBuildQueue();
+ will( returnValue( distributedBuildQueue ) );
+
+ exactly( 2 ).of( distributedBuildQueue ).removeAll( new ArrayList<PrepareBuildProjectsTask>() );
+
+ exactly( 2 ).of( distributedBuildTaskQueueExecutor ).stop();
+ }
+ } );
+ }
+
+ private void recordBuildOfProjectWithBuildAgentGroupWithNoCurrentBuilds()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ exactly( 3 ).of( projectDao ).getProjectWithDependencies( 1 );
+ will( returnValue( project ) );
+
+ exactly( 3 ).of( projectDao ).getProjectWithDependencies( 2 );
+ will( returnValue( project2) );
+
+ exactly( 3 ).of( buildDefinitionDao ).getBuildDefinition( 1 );
+ will( returnValue( buildDefinition ) );
+
+ exactly( 3 ).of( configurationService ).getBuildAgentGroup( TEST_BUILD_AGENT_GROUP1 );
+ will( returnValue( buildAgentGroup ) );
+
+ one( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( overallDistributedBuildQueue1 ).addToDistributedBuildQueue( with( any( Task.class ) ) );
+ }
+ } );
+ }
+
+ private void recordBuildOfProjectWithBuildAgentGroupWithCurrentBuild()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ one( overallDistributedBuildQueue1 ).getProjectsInQueue();
+
+ one( overallDistributedBuildQueue1 ).getDistributedBuildTaskQueueExecutor();
+ will( returnValue( distributedBuildTaskQueueExecutor ) );
+
+ one( distributedBuildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( projectDao ).getProjectsInGroup( 1 );
+ will( returnValue( new ArrayList<Project>() ) );
+
+ one( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( overallDistributedBuildQueue1 ).addToDistributedBuildQueue( with( any( Task.class ) ) );
+ }
+ } );
+ }
+
+ private void recordBuildProjectWithTheSecondBuildAgentAttachedToTheBuildAgentGroup()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ exactly( 3 ).of( projectDao ).getProjectWithDependencies( 1 );
+ will( returnValue( project ) );
+
+ exactly( 3 ).of( buildDefinitionDao ).getBuildDefinition( 1 );
+ will( returnValue( buildDefinition ) );
+
+ exactly( 3 ).of( configurationService ).getBuildAgentGroup( TEST_BUILD_AGENT_GROUP1 );
+ will( returnValue( buildAgentGroup ) );
+
+ one( configurationService ).getBuildAgents();
+ will( returnValue( buildAgents ) );
+
+ one( overallDistributedBuildQueue2 ).addToDistributedBuildQueue( with( any( Task.class ) ) );
+ }
+ } );
+ }
+}
\ No newline at end of file
diff --git a/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/DefaultDistributedBuildManagerStub.java b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/DefaultDistributedBuildManagerStub.java
new file mode 100644
index 0000000..3fb80f9
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/DefaultDistributedBuildManagerStub.java
@@ -0,0 +1,14 @@
+package org.apache.continuum.builder.distributed.stubs;
+
+import org.apache.continuum.builder.distributed.manager.DefaultDistributedBuildManager;
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
+
+public class DefaultDistributedBuildManagerStub
+ extends DefaultDistributedBuildManager
+{
+ @Override
+ public SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection( String buildAgentUrl )
+ {
+ return new SlaveBuildAgentTransportClientStub();
+ }
+}
diff --git a/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
new file mode 100644
index 0000000..fb1d48e
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
@@ -0,0 +1,262 @@
+package org.apache.continuum.builder.distributed.stubs;
+
+/*
+ * 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.
+ */
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
+
+public class SlaveBuildAgentTransportClientStub
+ implements SlaveBuildAgentTransportService
+{
+ public Boolean buildProjects( List<Map<String, Object>> projectsBuildContext )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean cancelBuild()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String generateWorkingCopyContent( int projectId, String directory, String baseUrl, String imagesBaseUrl )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Map<String, String>> getAvailableInstallations()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, Object> getBuildResult( int projectId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Integer getBuildSizeOfAgent()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public Map getListener( String releaseId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPreparedReleaseName( String releaseId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, Object> getProjectCurrentlyBuilding()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getProjectFileContent( int projectId, String directory, String filename )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Map<String, Object>> getProjectsInBuildQueue()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map getReleasePluginParameters( int projectId, String pomFilename )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, Object> getReleaseResult( String releaseId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean isProjectCurrentlyBuilding( int projectId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean isProjectGroupInQueue( int projectGroupId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+ {
+ return true;
+ }
+
+ public Boolean isProjectInBuildQueue( int projectId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean ping()
+ throws Exception
+ {
+ return true;
+ }
+
+ public List<Map<String, String>> processProject( int projectId, String pomFilename, boolean autoVersionSubmodules )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String releaseCleanup( String releaseId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
+ Map repository, String username )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
+ String scmUrl, String scmUsername, String scmPassword, String scmTag,
+ String scmTagBase, Map environments, String username )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
+ Map environments, String username )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean releaseRollback( String releaseId, int projectId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean removeFromBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean removeListener( String releaseId )
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java b/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
index e24f39b..47f260f 100644
--- a/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
+++ b/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
@@ -28,14 +28,18 @@
import org.apache.continuum.buildqueue.BuildQueueService;
import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.CheckOutTask;
import org.apache.continuum.taskqueue.OverallBuildQueue;
import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildQueue;
+import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.taskqueue.Task;
import org.codehaus.plexus.taskqueue.TaskQueue;
@@ -60,6 +64,8 @@
private BuildDefinitionDao buildDefinitionDao;
+ private ProjectDao projectDao;
+
private ConfigurationService configurationService;
private OverallBuildQueue overallBuildQueue;
@@ -68,6 +74,12 @@
private TaskQueue checkoutQueue;
+ private List<Project> projects;
+
+ private TaskQueueExecutor buildTaskQueueExecutor;
+
+ private TaskQueueExecutor checkoutTaskQueueExecutor;
+
@Override
public void setUp()
throws Exception
@@ -98,6 +110,14 @@
buildQueue = context.mock( TaskQueue.class, "build-queue" );
checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
+
+ projectDao = context.mock( ProjectDao.class );
+
+ buildsManager.setProjectDao( projectDao );
+
+ buildTaskQueueExecutor = context.mock( TaskQueueExecutor.class, "build-task-queue" );
+
+ checkoutTaskQueueExecutor = context.mock( TaskQueueExecutor.class, "checkout-task-queue" );
}
@Override
@@ -159,7 +179,7 @@
// build project recordings
private void recordStartOfBuildProjectSequence()
- throws TaskQueueException
+ throws TaskQueueException, ContinuumStoreException
{
context.checking( new Expectations()
{
@@ -167,16 +187,25 @@
exactly( 5 ).of( overallBuildQueue ).isInBuildQueue( with( any( int.class ) ) );
will( returnValue( false ) );
+ exactly( 5 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( projectDao ).getProjectsInGroup( with( any( int.class ) ) );
+ will( returnValue( projects ) );
+
one( configurationService ).getNumberOfBuildsInParallel();
will( returnValue( 2 ) );
exactly( 2 ).of( overallBuildQueue ).getBuildQueue();
will( returnValue( buildQueue ) );
+
+ exactly( 7 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
+ will( returnValue( buildTaskQueueExecutor ) );
}} );
}
private void recordBuildProjectBuildQueuesAreEmpty()
- throws TaskQueueException
+ throws TaskQueueException, ContinuumStoreException
{
// shouldn't only the build queues attached to the schedule be checked?
recordStartOfBuildProjectSequence();
@@ -185,8 +214,11 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
@@ -220,6 +252,9 @@
exactly( 2 ).of( overallBuildQueue ).getCheckoutQueue();
will( returnValue( checkoutQueue ) );
+
+ exactly( 2 ).of( overallBuildQueue ).getCheckoutTaskQueueExecutor();
+ will( returnValue( checkoutTaskQueueExecutor ) );
}} );
}
@@ -233,9 +268,12 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
@@ -276,7 +314,7 @@
recordBuildProjectBuildQueuesAreEmpty();
- buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", 1, null );
+ buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
context.assertIsSatisfied();
}
@@ -292,7 +330,7 @@
recordBuildProjectBuildQueuesAreEmpty();
- buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", 1, null );
+ buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
context.assertIsSatisfied();
//queue second project - 1st queue is not empty, 2nd queue is empty
@@ -302,24 +340,27 @@
final List<Task> tasks = new ArrayList<Task>();
final List<Task> tasksOfFirstBuildQueue = new ArrayList<Task>();
tasksOfFirstBuildQueue.add(
- new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", buildDef.getDescription(), null ) );
+ new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", buildDef.getDescription(), null, 2 ) );
context.checking( new Expectations()
{
{
- exactly( 2 ).of( buildQueue ).getQueueSnapshot();
+ one( buildQueue ).getQueueSnapshot();
will( returnValue( tasksOfFirstBuildQueue ) );
// the second build queue has no tasks queued, so it should return 0
- exactly( 2 ).of( buildQueue ).getQueueSnapshot();
+ one( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_3" ) );
}} );
recordAddToBuildQueue();
- buildsManager.buildProject( 2, buildDef, "continuum-project-test-2", 1, null );
+ buildsManager.buildProject( 2, buildDef, "continuum-project-test-2", new BuildTrigger( 1, "test-user" ), null, 2 );
context.assertIsSatisfied();
// queue third project - both queues have 1 task queued each
@@ -329,16 +370,19 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasksOfFirstBuildQueue ) );
+ exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
recordAddToBuildQueue();
- buildsManager.buildProject( 3, buildDef, "continuum-project-test-3", 1, null );
+ buildsManager.buildProject( 3, buildDef, "continuum-project-test-3", new BuildTrigger( 1, "test-user" ), null, 3 );
context.assertIsSatisfied();
}
@@ -391,8 +435,8 @@
recordCheckoutProjectBuildQueuesAreEmpty();
buildsManager.checkoutProject( 1, "continuum-project-test-1",
- new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
- "dummypass", buildDef, null );
+ new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
+ buildDef );
context.assertIsSatisfied();
}
@@ -408,8 +452,8 @@
recordCheckoutProjectBuildQueuesAreEmpty();
buildsManager.checkoutProject( 1, "continuum-project-test-1",
- new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
- "dummypass", buildDef, null );
+ new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
+ buildDef );
context.assertIsSatisfied();
// queue second project - 1st queue has 1 task while 2nd queue is empty; project should be queued in
@@ -421,17 +465,20 @@
final List<Task> tasksInFirstCheckoutQueue = new ArrayList<Task>();
tasksInFirstCheckoutQueue.add(
new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
context.checking( new Expectations()
{
{
- exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
+ one( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasksInFirstCheckoutQueue ) );
- exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
+ one( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_3" ) );
}} );
@@ -439,8 +486,8 @@
recordAddToCheckoutQueue();
buildsManager.checkoutProject( 2, "continuum-project-test-2",
- new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
- "dummypass", buildDef, null );
+ new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
+ buildDef );
context.assertIsSatisfied();
// queue third project - both queues have 1 task queued each; third project should be queued in 1st queue
@@ -449,9 +496,12 @@
context.checking( new Expectations()
{
{
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasksInFirstCheckoutQueue ) );
+ exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
}} );
@@ -459,8 +509,8 @@
recordAddToCheckoutQueue();
buildsManager.checkoutProject( 3, "continuum-project-test-3",
- new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
- "dummypass", buildDef, null );
+ new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
+ buildDef );
context.assertIsSatisfied();
}
@@ -558,12 +608,12 @@
context.mock( TaskQueueExecutor.class, "checkout-queue-executor" );
final List<Task> buildTasks = new ArrayList<Task>();
- buildTasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null ) );
+ buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
checkoutTasks.add(
new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
final ParallelBuildsThreadedTaskQueueExecutor buildTaskQueueExecutor =
context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-build-task-executor" );
@@ -626,15 +676,27 @@
exactly( 4 ).of( overallBuildQueue ).isInBuildQueue( with( any( int.class ) ) );
will( returnValue( false ) );
+ exactly( 4 ).of( buildQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( projectDao ).getProjectsInGroup( with( any( int.class ) ) );
+ will( returnValue( projects ) );
+
one( configurationService ).getNumberOfBuildsInParallel();
will( returnValue( 2 ) );
exactly( 2 ).of( overallBuildQueue ).getBuildQueue();
will( returnValue( buildQueue ) );
- exactly( 3 ).of( buildQueue ).getQueueSnapshot();
+ exactly( 6 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
+ will( returnValue( buildQueueExecutor ) );
+
+ exactly( 2 ).of( buildQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( buildQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
@@ -654,9 +716,15 @@
exactly( 2 ).of( overallBuildQueue ).getCheckoutQueue();
will( returnValue( checkoutQueue ) );
- exactly( 3 ).of( checkoutQueue ).getQueueSnapshot();
+ exactly( 2 ).of( overallBuildQueue ).getCheckoutTaskQueueExecutor();
+ will( returnValue( checkoutQueueExecutor ) );
+
+ exactly( 2 ).of( checkoutQueue ).getQueueSnapshot();
will( returnValue( tasks ) );
+ exactly( 2 ).of( checkoutQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
one( overallBuildQueue ).getName();
will( returnValue( "BUILD_QUEUE_2" ) );
@@ -680,15 +748,15 @@
buildDef.setSchedule( getSchedule( 1, 1, 2 ) );
final TaskQueueExecutor buildQueueExecutor = context.mock( TaskQueueExecutor.class, "build-queue-executor" );
- final Task buildTask = new BuildProjectTask( 1, 1, 1, "continuum-project-test-1", "BUILD_DEF", null );
+ final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1", "BUILD_DEF", null, 1 );
final List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
- buildTasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null ) );
+ buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
checkoutTasks.add(
new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
try
{
@@ -743,6 +811,15 @@
one( overallBuildQueue ).isInBuildQueue( with( any( int.class ) ) );
will( returnValue( false ) );
+ one( overallBuildQueue ).getBuildTaskQueueExecutor();
+ will( returnValue( buildTaskQueueExecutor ) );
+
+ one( buildTaskQueueExecutor ).getCurrentTask();
+ will( returnValue( null ) );
+
+ one( projectDao ).getProjectsInGroup( with( any( int.class ) ) );
+ will( returnValue( projects ) );
+
one( configurationService ).getNumberOfBuildsInParallel();
will( returnValue( 2 ) );
@@ -752,7 +829,7 @@
one( overallBuildQueue ).addToBuildQueue( with( any( BuildProjectTask.class ) ) );
}} );
- buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", 1, null );
+ buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
context.assertIsSatisfied();
}
@@ -762,7 +839,7 @@
setupMockOverallBuildQueues();
final List<Task> tasks = new ArrayList<Task>();
- tasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null ) );
+ tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
context.checking( new Expectations()
{
@@ -786,7 +863,7 @@
final List<Task> tasks = new ArrayList<Task>();
tasks.add(
new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
context.checking( new Expectations()
{
diff --git a/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java b/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java
new file mode 100644
index 0000000..be7ee37
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java
@@ -0,0 +1,102 @@
+package org.apache.continuum.release.distributed.manager;
+
+/*
+ * 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.
+ */
+
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit3.JUnit3Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+
+/**
+ * DefaultDistributedReleaseManagerTest
+ */
+public class DefaultDistributedReleaseManagerTest
+ extends PlexusInSpringTestCase
+{
+ private DefaultDistributedReleaseManager distributedReleaseManager;
+
+ private BuildResultDao buildResultDao;
+
+ private BuildResult buildResult;
+
+ private Mockery context;
+
+ @Override
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ context = new JUnit3Mockery();
+ context.setImposteriser( ClassImposteriser.INSTANCE );
+
+ distributedReleaseManager = new DefaultDistributedReleaseManager();
+
+ buildResultDao = context.mock( BuildResultDao.class );
+ distributedReleaseManager.setBuildResultDao( buildResultDao );
+ }
+
+ public void testGetDefaultBuildagent()
+ throws Exception
+ {
+ String defaultBuildagentUrl = "http://localhost:8181/continuum-buildagent/xmlrpc";
+
+ buildResult = new BuildResult();
+ buildResult.setBuildUrl( defaultBuildagentUrl );
+
+ contextBuildResultDaoExpectations();
+
+ String returnedBuildagent = distributedReleaseManager.getDefaultBuildagent( 0 );
+
+ assertNotNull( returnedBuildagent );
+ assertEquals( returnedBuildagent, defaultBuildagentUrl );
+
+ context.assertIsSatisfied();
+ }
+
+ public void testGetDefaultBuildagentNullBuildResult()
+ throws Exception
+ {
+ buildResult = null;
+
+ contextBuildResultDaoExpectations();
+
+ String returnedBuildagent = distributedReleaseManager.getDefaultBuildagent( 0 );
+
+ assertNull( returnedBuildagent );
+
+ context.assertIsSatisfied();
+ }
+
+ private void contextBuildResultDaoExpectations()
+ throws Exception
+ {
+ context.checking( new Expectations()
+ {
+ {
+ one( buildResultDao ).getLatestBuildResultForProject( 0 );
+ will( returnValue( buildResult ) );
+ }
+ } );
+ }
+}
diff --git a/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java b/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
index 375c700..dd4e8b1 100644
--- a/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
+++ b/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
@@ -25,6 +25,7 @@
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.taskqueue.Task;
@@ -84,7 +85,7 @@
{
final CheckOutTask checkoutTask =
new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
- "dummy", "dummypass", null, null );
+ "dummy", "dummypass" );
final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
context.checking( new Expectations()
@@ -107,7 +108,7 @@
final List<Task> tasks = new ArrayList<Task>();
tasks.add(
new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
context.checking( new Expectations()
{
@@ -133,7 +134,7 @@
final List<Task> tasks = new ArrayList<Task>();
tasks.add(
new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
- "dummy", "dummypass", null, null ) );
+ "dummy", "dummypass" ) );
context.checking( new Expectations()
{
@@ -154,7 +155,7 @@
{
final Task checkoutTask =
new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
- "dummy", "dummypass", null, null );
+ "dummy", "dummypass" );
final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
final List<Task> tasks = new ArrayList<Task>();
tasks.add( checkoutTask );
@@ -184,7 +185,7 @@
throws Exception
{
final BuildProjectTask buildTask =
- new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null );
+ new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
context.checking( new Expectations()
@@ -205,7 +206,7 @@
{
final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
final List<Task> tasks = new ArrayList<Task>();
- tasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null ) );
+ tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
context.checking( new Expectations()
{
@@ -229,7 +230,7 @@
{
final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
final List<Task> tasks = new ArrayList<Task>();
- tasks.add( new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null ) );
+ tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
context.checking( new Expectations()
{
@@ -248,7 +249,7 @@
public void testCancelBuildTask()
throws Exception
{
- final Task buildTask = new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null );
+ final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
context.checking( new Expectations()
{
@@ -266,7 +267,7 @@
public void testCancelCurrentBuild()
throws Exception
{
- final Task buildTask = new BuildProjectTask( 2, 1, 1, "continuum-project-test-2", "BUILD_DEF", null );
+ final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
context.checking( new Expectations()
{
@@ -302,14 +303,14 @@
one( buildQueue ).remove( with( any( Task.class ) ) );
}} );
- overallQueue.removeProjectFromBuildQueue( 1, 1, 1, "continuum-project-test-1" );
+ overallQueue.removeProjectFromBuildQueue( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1", 1 );
context.assertIsSatisfied();
}
public void testRemoveProjectFromBuildQueue()
throws Exception
{
- final Task buildTask = new BuildProjectTask( 1, 1, 1, "continuum-project-test-2", "BUILD_DEF", null );
+ final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 1 );
final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
final List<Task> tasks = new ArrayList<Task>();
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
index 3c39192..e031cad 100755
--- a/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
@@ -91,7 +91,7 @@
ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
rootPom.toURI().toURL()
.toExternalForm(), pg.getId(),
- true, false, false, bdt.getId(), false );
+ true, false, false, bdt.getId() );
assertNotNull( result );
assertEquals( 1, result.getProjects().size() );
@@ -118,7 +118,7 @@
ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
rootPom.toURI().toURL()
.toExternalForm(), -1, true,
- false, true, bdt.getId(), false );
+ false, true, bdt.getId() );
assertNotNull( result );
assertEquals( 1, result.getProjects().size() );
@@ -154,7 +154,7 @@
ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
rootPom.toURI().toURL()
.toExternalForm(), -1, true,
- false, true, -1, false );
+ false, true, -1 );
assertNotNull( result );
assertEquals( 1, result.getProjects().size() );
@@ -202,7 +202,7 @@
ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
rootPom.toURI().toURL()
.toExternalForm(), pg.getId(),
- true, false, false, -1, false );
+ true, false, false, -1 );
assertNotNull( result );
assertEquals( 1, result.getProjects().size() );
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
index f976366..7a78397 100755
--- a/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
@@ -18,6 +18,8 @@
*/
package org.apache.maven.continuum;
+import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
@@ -30,6 +32,10 @@
public class AddProjectTest
extends AbstractContinuumTest
{
+ static final String SCM_USERNAME = "test";
+
+ static final String SCM_PASSWORD = ";password";
+
public void testScmUserNamePasswordNotStoring()
throws Exception
{
@@ -38,7 +44,7 @@
ContinuumProjectBuildingResult result = continuum
.executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
- getDefaultProjectGroup().getId(), false, true, false, -1, false, false );
+ getDefaultProjectGroup().getId(), false, true, false, -1, false );
assertEquals( 1, result.getProjects().size() );
// read the project from store
@@ -56,13 +62,72 @@
ContinuumProjectBuildingResult result = continuum
.executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
- getDefaultProjectGroup().getId(), false, false, false, -1, false, false );
+ getDefaultProjectGroup().getId(), false, false, false, -1, false );
assertEquals( 1, result.getProjects().size() );
// read the project from store
Project project = continuum.getProject( result.getProjects().get( 0 ).getId() );
- assertEquals( "test", project.getScmUsername() );
- assertEquals( ";password", project.getScmPassword() );
+ assertEquals( SCM_USERNAME, project.getScmUsername() );
+ assertEquals( SCM_PASSWORD, project.getScmPassword() );
assertFalse( project.isScmUseCache() );
}
+
+ public void testAntProjectScmUserNamePasswordNotStoring()
+ throws Exception
+ {
+ // use same url since we're just going to add the project, not build it
+ String scmUrl = "http://test:;password@svn.apache.org/repos/asf/continuum/tags/continuum-1.1/continuum-api/pom.xml";
+ DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
+
+ Project project = new Project();
+ project.setName( "Sample Ant Project" );
+ project.setVersion( "1.0" );
+ project.setScmUsername( SCM_USERNAME );
+ project.setScmPassword( SCM_PASSWORD );
+ project.setScmUrl( scmUrl );
+ project.setScmUseCache( true );
+
+ BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
+
+ int projectId =
+ continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
+ getDefaultProjectGroup().getId(),
+ bdService.getDefaultAntBuildDefinitionTemplate().getId() );
+
+ // read the project from store
+ Project retrievedProject = continuum.getProject( projectId );
+ assertNull( retrievedProject.getScmUsername() );
+ assertNull( retrievedProject.getScmPassword() );
+ assertTrue( retrievedProject.isScmUseCache() );
+ }
+
+ public void testAntProjectScmUserNamePasswordStoring()
+ throws Exception
+ {
+ // use same url since we're just going to add the project, not build it
+ String scmUrl = "http://test:;password@svn.apache.org/repos/asf/continuum/tags/continuum-1.1/continuum-api/pom.xml";
+ DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
+
+ Project project = new Project();
+ project.setName( "Sample Ant Project" );
+ project.setVersion( "1.0" );
+ project.setScmUsername( SCM_USERNAME );
+ project.setScmPassword( SCM_PASSWORD );
+ project.setScmUrl( scmUrl );
+ project.setScmUseCache( false );
+
+ BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
+
+ int projectId =
+ continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
+ getDefaultProjectGroup().getId(),
+ bdService.getDefaultAntBuildDefinitionTemplate().getId() );
+
+ // read the project from store
+ Project retrievedProject = continuum.getProject( projectId );
+ assertEquals( SCM_USERNAME, retrievedProject.getScmUsername() );
+ assertEquals( SCM_PASSWORD, retrievedProject.getScmPassword() );
+ assertFalse( retrievedProject.isScmUseCache() );
+ }
+
}
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java b/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
new file mode 100644
index 0000000..4ce70a6
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
@@ -0,0 +1,45 @@
+package org.apache.maven.continuum;
+
+/*
+ * 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.
+ */
+
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
+
+/**
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ */
+public class AddProjectToCheckoutQueueStub
+ extends AbstractContinuumAction
+{
+ @SuppressWarnings( "unchecked" )
+ public void execute( Map context )
+ throws Exception
+ {
+ getLogger().info( "Executing add-project-to-checkout-queue (stub for testing) action." );
+
+ // check if scm credentials were set in context (CONTINUUM-2466)
+ Assert.assertEquals( AddProjectTest.SCM_USERNAME, CheckoutProjectContinuumAction.getScmUsername( context, null ) );
+ Assert.assertEquals( AddProjectTest.SCM_PASSWORD, CheckoutProjectContinuumAction.getScmPassword( context, null ) );
+ }
+}
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
index 9b4bca4..0aa86cf 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
@@ -27,20 +27,22 @@
import java.util.Map;
import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.dao.ProjectDao;
import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.model.repository.LocalRepository;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.initialization.ContinuumInitializer;
import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.model.project.ProjectNotifier;
-import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
import org.jmock.Expectations;
import org.jmock.Mockery;
@@ -63,6 +65,8 @@
private ProjectDao projectDao;
+ private BuildResultDao buildResultDao;
+
@Override
protected void setUp()
throws Exception
@@ -96,7 +100,7 @@
assertTrue( rootPom.exists() );
ContinuumProjectBuildingResult result =
- continuum.addMavenTwoProject( rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, -1, false );
+ continuum.addMavenTwoProject( rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, -1 );
assertNotNull( result );
@@ -129,79 +133,8 @@
assertTrue( "no irc notifier", projects.containsKey( "Continuum IRC Notifier" ) );
assertTrue( "no jabber notifier", projects.containsKey( "Continuum Jabber Notifier" ) );
- }
-
- // handle flat multi-module projects
- public void testAddMavenTwoProjectSetInSingleDirectory()
- throws Exception
- {
- Continuum continuum = (Continuum) lookup( Continuum.ROLE );
-
- String url = getTestFile( "src/test-projects/flat-multi-module/parent-project/pom.xml" ).toURL().toExternalForm();
- ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url, -1, true, false, true, -1, true );
- assertNotNull( result );
-
- List<Project> projects = result.getProjects();
-
- assertEquals( 3, projects.size() );
-
- Project rootProject = result.getRootProject();
-
- assertNotNull( rootProject );
-
- Map<String, Project> projectsMap = new HashMap<String, Project>();
-
- for ( Project project : getProjectDao().getAllProjectsByName() )
- {
- projectsMap.put( project.getName(), project );
-
- // validate project in project group
- assertTrue( "project not in project group",
- getProjectGroupDao().getProjectGroupByProjectId( project.getId() ) != null );
- }
-
- assertTrue( "no module-a", projectsMap.containsKey( "module-a" ) );
-
- assertTrue( "no module-b", projectsMap.containsKey( "module-b" ) );
-
- // check if the modules were checked out in the same directory as the parent
- ConfigurationService configurationService = ( ConfigurationService ) lookup( "configurationService" );
-
- File workingDir = configurationService.getWorkingDirectory();
-
- Project parentProject = getProjectDao().getProjectByName( "parent-project" );
-
- File checkoutDir = new File( workingDir, String.valueOf( parentProject.getId() ) );
-
- for( long delay = 0; delay <= 999999999; delay++ )
- {
- // wait while the project has been checked out
- }
-
- assertTrue( "checkout directory of project 'parent-project' does not exist." , checkoutDir.exists() );
-
- assertFalse( "module-a should not have been checked out as a separate project.",
- new File( workingDir, String.valueOf( getProjectDao().getProjectByName( "module-a" ).getId() ) ).exists() );
-
- assertFalse( "module-b should not have been checked out as a separate project.",
- new File( workingDir, String.valueOf( getProjectDao().getProjectByName( "module-b" ).getId() ) ).exists() );
-
- assertTrue( "module-a was not checked out in the same directory as it's parent.", new File( checkoutDir, "module-a" ).exists() );
-
- assertTrue( "module-b was not checked out in the same directory as it's parent.", new File( checkoutDir, "module-b" ).exists() );
-
- // assert project state
- // commented out this test case as it sometimes fails because the actual checkout hasn't finished yet so
- // the state hasn't been updated yet
- /*assertEquals( "state of 'parent-project' should have been updated.", ContinuumProjectState.CHECKEDOUT, parentProject.getState() );
-
- assertEquals( "state of 'module-a' should have been updated.", ContinuumProjectState.CHECKEDOUT,
- getProjectDao().getProjectByName( "module-a" ).getState() );
-
- assertEquals( "state of 'module-b' should have been updated.", ContinuumProjectState.CHECKEDOUT,
- getProjectDao().getProjectByName( "module-b" ).getState() );*/
}
public void testUpdateMavenTwoProject()
@@ -237,6 +170,48 @@
project = continuum.getProject( project.getId() );
}
+ public void testRemoveMavenTwoProject()
+ throws Exception
+ {
+ Continuum continuum = (Continuum) lookup( Continuum.ROLE );
+
+ Project project = makeStubProject( "test-project" );
+
+ ProjectGroup defaultGroup = getDefaultProjectGroup();
+
+ defaultGroup.addProject( project );
+
+ getProjectGroupDao().updateProjectGroup( defaultGroup );
+
+ project = getProjectDao().getProjectByName( "test-project" );
+
+ assertNotNull ( project );
+
+ BuildResult buildResult = new BuildResult();
+
+ getBuildResultDao().addBuildResult( project, buildResult );
+
+ Collection<BuildResult> brs = continuum.getBuildResultsForProject( project.getId() );
+
+ assertEquals( "Build result of project was not added", 1, brs.size() );
+
+ // delete project
+ continuum.removeProject( project.getId() );
+
+ try
+ {
+ continuum.getProject( project.getId() );
+
+ fail( "Project was not removed" );
+ }
+ catch ( ContinuumException expected )
+ {
+ brs = continuum.getBuildResultsForProject( project.getId() );
+
+ assertEquals( "Build result of project was not removed", 0, brs.size() );
+ }
+ }
+
public void testBuildDefinitions()
throws Exception
{
@@ -319,7 +294,7 @@
{
Continuum continuum = (Continuum) lookup( Continuum.ROLE );
- Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+ Collection projectGroupList = continuum.getAllProjectGroups();
int projectGroupsBefore = projectGroupList.size();
@@ -337,7 +312,7 @@
assertEquals( "plexus", projectGroup.getGroupId() );
- projectGroupList = continuum.getAllProjectGroupsWithProjects();
+ projectGroupList = continuum.getAllProjectGroups();
assertEquals( "Project group missing, should have " + ( projectGroupsBefore + 1 ) + " project groups",
projectGroupsBefore + 1, projectGroupList.size() );
@@ -348,7 +323,7 @@
BuildsManager buildsManager = continuum.getBuildsManager();
- List<Project> projects = projectGroup.getProjects();
+ List<Project> projects = continuum.getProjectGroupWithProjects( projectGroup.getId() ).getProjects();
int[] projectIds = new int[projects.size()];
int idx = 0;
@@ -364,7 +339,7 @@
continuum.removeProjectGroup( projectGroup.getId() );
- projectGroupList = continuum.getAllProjectGroupsWithProjects();
+ projectGroupList = continuum.getAllProjectGroups();
assertEquals( "Remove project group failed", projectGroupsBefore, projectGroupList.size() );
}
@@ -377,7 +352,7 @@
{
Continuum continuum = (Continuum) lookup( Continuum.ROLE );
- Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+ Collection projectGroupList = continuum.getAllProjectGroups();
int projectGroupsBefore = projectGroupList.size();
@@ -590,7 +565,7 @@
try
{
- continuum.buildProject( 1 );
+ continuum.buildProject( 1, "test-user" );
fail( "An exception should have been thrown." );
}
catch ( ContinuumException e )
@@ -636,7 +611,7 @@
try
{
- continuum.buildProjectGroup( 1 );
+ continuum.buildProjectGroup( 1, new BuildTrigger( 1, "test-user" ) );
fail( "An exception should have been thrown." );
}
catch ( ContinuumException e )
@@ -651,4 +626,9 @@
{
return (Continuum) lookup( Continuum.ROLE );
}
+
+ private BuildResultDao getBuildResultDao()
+ {
+ return (BuildResultDao) lookup( BuildResultDao.class.getName() );
+ }
}
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
index 59392cf..8304f0f 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
@@ -25,6 +25,7 @@
import java.util.Map;
import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.core.action.AbstractContinuumAction;
import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -227,9 +228,9 @@
Map<String, Object> pgContext = new HashMap<String, Object>();
- pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, project.getWorkingDirectory() );
+ AbstractContinuumAction.setWorkingDirectory( pgContext, project.getWorkingDirectory() );
- pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+ AbstractContinuumAction.setUnvalidatedProjectGroup( pgContext, projectGroup );
actionManager.lookup( "validate-project-group" ).execute( pgContext );
@@ -245,8 +246,8 @@
// projectGroup = continuumStore.addProjectGroup( projectGroup );
- BuildProjectTask task = new BuildProjectTask( project.getId(), buildDefinition.getId(), 0, project.getName(),
- buildDefinition.getDescription(), null );
+ BuildProjectTask task = new BuildProjectTask( project.getId(), buildDefinition.getId(), new BuildTrigger( 0, "" ),
+ project.getName(), buildDefinition.getDescription(), null, projectGroupId );
task.setMaxExecutionTime( maxRunTime );
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
index ee2e43c..2195e4a 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
@@ -21,9 +21,8 @@
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildResultDao;
-import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.AbstractContinuumTest;
-import org.apache.maven.continuum.core.action.AbstractContinuumAction;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildResult;
@@ -38,7 +37,6 @@
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
-import java.util.Map;
public class DefaultBuildControllerTest
extends AbstractContinuumTest
@@ -130,7 +128,7 @@
throws Exception
{
return controller.initializeBuildContext( projectId2, buildDefinitionId2,
- ContinuumProjectState.TRIGGER_SCHEDULED, new ScmResult() );
+ new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ), new ScmResult() );
}
private BuildContext getContext( int hourOfLastExecution )
@@ -141,13 +139,6 @@
oldBuildResult.setEndTime( Calendar.getInstance().getTimeInMillis() + ( hourOfLastExecution * 3600000 ) );
context.setOldBuildResult( oldBuildResult );
context.setScmResult( new ScmResult() );
-
- Map<String, Object> actionContext = context.getActionContext();
- ProjectScmRoot projectScmRoot = new ProjectScmRoot();
- projectScmRoot.setId( 1 );
- projectScmRoot.setScmRootAddress( "scm:local:src/test-projects:flat-multi-module" );
- actionContext.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot );
-
return context;
}
@@ -194,6 +185,16 @@
assertTrue( controller.shouldBuild( context ) );
}
+ public void testWithNullScmResult()
+ throws Exception
+ {
+ BuildContext context = getContext( +1 );
+ context.setScmResult( null );
+ controller.checkProjectDependencies( context );
+ assertEquals( 0, context.getModifiedDependencies().size() );
+ assertFalse( controller.shouldBuild( context ) );
+ }
+
private File getWorkingDirectory()
throws Exception
{
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java
index b88f9a8..b58b0c2 100755
--- a/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java
@@ -144,12 +144,12 @@
throws Exception
{
BuildDefinitionTemplate template = new BuildDefinitionTemplate();
- template.setName( "test" );
+ template.setName( "testTemplate" );
template = getBuildDefinitionService().addBuildDefinitionTemplate( template );
template = getBuildDefinitionService().getBuildDefinitionTemplate( template.getId() );
assertNotNull( template );
- assertEquals( "test", template.getName() );
+ assertEquals( "testTemplate", template.getName() );
List<BuildDefinition> all = getBuildDefinitionService().getAllBuildDefinitions();
assertEquals( 5, all.size() );
BuildDefinition bd =
@@ -168,4 +168,14 @@
assertEquals( 5, all.size() );
}
+
+ public void testAddDuplicateBuildDefinitionTemplate()
+ throws Exception
+ {
+ BuildDefinitionTemplate template = new BuildDefinitionTemplate();
+ template.setName( "test" );
+
+ template = getBuildDefinitionService().addBuildDefinitionTemplate( template );
+ assertNull( template );
+ }
}
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
index 7d96ffd..8509fef 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
@@ -20,8 +20,10 @@
*/
import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.codehaus.plexus.taskqueue.Task;
import org.codehaus.plexus.taskqueue.TaskQueue;
@@ -131,7 +133,8 @@
private void buildProject( int projectId, int trigger )
throws Exception
{
- buildQueue.put( new BuildProjectTask( projectId, 0, trigger, null, null, null ) );
+ ProjectGroup group = getDefaultProjectGroup();
+ buildQueue.put( new BuildProjectTask( projectId, 0, new BuildTrigger( trigger, "" ), null, null, null, group.getId() ) );
}
private void assertNextBuildIs( int expectedProjectId )
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
index b4acc69..7eec0d9 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
@@ -34,35 +34,27 @@
import org.apache.maven.settings.Settings;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.jmock.Mock;
import org.jmock.MockObjectTestCase;
public class CreateProjectsFromMetadataTest
extends MockObjectTestCase
{
+
private CreateProjectsFromMetadataAction action;
-
+
private ContinuumProjectBuildingResult result;
protected void setUp()
throws Exception
{
+ result = new ContinuumProjectBuildingResult();
action = new CreateProjectsFromMetadataAction();
action.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "" ) );
-
- recordBuildProjectFromHttp();
- }
-
- private void recordBuildProjectFromHttp()
- throws Exception
- {
- result = new ContinuumProjectBuildingResult();
-
Mock projectBuilderManagerMock = mock( ContinuumProjectBuilderManager.class );
-
+ Mock mavenSettingsBuilderMock = mock( MavenSettingsBuilder.class );
action.setProjectBuilderManager( (ContinuumProjectBuilderManager) projectBuilderManagerMock.proxy() );
-
+ action.setMavenSettingsBuilder( (MavenSettingsBuilder) mavenSettingsBuilderMock.proxy() );
action.setUrlValidator( new ContinuumUrlValidator() );
Mock projectBuilder = mock( ContinuumProjectBuilder.class );
@@ -73,13 +65,9 @@
projectBuilder.expects( once() ).method( "getDefaultBuildDefinitionTemplate" ).will(
returnValue( getDefaultBuildDefinitionTemplate() ) );
- }
- private void invokeBuildSettings()
- {
- Mock mavenSettingsBuilderMock = mock( MavenSettingsBuilder.class );
- action.setMavenSettingsBuilder( (MavenSettingsBuilder) mavenSettingsBuilderMock.proxy() );
mavenSettingsBuilderMock.expects( once() ).method( "buildSettings" ).will( returnValue( new Settings() ) );
+
}
private BuildDefinitionTemplate getDefaultBuildDefinitionTemplate()
@@ -106,20 +94,15 @@
public void testExecuteWithNonRecursiveMode()
throws Exception
{
- invokeBuildSettings();
-
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_URL,
- "http://svn.apache.org/repos/asf/maven/continuum/trunk/pom.xml" );
- context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, "id" );
- context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, true );
- context.put( CreateProjectsFromMetadataAction.KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY, false );
+ CreateProjectsFromMetadataAction.setUrl( context,
+ "http://svn.apache.org/repos/asf/maven/continuum/trunk/pom.xml" );
+ CreateProjectsFromMetadataAction.setProjectBuilderId( context, "id" );
+ CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, true );
action.execute( context );
- ContinuumProjectBuildingResult result =
- (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT )
- ;
+ ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
assertFalse(
"Should not have errors but had " + result.getErrorsAsString() + " (this test requires internet access)",
@@ -128,78 +111,71 @@
public void testExecuteWithRecursiveMode()
throws Exception
- {
- invokeBuildSettings();
-
+ {
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_URL,
- "http://svn.apache.org/repos/asf/maven/archiva/trunk/pom.xml" );
- context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, "id" );
- context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, false );
- context.put( CreateProjectsFromMetadataAction.KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY, false );
+ CreateProjectsFromMetadataAction.setUrl( context,
+ "http://svn.apache.org/repos/asf/maven/archiva/trunk/pom.xml" );
+ CreateProjectsFromMetadataAction.setProjectBuilderId( context, "id" );
+ CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, false );
action.execute( context );
- ContinuumProjectBuildingResult result =
- (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT )
- ;
+ ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
assertFalse(
"Should not have errors but had " + result.getErrorsAsString() + " (this test requires internet access)",
result.hasErrors() );
}
-
- public void testExecuteWithCheckoutProjectsInSingleDirectory()
+
+ public void testExecuteFlatMultiModuleProjectThatStartsWithTheSameLetter()
throws Exception
- {
+ {
Project project = new Project();
- project.setGroupId( "org.apache.continuum" );
- project.setArtifactId( "parent-project" );
+ project.setGroupId( "com.example.flat" );
+ project.setArtifactId( "flat-parent" );
project.setVersion( "1.0-SNAPSHOT" );
project.setId( 6 );
- project.setName( "parent-project" );
- project.setScmUrl( "scm:local:src/test-projects:flat-multi-module/parent-project" );
-
+ project.setName( "Flat Example" );
+ project.setScmUrl( "scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/flat-parent" );
+
this.result.addProject( project );
-
+
project = new Project();
- project.setGroupId( "org.apache.continuum" );
- project.setArtifactId( "module-a" );
+ project.setGroupId( "com.example.flat" );
+ project.setArtifactId( "flat-core" );
project.setVersion( "1.0-SNAPSHOT" );
project.setId( 7 );
- project.setName( "module-a" );
- project.setScmUrl( "scm:local:src/test-projects:flat-multi-module/module-a" );
-
+ project.setName( "flat-core" );
+ project.setScmUrl( "scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/flat-core" );
+
this.result.addProject( project );
-
+
project = new Project();
- project.setGroupId( "org.apache.continuum" );
- project.setArtifactId( "module-b" );
+ project.setGroupId( "com.example.flat" );
+ project.setArtifactId( "flat-webapp" );
project.setVersion( "1.0-SNAPSHOT" );
project.setId( 8 );
- project.setName( "module-b" );
- project.setScmUrl( "scm:local:src/test-projects:flat-multi-module/module-b" );
-
+ project.setName( "flat-webapp Maven Webapp" );
+ project.setScmUrl( "scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/flat-webapp" );
+
this.result.addProject( project );
-
- // assert using scm url set in root!
+
Map<String, Object> context = new HashMap<String, Object>();
- context.put( AbstractContinuumAction.KEY_URL,
- "file://" + PlexusInSpringTestCase.getBasedir() + "/src/test-projects/flat-multi-module/parent-project/pom.xml" );
- context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, "id" );
- context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, true );
- context.put( CreateProjectsFromMetadataAction.KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY, true );
+ CreateProjectsFromMetadataAction.setUrl( context,
+ "http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/flat-parent/pom.xml" );
+ CreateProjectsFromMetadataAction.setProjectBuilderId( context, "id" );
+ CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, true );
action.execute( context );
- ContinuumProjectBuildingResult result =
- (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT )
- ;
+ ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
assertFalse(
"Should not have errors but had " + result.getErrorsAsString() + " (this test requires internet access)",
result.hasErrors() );
- assertEquals( "Incorrect SCM Root Url for flat multi-module project.",
- "scm:local:src/test-projects:flat-multi-module/", context.get( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL ) );
+
+ assertEquals(
+ "Wrong scm root url created", "scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/flat-example/",
+ CreateProjectsFromMetadataAction.getUrl( context ) );
}
}
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
index a564688..2ca8902 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
@@ -30,6 +30,7 @@
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.model.scm.ScmResult;
import org.apache.maven.continuum.utils.ChrootJailWorkingDirectoryService;
import org.jmock.Expectations;
import org.jmock.Mockery;
@@ -143,7 +144,8 @@
return null;
}
- public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
+ public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition,
+ ScmResult scmResult )
throws ContinuumBuildExecutorException
{
// TODO Auto-generated method stub
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java
index 9918bd0..16d09a5 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutorTest.java
@@ -106,7 +106,7 @@
//
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -151,7 +151,7 @@
//
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -171,7 +171,7 @@
// Updating a new time to prevent duplicated notifiers
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -226,7 +226,7 @@
//
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -250,7 +250,7 @@
// Updating a new time to prevent duplicated notifiers
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -308,7 +308,7 @@
//
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
@@ -328,7 +328,7 @@
// Updating a new time to prevent duplicated notifiers
// ----------------------------------------------------------------------
- executor.updateProjectFromCheckOut( checkOut, project, null );
+ executor.updateProjectFromCheckOut( checkOut, project, null, null );
// ----------------------------------------------------------------------
//
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
index 6fcf3e6..22ac5d2 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
@@ -29,6 +29,8 @@
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMessage.RecipientType;
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
import org.apache.continuum.notification.mail.MockJavaMailSender;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -62,18 +64,39 @@
ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
+ BuildResultDao brDao = (BuildResultDao) lookup( BuildResultDao.class );
Project project = addProject( "Test Project", group );
+ BuildResult br = makeBuild( ContinuumProjectState.FAILED );
+ brDao.addBuildResult( project, br );
+
+ br = makeBuild( ContinuumProjectState.OK );
+ brDao.addBuildResult( project, br );
+
+ br = makeBuild( ContinuumProjectState.FAILED );
+ brDao.addBuildResult( project, br );
BuildResult build = makeBuild( ContinuumProjectState.OK );
+ assertEquals( ContinuumProjectState.OK, build.getState() );
+
+ project.setState( build.getState() );
+ getProjectDao().updateProject( project );
BuildDefinition buildDef = new BuildDefinition();
buildDef.setType( "maven2" );
buildDef.setBuildFile( "pom.xml" );
buildDef.setGoals( "clean install" );
buildDef.setArguments( "" );
+ BuildDefinitionDao buildDefDao = (BuildDefinitionDao) lookup( BuildDefinitionDao.class );
+ buildDef = buildDefDao.addBuildDefinition( buildDef );
build.setBuildDefinition( buildDef );
+ assertEquals( ContinuumProjectState.OK, build.getState() );
- MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots out build output", toOverride );
+ brDao.addBuildResult( project, build );
+ build = brDao.getLatestBuildResultForProjectWithDetails( project.getId() );
+ assertEquals( ContinuumProjectState.OK, build.getState() );
+
+ MimeMessage mailMessage =
+ sendNotificationAndGetMessage( project, build, buildDef, "lots out build output", toOverride );
assertEquals( "[continuum] BUILD SUCCESSFUL: foo.bar Test Project", mailMessage.getSubject() );
@@ -92,7 +115,7 @@
BuildResult build = makeBuild( ContinuumProjectState.FAILED );
- MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "output", null );
+ MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "output", null );
assertEquals( "[continuum] BUILD FAILURE: foo.bar Test Project", mailMessage.getSubject() );
@@ -110,7 +133,7 @@
build.setError( "Big long error message" );
- MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots of stack traces", null );
+ MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "lots of stack traces", null );
assertEquals( "[continuum] BUILD ERROR: foo.bar Test Project", mailMessage.getSubject() );
@@ -151,8 +174,8 @@
//
// ----------------------------------------------------------------------
- private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, String buildOutput,
- String toOverride )
+ private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, BuildDefinition buildDef,
+ String buildOutput, String toOverride )
throws Exception
{
MessageContext context = new MessageContext();
@@ -161,6 +184,8 @@
context.setBuildResult( build );
+ context.setBuildDefinition( buildDef );
+
ProjectNotifier projectNotifier = new ProjectNotifier();
projectNotifier.setType( "mail" );
Map<String, String> config = new HashMap<String, String>();
@@ -217,8 +242,6 @@
{
BuildResult build = new BuildResult();
- build.setId( 17 );
-
build.setStartTime( System.currentTimeMillis() );
build.setEndTime( System.currentTimeMillis() + 1234567 );
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
index 4af0aa0..7b02e79 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
@@ -69,7 +69,7 @@
}
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
- boolean recursiveProjects, boolean checkoutInSingleDirectory )
+ boolean recursiveProjects )
throws ContinuumProjectBuilderException
{
return null;
@@ -77,7 +77,7 @@
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
boolean recursiveProjects,
- BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
+ BuildDefinitionTemplate buildDefinitionTemplate )
throws ContinuumProjectBuilderException
{
return null;
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
index 7a6ebf0..91df7b9 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
@@ -63,7 +63,7 @@
bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );
ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
- getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null, null, false, bdt, false );
+ getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null, null, false, bdt );
assertOnResult( result );
@@ -79,7 +79,7 @@
ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL(), null, null, false,
- service.getDefaultMavenOneBuildDefinitionTemplate(), false );
+ service.getDefaultMavenOneBuildDefinitionTemplate() );
assertOnResult( result );
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
index be4907c..abfbbb6 100644
--- a/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
@@ -21,7 +21,6 @@
import java.io.File;
import java.net.URL;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -37,7 +36,6 @@
import org.apache.maven.continuum.model.project.ProjectNotifier;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -361,7 +359,7 @@
ContinuumProjectBuildingResult result;
- result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt, false );
+ result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );
assertFalse( result.hasErrors() );
assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
@@ -392,43 +390,7 @@
assertEquals( 0, projectGroup.getProjects().size() );
}
-
- public void testCreateProjectWithFlatStructure()
- throws Exception
- {
- ContinuumProjectBuilder projectBuilder =
- (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );
- URL url =
- new URL( "file://" + PlexusInSpringTestCase.getBasedir() +
- "/src/test-projects/flat-multi-module/parent-project/pom.xml" );
-
- ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( url, null, null, true, true );
-
- Project rootProject = result.getRootProject();
- assertEquals( "Incorrect root project", "parent-project", rootProject.getArtifactId() );
-
- List<Project> projects = result.getProjects();
- for( Project project : projects )
- {
- if( project.getName().equals( "parent-project" ) )
- {
- assertEquals( "Incorrect scm url for parent-project",
- "scm:local:src/test-projects:flat-multi-module/parent-project", project.getScmUrl() );
- }
- else if( project.getName().equals( "module-a" ) )
- {
- assertEquals( "Incorrect scm url for parent-project",
- "scm:local:src/test-projects:flat-multi-module/module-a", project.getScmUrl() );
- }
- else
- {
- assertEquals( "Incorrect scm url for parent-project",
- "scm:local:src/test-projects:flat-multi-module/module-b", project.getScmUrl() );
- }
- }
- }
-
private void assertDependency( String dep, String proj, Map<String, Project> projects )
{
Project p = projects.get( proj );
diff --git a/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java b/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
new file mode 100644
index 0000000..efe9e8e
--- /dev/null
+++ b/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
@@ -0,0 +1,462 @@
+package org.apache.maven.continuum.scm.queue;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.continuum.buildmanager.ParallelBuildsManager;
+import org.apache.continuum.dao.ProjectScmRootDao;
+import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
+import org.apache.maven.continuum.AbstractContinuumTest;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
+import org.codehaus.plexus.action.ActionManager;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
+import org.codehaus.plexus.util.StringUtils;
+
+public class PrepareBuildProjectsTaskExecutorTest
+ extends AbstractContinuumTest
+{
+ private ContinuumProjectBuilder projectBuilder;
+
+ private TaskQueue prepareBuildQueue;
+
+ private TaskQueueExecutor prepareBuildTaskQueueExecutor;
+
+ private ActionManager actionManager;
+
+ private ProjectScmRootDao projectScmRootDao;
+
+ private ConfigurationService configurationService;
+
+ private BuildsManager buildsManager;
+
+ @Override
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ projectBuilder =
+ (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );
+
+ prepareBuildQueue = (TaskQueue) lookup( TaskQueue.ROLE, "prepare-build-project" );
+
+ prepareBuildTaskQueueExecutor = (TaskQueueExecutor) lookup( TaskQueueExecutor.ROLE, "prepare-build-project" );
+
+ projectScmRootDao = (ProjectScmRootDao) lookup( ProjectScmRootDao.class.getName() );
+
+ actionManager = (ActionManager) lookup( ActionManager.ROLE );
+
+ configurationService = (ConfigurationService ) lookup( "configurationService" );
+
+ buildsManager = (ParallelBuildsManager) lookup( BuildsManager.class, "parallel" );
+ }
+
+ public void testCheckoutPrepareBuildMultiModuleProject()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, false );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
+ Project moduleA = getProjectDao().getProjectByName( "module-A" );
+ Project moduleB = getProjectDao().getProjectByName( "module-B" );
+
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null )
+ {
+ Thread.sleep( 10 );
+ }
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File workingDir = configurationService.getWorkingDirectory();
+
+ assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
+
+ assertTrue( "checkout directory of project 'module-A' does not exist.", new File( workingDir, Integer.toString( moduleA.getId() ) ).exists() );
+
+ assertTrue( "checkout directory of project 'module-B' does not exist.", new File( workingDir, Integer.toString( moduleB.getId() ) ).exists() );
+
+ while( !buildsManager.getCurrentBuilds().isEmpty() ||
+ isAnyProjectInBuildQueue() )
+ {
+ Thread.sleep( 10 );
+ }
+ }
+
+ public void testCheckoutPrepareBuildMultiModuleProjectFreshBuild()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", false, true );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
+ Project moduleA = getProjectDao().getProjectByName( "module-A" );
+ Project moduleB = getProjectDao().getProjectByName( "module-B" );
+
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null )
+ {
+ Thread.sleep( 10 );
+ }
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File workingDir = configurationService.getWorkingDirectory();
+
+ assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", new File( workingDir, Integer.toString( rootProject.getId() ) ).exists() );
+
+ assertTrue( "checkout directory of project 'module-A' does not exist.", new File( workingDir, Integer.toString( moduleA.getId() ) ).exists() );
+
+ assertTrue( "checkout directory of project 'module-B' does not exist.", new File( workingDir, Integer.toString( moduleB.getId() ) ).exists() );
+
+ while( !buildsManager.getCurrentBuilds().isEmpty() ||
+ isAnyProjectInBuildQueue() )
+ {
+ Thread.sleep( 10 );
+ }
+ }
+/*
+ public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProject()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", true, false );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
+
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null )
+ {
+ Thread.sleep( 10 );
+ }
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File checkedOutDir = new File( configurationService.getWorkingDirectory(), Integer.toString( rootProject.getId() ) );
+
+ assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", checkedOutDir.exists() );
+
+ assertTrue( "module-A was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-A" ).exists() );
+
+ assertTrue( "module-B was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-B" ).exists() );
+ }
+
+ public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProjectFreshBuild()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/multi-module/pom.xml", true, true );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
+
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null )
+ {
+ Thread.sleep( 10 );
+ }
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File checkedOutDir = new File( configurationService.getWorkingDirectory(), Integer.toString( rootProject.getId() ) );
+
+ assertTrue( "checkout directory of project 'multi-module-parent' does not exist.", checkedOutDir.exists() );
+
+ assertTrue( "module-A was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-A" ).exists() );
+
+ assertTrue( "module-B was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-B" ).exists() );
+ }
+
+ public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProject()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/flat-multi-module/parent-project/pom.xml", true, false );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "parent-project" );
+
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null )
+ {
+ Thread.sleep( 10 );
+ }
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File checkedOutDir = new File( configurationService.getWorkingDirectory(), Integer.toString( rootProject.getId() ) );
+
+ assertTrue( "checkout directory of project 'parent-project' does not exist.", new File( checkedOutDir, "parent-project" ).exists() );
+
+ assertTrue( "module-a was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-a" ).exists() );
+
+ assertTrue( "module-b was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-b" ).exists() );
+ }
+
+ public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProjectBuildFresh()
+ throws Exception
+ {
+ PrepareBuildProjectsTask task = createTask( "src/test-projects/flat-multi-module/parent-project/pom.xml", true, true );
+
+ this.prepareBuildQueue.put( task );
+
+ List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId() );
+
+ assertEquals( "failed to add all projects", 3, projects.size() );
+
+ Project rootProject = getProjectDao().getProjectByName( "parent-project" );
+
+ ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ // wait while task finishes prepare build
+ while( !prepareBuildQueue.getQueueSnapshot().isEmpty() ||
+ prepareBuildTaskQueueExecutor.getCurrentTask() != null || scmRoot.getState() == ContinuumProjectState.UPDATING )
+ {
+ Thread.sleep( 10 );
+
+ scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ }
+
+ scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+ assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
+
+ File checkedOutDir = new File( configurationService.getWorkingDirectory(), Integer.toString( rootProject.getId() ) );
+
+ assertTrue( "checkout directory of project 'parent-project' does not exist.", new File( checkedOutDir, "parent-project" ).exists() );
+
+ assertTrue( "module-a was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-a" ).exists() );
+
+ assertTrue( "module-b was not checked out in the same directory as it's parent.", new File( checkedOutDir, "module-b" ).exists() );
+ }
+*/
+ private PrepareBuildProjectsTask createTask( String pomResource, boolean singleCheckout, boolean buildFresh )
+ throws Exception
+ {
+ ProjectGroup projectGroup = getProjectGroup( pomResource, singleCheckout );
+
+ BuildDefinition buildDefinition = new BuildDefinition();
+ buildDefinition.setId( 0 );
+ buildDefinition.setGoals( "clean" );
+ buildDefinition.setBuildFresh( buildFresh );
+
+ projectGroup.addBuildDefinition( buildDefinition );
+
+ Map<String, Object> pgContext = new HashMap<String, Object>();
+
+ AbstractContinuumAction.setWorkingDirectory( pgContext, configurationService.getWorkingDirectory().getAbsolutePath() );
+
+ AbstractContinuumAction.setUnvalidatedProjectGroup( pgContext, projectGroup );
+
+ actionManager.lookup( "validate-project-group" ).execute( pgContext );
+
+ actionManager.lookup( "store-project-group" ).execute( pgContext );
+
+ int projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext );
+
+ projectGroup = getProjectGroupDao().getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+
+ String scmRootUrl = getScmRootUrl( projectGroup );
+
+ assertNotNull( scmRootUrl );
+
+ ProjectScmRoot scmRoot = getProjectScmRoot( projectGroup, scmRootUrl );
+
+ assertNotNull( scmRoot );
+
+ buildDefinition = (BuildDefinition) projectGroup.getBuildDefinitions().get( 0 );
+
+ Map<Integer, Integer> map = new HashMap<Integer, Integer>();
+
+ Project rootProject = null;
+
+ List<Project> projects = (List<Project>) projectGroup.getProjects();
+
+ for ( Project project : projects )
+ {
+ assertFalse( project.getId() == 0 );
+
+ map.put( project.getId(), buildDefinition.getId() );
+
+ if ( rootProject == null || rootProject.getId() > project.getId() )
+ {
+ rootProject = project;
+ }
+ }
+
+ assertEquals( 3, map.size() );
+ PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ),
+ projectGroupId, projectGroup.getName(),
+ scmRoot.getScmRootAddress(), scmRoot.getId() );
+
+ return task;
+ }
+
+ private ProjectGroup getProjectGroup( String pomResource, boolean singleCheckout )
+ throws ContinuumProjectBuilderException, IOException
+ {
+ File pom = getTestFile( pomResource );
+
+ assertNotNull( "Can't find project " + pomResource, pom );
+
+ //ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( pom.toURL(), null, null, true, singleCheckout );
+ ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( pom.toURL(), null, null, true );
+
+ // some assertions to make sure our expectations match. This is NOT
+ // meant as a unit test for the projectbuilder!
+
+ assertNotNull( "Project list not null", result.getProjects() );
+
+ assertEquals( "#Projectgroups", 1, result.getProjectGroups().size() );
+
+ ProjectGroup pg = result.getProjectGroups().get( 0 );
+
+ if ( !result.getProjects().isEmpty() )
+ {
+ for ( Project p : result.getProjects() )
+ {
+ pg.addProject( p );
+ }
+ }
+
+ return pg;
+ }
+
+ private ProjectScmRoot getProjectScmRoot ( ProjectGroup pg, String url )
+ throws Exception
+ {
+ if ( StringUtils.isEmpty( url ) )
+ {
+ return null;
+ }
+
+ ProjectScmRoot scmRoot =
+ projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( pg.getId(), url );
+
+ if ( scmRoot != null )
+ {
+ return scmRoot;
+ }
+
+ ProjectScmRoot projectScmRoot = new ProjectScmRoot();
+
+ projectScmRoot.setProjectGroup( pg );
+
+ projectScmRoot.setScmRootAddress( url );
+
+ projectScmRoot.setState( ContinuumProjectState.ERROR );
+
+ return projectScmRootDao.addProjectScmRoot( projectScmRoot );
+ }
+
+ private String getScmRootUrl( ProjectGroup pg )
+ {
+ String scmRootUrl = null;
+
+ for ( Project project : (List<Project>) pg.getProjects() )
+ {
+ String scmUrl = project.getScmUrl();
+
+ scmRootUrl = getCommonPath( scmUrl, scmRootUrl );
+ }
+
+ return scmRootUrl;
+ }
+
+ private String getCommonPath( String path1, String path2 )
+ {
+ if ( path2 == null || path2.equals( "" ) )
+ {
+ return path1;
+ }
+ else
+ {
+ int indexDiff = StringUtils.differenceAt( path1, path2 );
+ return path1.substring( 0, indexDiff );
+ }
+ }
+
+ private boolean isAnyProjectInBuildQueue()
+ throws Exception
+ {
+ Map<String, List<BuildProjectTask>> buildTasks = buildsManager.getProjectsInBuildQueues();
+
+ for ( String queue : buildTasks.keySet() )
+ {
+ if ( !buildTasks.get( queue ).isEmpty() )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/continuum-core/src/test/resources/org/apache/maven/continuum/AddProjectTest.xml b/continuum-core/src/test/resources/org/apache/maven/continuum/AddProjectTest.xml
index 18f0152..3c7b069 100644
--- a/continuum-core/src/test/resources/org/apache/maven/continuum/AddProjectTest.xml
+++ b/continuum-core/src/test/resources/org/apache/maven/continuum/AddProjectTest.xml
@@ -24,5 +24,10 @@
<role-hint>continuumUrl</role-hint>
<implementation>org.apache.maven.continuum.utils.ContinuumUrlValidator</implementation>
</component>
+ <component>
+ <role>org.codehaus.plexus.action.Action</role>
+ <role-hint>add-project-to-checkout-queue</role-hint>
+ <implementation>org.apache.maven.continuum.AddProjectToCheckoutQueueStub</implementation>
+ </component>
</components>
</plexus>
diff --git a/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml b/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
index e652092..b8b1d1a 100644
--- a/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
+++ b/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
@@ -59,7 +59,7 @@
<fromMailbox>continuum@localhost</fromMailbox>
<fromName>Continuum</fromName>
<timestampFormat>EEE, d MMM yyyy HH:mm:ss Z</timestampFormat>
- <includeBuildResult>true</includeBuildResult>
+ <includeBuildOutput>true</includeBuildOutput>
<toOverride>nobody@localhost</toOverride>
</configuration>
</component>
diff --git a/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml b/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
index 2538d6e..e6464e4 100644
--- a/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
+++ b/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
@@ -61,7 +61,7 @@
<fromMailbox>continuum@localhost</fromMailbox>
<fromName>Continuum</fromName>
<timestampFormat>EEE, d MMM yyyy HH:mm:ss Z</timestampFormat>
- <includeBuildResult>true</includeBuildResult>
+ <includeBuildOutput>true</includeBuildOutput>
</configuration>
</component>
diff --git a/continuum-data-management/continuum-legacy/pom.xml b/continuum-data-management/continuum-legacy/pom.xml
index be19cca..aea9e52 100644
--- a/continuum-data-management/continuum-legacy/pom.xml
+++ b/continuum-data-management/continuum-legacy/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-legacy</artifactId>
@@ -36,36 +36,19 @@
<execution>
<id>modello-continuum-metadata</id>
<goals>
- <goal>jpox-metadata-class</goal>
<goal>java</goal>
<goal>stax-reader</goal>
<goal>stax-writer</goal>
</goals>
</execution>
- <execution>
- <id>jpox-jdo-mapping</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-replication</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
- <replicationParameters>true</replicationParameters>
- </configuration>
- </execution>
</executions>
<configuration>
<version>1.0.9</version>
<packageWithVersion>true</packageWithVersion>
- <model>src/main/mdo/continuum.xml</model>
+ <models>
+ <model>src/main/mdo/continuum.xml</model>
+ </models>
+ <useJava5>true</useJava5>
</configuration>
</plugin>
<plugin>
@@ -83,12 +66,14 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>hack-sources</id>
- <phase>process-sources</phase>
+ <id>hack-resources</id>
+ <phase>process-classes</phase>
<configuration>
<tasks>
- <!-- Workaround for MODELLO-89 -->
- <replace file="target/generated-sources/modello/org/apache/maven/continuum/model/project/v1_0_9/ContinuumModelloMetadata.java" token="project;" value="project.v1_0_9;" />
+ <move file="target/classes/META-INF/package.jdorepl" tofile="target/classes/META-INF/package.jdorepl109" />
+ <move file="target/classes/META-INF/package.jdo" tofile="target/classes/META-INF/package.jdo109" />
+ <delete file="target/classes/package.jdo" />
+ <delete file="target/classes/package.jdorepl" />
</tasks>
</configuration>
<goals>
@@ -96,22 +81,13 @@
</goals>
</execution>
<execution>
- <id>hack-resources</id>
+ <id>copy-resources</id>
+ <!-- Need to perform the workaround for MODELLO-91 first -->
<phase>process-classes</phase>
<configuration>
<tasks>
- <!-- Workaround for MODELLO-91 -->
- <replace dir="target/classes/META-INF" token="name="notifiertype"" value="name="type"" />
- <replace dir="target/classes/META-INF" token="name="resultstate"" value="name="state"" />
- <replace dir="target/classes/META-INF" token="name="resulttrigger"" value="name="trigger"" />
- <replace dir="target/classes/META-INF" token="name="projectstate"" value="name="state"" />
- <replace dir="target/classes/META-INF" token="name="changecomment"" value="name="comment"" />
- <replace dir="target/classes/META-INF" token="name="changedate"" value="name="date"" />
- <replace dir="target/classes/META-INF" token="name="scheduledelay"" value="name="delay"" />
- <move file="target/classes/META-INF/package.jdorepl" tofile="target/classes/META-INF/package.jdorepl109" />
- <move file="target/classes/META-INF/package.jdo" tofile="target/classes/META-INF/package.jdo109" />
- <delete file="target/classes/package.jdo" />
- <delete file="target/classes/package.jdorepl" />
+ <copy file="target/classes/META-INF/package.jdorepl109" todir="target/classes" />
+ <copy file="target/classes/META-INF/package.jdo109" todir="target/classes" />
</tasks>
</configuration>
<goals>
diff --git a/continuum-data-management/continuum-legacy/src/main/java/org/apache/maven/continuum/model/project/v1_0_9/ContinuumModelloMetadata.java b/continuum-data-management/continuum-legacy/src/main/java/org/apache/maven/continuum/model/project/v1_0_9/ContinuumModelloMetadata.java
new file mode 100644
index 0000000..f9c1225
--- /dev/null
+++ b/continuum-data-management/continuum-legacy/src/main/java/org/apache/maven/continuum/model/project/v1_0_9/ContinuumModelloMetadata.java
@@ -0,0 +1,16 @@
+package org.apache.maven.continuum.model.project.v1_0_9;
+
+public class ContinuumModelloMetadata
+{
+ private String modelVersion;
+
+ public String getModelVersion()
+ {
+ return modelVersion;
+ }
+
+ public void setModelVersion( String modelVersion )
+ {
+ this.modelVersion = modelVersion;
+ }
+}
diff --git a/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml b/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
index f6eba0a..1df1a4f 100644
--- a/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
+++ b/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
@@ -504,6 +504,11 @@
<version>1.0.9</version>
<type>int</type>
</field>
+ <field>
+ <name>username</name>
+ <version>1.0.9+</version>
+ <type>String</type>
+ </field>
<field jpox.column="resultstate">
<name>state</name>
<version>1.1.0+</version>
diff --git a/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdo b/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdo
new file mode 100644
index 0000000..e391bb1
--- /dev/null
+++ b/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdo
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.apache.maven.continuum.model.project.v1_0_9">
+ <class name="ProjectGroup" detachable="true" table="ProjectGroup" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="groupId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="projects" mapped-by="projectGroup">
+ <collection element-type="Project" dependent-element="true"/>
+ </field>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="ProjectGroup_detail">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="projectgroup-projects">
+ <field name="projects"/>
+ </fetch-group>
+ </class>
+ <class name="Project" detachable="true" table="Project" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="executorId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="url">
+ <column length="256"/>
+ </field>
+ <field name="scmUrl">
+ <column length="256"/>
+ </field>
+ <field name="scmTag"/>
+ <field name="scmUsername"/>
+ <field name="scmPassword"/>
+ <field name="version"/>
+ <field name="state">
+ <column name="state"/>
+ </field>
+ <field name="oldState"/>
+ <field name="latestBuildId"/>
+ <field name="buildNumber"/>
+ <field name="workingDirectory">
+ <column length="256"/>
+ </field>
+ <field name="buildResults" mapped-by="project">
+ <collection element-type="BuildResult" dependent-element="true"/>
+ </field>
+ <field name="checkoutResult" dependent="true"/>
+ <field name="developers">
+ <collection element-type="ProjectDeveloper" dependent-element="true"/>
+ </field>
+ <field name="parent" dependent="true"/>
+ <field name="dependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="Project_detail">
+ <field name="buildResults"/>
+ <field name="checkoutResult"/>
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-all-details">
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-with-builds">
+ <field name="buildResults"/>
+ </fetch-group>
+ <fetch-group name="project-dependencies">
+ <field name="parent"/>
+ <field name="dependencies"/>
+ </fetch-group>
+ <fetch-group name="project-with-checkout-result">
+ <field name="checkoutResult"/>
+ </fetch-group>
+ </class>
+ <class name="ProjectNotifier" detachable="true" table="ProjectNotifier" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="type">
+ <column name="type"/>
+ </field>
+ <field name="from">
+ <column name="notifierorigin"/>
+ </field>
+ <field name="enabled"/>
+ <field name="recipientType"/>
+ <field name="sendOnSuccess"/>
+ <field name="sendOnFailure"/>
+ <field name="sendOnError"/>
+ <field name="sendOnWarning"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ <class name="ProjectDeveloper" detachable="true" table="ProjectDeveloper">
+ <field name="scmId"/>
+ <field name="name"/>
+ <field name="email"/>
+ <field name="continuumId"/>
+ </class>
+ <class name="ProjectDependency" detachable="true" table="ProjectDependency">
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="version"/>
+ </class>
+ <class name="BuildResult" detachable="true" table="BuildResult" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="project" default-fetch-group="true"/>
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="buildNumber"/>
+ <field name="state">
+ <column name="state"/>
+ </field>
+ <field name="trigger">
+ <column name="trigger"/>
+ </field>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="success"/>
+ <field name="exitCode"/>
+ <field name="scmResult" dependent="true"/>
+ <field name="testResult" dependent="true"/>
+ <fetch-group name="BuildResult_detail">
+ <field name="scmResult"/>
+ <field name="testResult"/>
+ </fetch-group>
+ <fetch-group name="build-result-with-details">
+ <field name="scmResult"/>
+ <field name="testResult"/>
+ </fetch-group>
+ </class>
+ <class name="BuildDefinition" detachable="true" table="BuildDefinition" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="defaultForProject"/>
+ <field name="goals"/>
+ <field name="arguments"/>
+ <field name="buildFile"/>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="latestBuildId" null-value="default">
+ <column default-value="0"/>
+ </field>
+ </class>
+ <class name="Schedule" detachable="true" table="Schedule" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="delay">
+ <column name="delay"/>
+ </field>
+ <field name="maxJobExecutionTime"/>
+ <field name="cronExpression"/>
+ </class>
+ <class name="ContinuumModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="1.0.9"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.scm.v1_0_9">
+ <class name="ScmResult" detachable="true" table="ScmResult">
+ <field name="success"/>
+ <field name="commandLine">
+ <column length="1024"/>
+ </field>
+ <field name="providerMessage">
+ <column length="1024"/>
+ </field>
+ <field name="commandOutput">
+ <column length="1024"/>
+ </field>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ <field name="changes" default-fetch-group="true">
+ <collection element-type="ChangeSet" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeSet" detachable="true" table="ChangeSet">
+ <field name="author"/>
+ <field name="comment">
+ <column name="comment" length="8192"/>
+ </field>
+ <field name="date">
+ <column name="date"/>
+ </field>
+ <field name="files" default-fetch-group="true">
+ <collection element-type="ChangeFile" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeFile" detachable="true" table="ChangeFile">
+ <field name="name"/>
+ <field name="revision"/>
+ <field name="status"/>
+ </class>
+ <class name="TestResult" detachable="true" table="TestResult">
+ <field name="testCount"/>
+ <field name="failureCount"/>
+ <field name="totalTime"/>
+ <field name="suiteResults" default-fetch-group="true">
+ <collection element-type="SuiteResult" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="SuiteResult" detachable="true" table="SuiteResult">
+ <field name="name"/>
+ <field name="testCount"/>
+ <field name="failureCount"/>
+ <field name="totalTime"/>
+ <field name="failures" default-fetch-group="true">
+ <collection element-type="TestCaseFailure" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="TestCaseFailure" detachable="true" table="TestCaseFailure">
+ <field name="name"/>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.system.v1_0_9">
+ <class name="SystemConfiguration" detachable="true" table="SystemConfiguration">
+ <field name="guestAccountEnabled"/>
+ <field name="defaultScheduleDescription"/>
+ <field name="defaultScheduleCronExpression"/>
+ <field name="workingDirectory"/>
+ <field name="buildOutputDirectory"/>
+ <field name="deploymentRepositoryDirectory"/>
+ <field name="baseUrl"/>
+ <field name="initialized"/>
+ </class>
+ <class name="NotificationAddress" detachable="true" table="NotificationAddress">
+ <field name="type">
+ <column name="type"/>
+ </field>
+ <field name="address"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdorepl b/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdorepl
new file mode 100644
index 0000000..4853d3f
--- /dev/null
+++ b/continuum-data-management/continuum-legacy/src/main/resources/META-INF/package.jdorepl
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.apache.maven.continuum.model.project.v1_0_9">
+ <class name="ProjectGroup" detachable="true" table="ProjectGroup" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="groupId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="projects" mapped-by="projectGroup">
+ <collection element-type="Project" dependent-element="true"/>
+ </field>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="ProjectGroup_detail">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="projectgroup-projects">
+ <field name="projects"/>
+ </fetch-group>
+ </class>
+ <class name="Project" detachable="true" table="Project" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="executorId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="url">
+ <column length="256"/>
+ </field>
+ <field name="scmUrl">
+ <column length="256"/>
+ </field>
+ <field name="scmTag"/>
+ <field name="scmUsername"/>
+ <field name="scmPassword"/>
+ <field name="version"/>
+ <field name="state">
+ <column name="state"/>
+ </field>
+ <field name="oldState"/>
+ <field name="latestBuildId"/>
+ <field name="buildNumber"/>
+ <field name="workingDirectory">
+ <column length="256"/>
+ </field>
+ <field name="buildResults" mapped-by="project">
+ <collection element-type="BuildResult" dependent-element="true"/>
+ </field>
+ <field name="checkoutResult" dependent="true"/>
+ <field name="developers">
+ <collection element-type="ProjectDeveloper" dependent-element="true"/>
+ </field>
+ <field name="parent" dependent="true"/>
+ <field name="dependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="Project_detail">
+ <field name="buildResults"/>
+ <field name="checkoutResult"/>
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-all-details">
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-with-builds">
+ <field name="buildResults"/>
+ </fetch-group>
+ <fetch-group name="project-dependencies">
+ <field name="parent"/>
+ <field name="dependencies"/>
+ </fetch-group>
+ <fetch-group name="project-with-checkout-result">
+ <field name="checkoutResult"/>
+ </fetch-group>
+ </class>
+ <class name="ProjectNotifier" detachable="true" table="ProjectNotifier" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="type">
+ <column name="type"/>
+ </field>
+ <field name="from">
+ <column name="notifierorigin"/>
+ </field>
+ <field name="enabled"/>
+ <field name="recipientType"/>
+ <field name="sendOnSuccess"/>
+ <field name="sendOnFailure"/>
+ <field name="sendOnError"/>
+ <field name="sendOnWarning"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ <class name="ProjectDeveloper" detachable="true" table="ProjectDeveloper">
+ <field name="scmId"/>
+ <field name="name"/>
+ <field name="email"/>
+ <field name="continuumId"/>
+ </class>
+ <class name="ProjectDependency" detachable="true" table="ProjectDependency">
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="version"/>
+ </class>
+ <class name="BuildResult" detachable="true" table="BuildResult" identity-type="application">
+ <field name="project" default-fetch-group="true"/>
+ <field name="id" primary-key="true"/>
+ <field name="buildNumber"/>
+ <field name="state">
+ <column name="state"/>
+ </field>
+ <field name="trigger">
+ <column name="trigger"/>
+ </field>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="success"/>
+ <field name="exitCode"/>
+ <field name="scmResult" dependent="true"/>
+ <field name="testResult" dependent="true"/>
+ <fetch-group name="BuildResult_detail">
+ <field name="scmResult"/>
+ <field name="testResult"/>
+ </fetch-group>
+ <fetch-group name="build-result-with-details">
+ <field name="scmResult"/>
+ <field name="testResult"/>
+ </fetch-group>
+ </class>
+ <class name="BuildDefinition" detachable="true" table="BuildDefinition" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="defaultForProject"/>
+ <field name="goals"/>
+ <field name="arguments"/>
+ <field name="buildFile"/>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="latestBuildId" null-value="default">
+ <column default-value="0"/>
+ </field>
+ </class>
+ <class name="Schedule" detachable="true" table="Schedule" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="delay">
+ <column name="delay"/>
+ </field>
+ <field name="maxJobExecutionTime"/>
+ <field name="cronExpression"/>
+ </class>
+ <class name="ContinuumModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="1.0.9"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.scm.v1_0_9">
+ <class name="ScmResult" detachable="true" table="ScmResult">
+ <field name="success"/>
+ <field name="commandLine">
+ <column length="1024"/>
+ </field>
+ <field name="providerMessage">
+ <column length="1024"/>
+ </field>
+ <field name="commandOutput">
+ <column length="1024"/>
+ </field>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ <field name="changes" default-fetch-group="true">
+ <collection element-type="ChangeSet" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeSet" detachable="true" table="ChangeSet">
+ <field name="author"/>
+ <field name="comment">
+ <column name="comment" length="8192"/>
+ </field>
+ <field name="date">
+ <column name="date"/>
+ </field>
+ <field name="files" default-fetch-group="true">
+ <collection element-type="ChangeFile" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeFile" detachable="true" table="ChangeFile">
+ <field name="name"/>
+ <field name="revision"/>
+ <field name="status"/>
+ </class>
+ <class name="TestResult" detachable="true" table="TestResult">
+ <field name="testCount"/>
+ <field name="failureCount"/>
+ <field name="totalTime"/>
+ <field name="suiteResults" default-fetch-group="true">
+ <collection element-type="SuiteResult" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="SuiteResult" detachable="true" table="SuiteResult">
+ <field name="name"/>
+ <field name="testCount"/>
+ <field name="failureCount"/>
+ <field name="totalTime"/>
+ <field name="failures" default-fetch-group="true">
+ <collection element-type="TestCaseFailure" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="TestCaseFailure" detachable="true" table="TestCaseFailure">
+ <field name="name"/>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.system.v1_0_9">
+ <class name="SystemConfiguration" detachable="true" table="SystemConfiguration">
+ <field name="guestAccountEnabled"/>
+ <field name="defaultScheduleDescription"/>
+ <field name="defaultScheduleCronExpression"/>
+ <field name="workingDirectory"/>
+ <field name="buildOutputDirectory"/>
+ <field name="deploymentRepositoryDirectory"/>
+ <field name="baseUrl"/>
+ <field name="initialized"/>
+ </class>
+ <class name="NotificationAddress" detachable="true" table="NotificationAddress">
+ <field name="type">
+ <column name="type"/>
+ </field>
+ <field name="address"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/data-management-api/pom.xml b/continuum-data-management/data-management-api/pom.xml
index 1fe879e..b771166 100644
--- a/continuum-data-management/data-management-api/pom.xml
+++ b/continuum-data-management/data-management-api/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-management-api</artifactId>
diff --git a/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java b/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
index 6f3b8b2..2c29373 100644
--- a/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
+++ b/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
@@ -42,10 +42,11 @@
* Restore the database.
*
* @param backupDirectory the directory where the backup to restore from resides
+ * @param strict
* @throws java.io.IOException if there is a problem reading the backup file
* @throws DataManagementException if there is a problem parsing the backup file
*/
- void restoreDatabase( File backupDirectory )
+ void restoreDatabase( File backupDirectory, boolean strict )
throws IOException, DataManagementException;
/**
diff --git a/continuum-data-management/data-management-cli/pom.xml b/continuum-data-management/data-management-cli/pom.xml
index 0d7c483..46ec38d 100644
--- a/continuum-data-management/data-management-cli/pom.xml
+++ b/continuum-data-management/data-management-cli/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-management-cli</artifactId>
@@ -55,10 +55,6 @@
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-classworlds</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
@@ -68,6 +64,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -75,6 +72,11 @@
<scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
@@ -89,43 +91,70 @@
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
+ <artifactId>plexus-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
- <!-- TODO: shade it instead, not currently working with this
- <plugin>
- <artifactId>shade-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <goals>
- <goal>shade</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <shadedArtifactAttached>true</shadedArtifactAttached>
+ <shadedClassifierName>app</shadedClassifierName>
+ <shadedArtifactAttached>true</shadedArtifactAttached>
+ <shadedClassifierName>app</shadedClassifierName>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+ <resource>META-INF/spring.handlers</resource>
+ </transformer>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+ <resource>META-INF/spring.schemas</resource>
+ </transformer>
+ </transformers>
+ <artifactSet>
+ <excludes>
+ <exclude>xml-apis:xml-apis</exclude>
+ </excludes>
+ </artifactSet>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.1</version>
<configuration>
- <descriptor>src/assembly/app.xml</descriptor>
<archive>
<manifest>
<mainClass>org.apache.maven.continuum.management.DataManagementCli</mainClass>
</manifest>
</archive>
</configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
</plugin>
</plugins>
</build>
diff --git a/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
index 6a4a8d1..6fd4bee 100644
--- a/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
+++ b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
@@ -40,6 +40,7 @@
import org.apache.maven.artifact.resolver.ResolutionListener;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
+import org.apache.maven.continuum.management.util.PlexusFileSystemXmlApplicationContext;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.Mirror;
import org.apache.maven.settings.Profile;
@@ -48,12 +49,12 @@
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.repository.RepositoryPermissions;
-import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
-import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.spring.PlexusClassPathXmlApplicationContext;
+import org.codehaus.plexus.spring.PlexusContainerAdapter;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -78,6 +79,14 @@
{
private static final Logger LOGGER = Logger.getLogger( DataManagementCli.class );
+ private static final String JAR_FILE_PREFIX = "jar:file:";
+
+ private static final String FILE_PREFIX = "file:";
+
+ private static final String SPRING_CONTEXT_LOC = "!/**/META-INF/spring-context.xml";
+
+ private static final String PLEXUS_XML_LOC = "!/**/META-INF/plexus/components.xml";
+
public static void main( String[] args )
throws Exception
{
@@ -166,25 +175,35 @@
Logger.getRootLogger().setLevel( Level.INFO );
Logger.getLogger( "JPOX" ).setLevel( Level.WARN );
}
+
+ if ( command.settings != null && !command.settings.isFile() )
+ {
+ System.err.println( command.settings + " not exists or is not a file." );
+ Args.usage( command );
+ return;
+ }
if ( command.buildsJdbcUrl != null )
{
LOGGER.info( "Processing Continuum database..." );
processDatabase( databaseType, databaseFormat, mode, command.buildsJdbcUrl, command.directory,
- databaseFormat.getContinuumToolRoleHint(), "data-management-jdo", "continuum" );
+ command.settings, databaseFormat.getContinuumToolRoleHint(), "data-management-jdo",
+ "continuum", command.strict );
}
if ( command.usersJdbcUrl != null )
{
LOGGER.info( "Processing Redback database..." );
processDatabase( databaseType, databaseFormat, mode, command.usersJdbcUrl, command.directory,
- databaseFormat.getRedbackToolRoleHint(), "data-management-redback-jdo", "redback" );
+ command.settings, databaseFormat.getRedbackToolRoleHint(), "data-management-redback-jdo",
+ "redback", command.strict );
}
}
private static void processDatabase( SupportedDatabase databaseType, DatabaseFormat databaseFormat,
- OperationMode mode, String jdbcUrl, File directory, String toolRoleHint,
- String managementArtifactId, String configRoleHint )
+ OperationMode mode, String jdbcUrl, File directory, File setting,
+ String toolRoleHint, String managementArtifactId, String configRoleHint,
+ boolean strict )
throws PlexusContainerException, ComponentLookupException, ComponentLifecycleException,
ArtifactNotFoundException, ArtifactResolutionException, IOException
{
@@ -193,22 +212,31 @@
DatabaseParams params = new DatabaseParams( databaseType.defaultParams );
params.setUrl( jdbcUrl );
- DefaultPlexusContainer container = new DefaultPlexusContainer();
+ PlexusClassPathXmlApplicationContext classPathApplicationContext = new PlexusClassPathXmlApplicationContext(
+ new String[]{"classpath*:/META-INF/spring-context.xml", "classpath*:/META-INF/plexus/components.xml",
+ "classpath*:/META-INF/plexus/plexus.xml"} );
- initializeWagon( container );
+ PlexusContainerAdapter container = new PlexusContainerAdapter();
+ container.setApplicationContext( classPathApplicationContext );
+
+ initializeWagon( container, setting );
List<Artifact> artifacts = new ArrayList<Artifact>();
artifacts.addAll(
- downloadArtifact( container, params.getGroupId(), params.getArtifactId(), params.getVersion() ) );
+ downloadArtifact( container, params.getGroupId(), params.getArtifactId(),
+ params.getVersion(), setting ) );
artifacts.addAll(
- downloadArtifact( container, "org.apache.continuum", managementArtifactId, applicationVersion ) );
- artifacts.addAll( downloadArtifact( container, "jpox", "jpox", databaseFormat.getJpoxVersion() ) );
+ downloadArtifact( container, "org.apache.continuum", managementArtifactId,
+ applicationVersion, setting ) );
+ artifacts.addAll( downloadArtifact( container, "jpox", "jpox", databaseFormat.getJpoxVersion(), setting ) );
- List<File> jars = new ArrayList<File>();
+ List<String> jars = new ArrayList<String>();
// Little hack to make it work more nicely in the IDE
List<String> exclusions = new ArrayList<String>();
URLClassLoader cp = (URLClassLoader) DataManagementCli.class.getClassLoader();
+ List<URL> jarUrls = new ArrayList<URL>();
+
for ( URL url : cp.getURLs() )
{
String urlEF = url.toExternalForm();
@@ -223,7 +251,8 @@
{
LOGGER.debug( "[IDE Help] Adding '" + id + "' as an exclusion and using one from classpath" );
exclusions.add( "org.apache.continuum:" + id );
- jars.add( new File( url.getPath() ) );
+ jars.add( url.getPath() );
+ jarUrls.add( url );
}
}
@@ -231,9 +260,11 @@
if ( urlEF.contains( "jpox-enhancer" ) )
{
LOGGER.debug( "[IDE Help] Adding 'jpox-enhancer' as an exclusion and using one from classpath" );
- jars.add( new File( url.getPath() ) );
+ jars.add( url.getPath() );
+ jarUrls.add( url );
}
}
+
ArtifactFilter filter = new ExcludesArtifactFilter( exclusions );
for ( Artifact a : artifacts )
@@ -243,29 +274,35 @@
if ( a.getVersion().equals( databaseFormat.getJpoxVersion() ) )
{
LOGGER.debug( "Adding artifact: " + a.getFile() );
- jars.add( a.getFile() );
+ jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + SPRING_CONTEXT_LOC );
+ jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + PLEXUS_XML_LOC );
+ jarUrls.add( new URL( FILE_PREFIX + a.getFile().getAbsolutePath() ) );
}
}
else if ( filter.include( a ) )
{
LOGGER.debug( "Adding artifact: " + a.getFile() );
- jars.add( a.getFile() );
+ jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + SPRING_CONTEXT_LOC );
+ jars.add( JAR_FILE_PREFIX + a.getFile().getAbsolutePath() + PLEXUS_XML_LOC );
+ jarUrls.add( new URL( FILE_PREFIX + a.getFile().getAbsolutePath() ) );
}
}
- ClassRealm realm = container.createComponentRealm( "app", jars );
+ URLClassLoader newClassLoader = new URLClassLoader( (URL[]) jarUrls.toArray( new URL[jarUrls.size()] ), cp );
+ Thread.currentThread().setContextClassLoader( newClassLoader );
+ classPathApplicationContext.setClassLoader( newClassLoader );
- ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader( realm );
+ PlexusFileSystemXmlApplicationContext fileSystemApplicationContext = new PlexusFileSystemXmlApplicationContext(
+ (String[]) jars.toArray( new String[jars.size()] ), classPathApplicationContext );
+ fileSystemApplicationContext.setClassLoader( newClassLoader );
+ container.setApplicationContext( fileSystemApplicationContext );
- ClassRealm oldRealm = container.setLookupRealm( realm );
-
- DatabaseFactoryConfigurator configurator = (DatabaseFactoryConfigurator) container.lookup(
- DatabaseFactoryConfigurator.class.getName(), configRoleHint, realm );
+ DatabaseFactoryConfigurator configurator = (DatabaseFactoryConfigurator) container.lookup(
+ DatabaseFactoryConfigurator.class.getName(), configRoleHint );
configurator.configure( params );
DataManagementTool manager =
- (DataManagementTool) container.lookup( DataManagementTool.class.getName(), toolRoleHint, realm );
+ (DataManagementTool) container.lookup( DataManagementTool.class.getName(), toolRoleHint );
if ( mode == OperationMode.EXPORT )
{
@@ -274,19 +311,16 @@
else if ( mode == OperationMode.IMPORT )
{
manager.eraseDatabase();
- manager.restoreDatabase( directory );
+ manager.restoreDatabase( directory, strict );
}
-
- container.setLookupRealm( oldRealm );
- Thread.currentThread().setContextClassLoader( oldLoader );
}
- private static void initializeWagon( DefaultPlexusContainer container )
+ private static void initializeWagon( PlexusContainerAdapter container, File setting )
throws ComponentLookupException, ComponentLifecycleException, IOException
{
WagonManager wagonManager = (WagonManager) container.lookup( WagonManager.ROLE );
- Settings settings = getSettings( container );
+ Settings settings = getSettings( container, setting );
try
{
@@ -342,7 +376,7 @@
}
private static Collection<Artifact> downloadArtifact( PlexusContainer container, String groupId, String artifactId,
- String version )
+ String version, File setting )
throws ComponentLookupException, ArtifactNotFoundException, ArtifactResolutionException, IOException
{
ArtifactRepositoryFactory factory =
@@ -352,14 +386,14 @@
(DefaultRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, "default" );
ArtifactRepository localRepository =
- factory.createArtifactRepository( "local", getLocalRepositoryURL( container ), layout, null, null );
+ factory.createArtifactRepository( "local", getLocalRepositoryURL( container, setting ), layout, null, null );
List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
remoteRepositories.add(
factory.createArtifactRepository( "central", "http://repo1.maven.org/maven2", layout, null, null ) );
//Load extra repositories from active profile
- Settings settings = getSettings( container );
+ Settings settings = getSettings( container, setting );
List<String> profileIds = settings.getActiveProfiles();
Map<String, Profile> profilesAsMap = settings.getProfilesAsMap();
if ( profileIds != null && !profileIds.isEmpty() )
@@ -424,29 +458,43 @@
return result.getArtifacts();
}
- private static String getLocalRepositoryURL( PlexusContainer container )
+ private static String getLocalRepositoryURL( PlexusContainer container, File setting )
throws ComponentLookupException, IOException
{
+ String repositoryPath;
File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml" );
- if ( !settingsFile.exists() )
+ if ( setting != null )
{
- return new File( System.getProperty( "user.home" ), ".m2/repository" ).toURL().toString();
+ Settings settings = getSettings( container, setting );
+ repositoryPath = new File( settings.getLocalRepository() ).toURL().toString();
+ }
+ else if ( !settingsFile.exists() )
+ {
+ repositoryPath = new File( System.getProperty( "user.home" ), ".m2/repository" ).toURL().toString();
}
else
{
- Settings settings = getSettings( container );
- return new File( settings.getLocalRepository() ).toURL().toString();
+ Settings settings = getSettings( container, null );
+ repositoryPath = new File( settings.getLocalRepository() ).toURL().toString();
}
+ return repositoryPath;
}
- private static Settings getSettings( PlexusContainer container )
+ private static Settings getSettings( PlexusContainer container, File setting )
throws ComponentLookupException, IOException
{
MavenSettingsBuilder mavenSettingsBuilder =
(MavenSettingsBuilder) container.lookup( MavenSettingsBuilder.class.getName() );
try
{
- return mavenSettingsBuilder.buildSettings( false );
+ if ( setting != null )
+ {
+ return mavenSettingsBuilder.buildSettings( setting, false );
+ }
+ else
+ {
+ return mavenSettingsBuilder.buildSettings( false );
+ }
}
catch ( XmlPullParserException e )
{
@@ -538,6 +586,12 @@
description = "Turn on debugging information. Default is off.",
value = "debug")
private boolean debug;
+
+ @Argument( description = "Alternate path for the user settings file", value = "settings", required = false, alias = "s" )
+ private File settings;
+
+ @Argument(description = "Run on strict mode. Default is false.", value="strict")
+ private boolean strict;
}
private enum OperationMode
diff --git a/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusApplicationContextDelegate.java b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusApplicationContextDelegate.java
new file mode 100644
index 0000000..e4f05c3
--- /dev/null
+++ b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusApplicationContextDelegate.java
@@ -0,0 +1,99 @@
+package org.apache.maven.continuum.management.util;
+
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.codehaus.plexus.spring.PlexusBeanDefinitionDocumentReader;
+import org.codehaus.plexus.spring.PlexusConfigurationPropertyEditor;
+import org.codehaus.plexus.spring.PlexusContainerAdapter;
+import org.codehaus.plexus.spring.PlexusLifecycleBeanPostProcessor;
+import org.codehaus.plexus.spring.editors.CollectionPropertyEditor;
+import org.codehaus.plexus.spring.editors.MapPropertyEditor;
+import org.codehaus.plexus.spring.editors.PropertiesPropertyEditor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+
+public class PlexusApplicationContextDelegate
+{
+ /** Logger used by this class. */
+ protected Logger logger = LoggerFactory.getLogger( getClass() );
+
+ private PlexusLifecycleBeanPostProcessor lifecycleBeanPostProcessor;
+
+ /**
+ * @see org.springframework.context.support.AbstractXmlApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader)
+ */
+ protected void loadBeanDefinitions( XmlBeanDefinitionReader reader )
+ throws BeansException, IOException
+ {
+ logger.info( "Registering Plexus to Spring XML translation" );
+ reader.setDocumentReaderClass( PlexusBeanDefinitionDocumentReader.class );
+ }
+
+ /**
+ * @see org.springframework.context.support.AbstractApplicationContext#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
+ */
+ protected void postProcessBeanFactory( ConfigurableListableBeanFactory beanFactory, ApplicationContext context )
+ {
+ // Register a PlexusContainerAdapter bean to allow context lookups using plexus API
+ PlexusContainerAdapter plexus = new PlexusContainerAdapter();
+ plexus.setApplicationContext( context );
+ beanFactory.registerSingleton( "plexusContainer", plexus );
+
+ // Register a beanPostProcessor to handle plexus interface-based lifecycle management
+ lifecycleBeanPostProcessor = new PlexusLifecycleBeanPostProcessor();
+ lifecycleBeanPostProcessor.setBeanFactory( context );
+ beanFactory.addBeanPostProcessor( lifecycleBeanPostProcessor );
+
+ // Register a PropertyEditor to support plexus XML <configuration> set as CDATA in
+ // a spring context XML file.
+ beanFactory.addPropertyEditorRegistrar( new PlexusConfigurationPropertyEditor() );
+ beanFactory.addPropertyEditorRegistrar( new PropertiesPropertyEditor() );
+ beanFactory.addPropertyEditorRegistrar( new CollectionPropertyEditor( List.class, ArrayList.class ) );
+ beanFactory.addPropertyEditorRegistrar( new CollectionPropertyEditor( Set.class, HashSet.class ) );
+ beanFactory.addPropertyEditorRegistrar( new MapPropertyEditor( Map.class, HashMap.class ) );
+ }
+
+ /**
+ * @see org.springframework.context.support.AbstractApplicationContext#doClose()
+ */
+ protected void doClose()
+ {
+ try
+ {
+ lifecycleBeanPostProcessor.destroy();
+ }
+ catch ( Throwable ex )
+ {
+ logger.error( "Exception thrown from PlexusLifecycleBeanPostProcessor handling ContextClosedEvent", ex );
+ }
+ }
+}
\ No newline at end of file
diff --git a/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusFileSystemXmlApplicationContext.java b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusFileSystemXmlApplicationContext.java
new file mode 100644
index 0000000..0bc1b94
--- /dev/null
+++ b/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/util/PlexusFileSystemXmlApplicationContext.java
@@ -0,0 +1,117 @@
+package org.apache.maven.continuum.management.util;
+
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+
+import org.codehaus.plexus.spring.PlexusXmlBeanDefinitionReader;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.ResourceEntityResolver;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+public class PlexusFileSystemXmlApplicationContext
+ extends FileSystemXmlApplicationContext
+{
+ private static PlexusApplicationContextDelegate delegate = new PlexusApplicationContextDelegate();
+
+ public PlexusFileSystemXmlApplicationContext( String configLocation )
+ {
+ super( configLocation );
+ }
+
+ public PlexusFileSystemXmlApplicationContext( String[] configLocations )
+ {
+ super( configLocations );
+ }
+
+ public PlexusFileSystemXmlApplicationContext( String[] configLocations, ApplicationContext parent )
+ {
+ super( configLocations, parent );
+ }
+
+ public PlexusFileSystemXmlApplicationContext( String[] configLocations, boolean refresh )
+ {
+ super( configLocations, refresh );
+ }
+
+ public PlexusFileSystemXmlApplicationContext( String[] configLocations, boolean refresh, ApplicationContext parent )
+ {
+ super( configLocations, refresh, parent );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.springframework.context.support.AbstractXmlApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader)
+ */
+ protected void loadBeanDefinitions( XmlBeanDefinitionReader reader )
+ throws BeansException, IOException
+ {
+ delegate.loadBeanDefinitions( reader );
+ super.loadBeanDefinitions( reader );
+ }
+
+ /**
+ * Copied from {@link AbstractXmlApplicationContext}
+ * Loads the bean definitions via an XmlBeanDefinitionReader.
+ * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader
+ * @see #initBeanDefinitionReader
+ * @see #loadBeanDefinitions
+ */
+ protected void loadBeanDefinitions( DefaultListableBeanFactory beanFactory ) throws IOException {
+ // Create a new XmlBeanDefinitionReader for the given BeanFactory.
+ XmlBeanDefinitionReader beanDefinitionReader = new PlexusXmlBeanDefinitionReader( beanFactory );
+
+ // Configure the bean definition reader with this context's
+ // resource loading environment.
+ beanDefinitionReader.setResourceLoader( this );
+ beanDefinitionReader.setEntityResolver( new ResourceEntityResolver( this ) );
+
+ // Allow a subclass to provide custom initialization of the reader,
+ // then proceed with actually loading the bean definitions.
+ initBeanDefinitionReader( beanDefinitionReader );
+ loadBeanDefinitions( beanDefinitionReader );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.springframework.context.support.AbstractApplicationContext#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
+ */
+ protected void postProcessBeanFactory( ConfigurableListableBeanFactory beanFactory )
+ {
+ delegate.postProcessBeanFactory( beanFactory, this );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.springframework.context.support.AbstractApplicationContext#doClose()
+ */
+ protected void doClose()
+ {
+ delegate.doClose();
+ super.doClose();
+ }
+}
\ No newline at end of file
diff --git a/continuum-data-management/data-management-jdo/pom.xml b/continuum-data-management/data-management-jdo/pom.xml
index 1b04c2e..b30d195 100644
--- a/continuum-data-management/data-management-jdo/pom.xml
+++ b/continuum-data-management/data-management-jdo/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-management-jdo</artifactId>
@@ -73,6 +73,7 @@
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-commons</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>stax</groupId>
diff --git a/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java b/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
index e06e295..98c232c 100644
--- a/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
+++ b/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
@@ -232,7 +232,7 @@
daoUtils.eraseDatabase();
}
- public void restoreDatabase( File backupDirectory )
+ public void restoreDatabase( File backupDirectory, boolean strict )
throws IOException
{
ContinuumStaxReader reader = new ContinuumStaxReader();
@@ -242,7 +242,7 @@
ContinuumDatabase database;
try
{
- database = reader.read( fileReader );
+ database = reader.read( fileReader, strict );
}
catch ( XMLStreamException e )
{
diff --git a/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java b/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
index 859f9fe..86cb055 100644
--- a/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
+++ b/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
@@ -189,7 +189,7 @@
return pm;
}
- public void restoreDatabase( File backupDirectory )
+ public void restoreDatabase( File backupDirectory, boolean strict )
throws IOException
{
ContinuumStaxReader reader = new ContinuumStaxReader();
@@ -199,7 +199,7 @@
ContinuumDatabase database;
try
{
- database = reader.read( fileReader );
+ database = reader.read( fileReader, strict );
}
catch ( XMLStreamException e )
{
diff --git a/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java b/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
index 41d4042..80932dd 100644
--- a/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
+++ b/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
@@ -118,7 +118,7 @@
IOUtil.copy( getClass().getResourceAsStream( "/expected.xml" ), new FileWriter( backupFile ) );
- dataManagementTool.restoreDatabase( targetDirectory );
+ dataManagementTool.restoreDatabase( targetDirectory, true );
/*
// TODO: why is this wrong?
assertBuildDatabase();
diff --git a/continuum-data-management/data-management-redback-jdo/pom.xml b/continuum-data-management/data-management-redback-jdo/pom.xml
index 4ca21ac..35d6bf0 100644
--- a/continuum-data-management/data-management-redback-jdo/pom.xml
+++ b/continuum-data-management/data-management-redback-jdo/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-management-redback-jdo</artifactId>
diff --git a/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java b/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
index 4cec1d1..df9b241 100644
--- a/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
+++ b/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
@@ -84,7 +84,7 @@
toolDelegate.eraseUsersDatabase( userManager );
}
- public void restoreDatabase( File backupDirectory )
+ public void restoreDatabase( File backupDirectory, boolean strict )
throws IOException
{
try
diff --git a/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java b/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
index 4f86c5f..7bcda01 100644
--- a/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
+++ b/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
@@ -101,7 +101,7 @@
}
}
- public void restoreDatabase( File backupDirectory )
+ public void restoreDatabase( File backupDirectory, boolean strict )
throws IOException, DataManagementException
{
try
diff --git a/continuum-data-management/pom.xml b/continuum-data-management/pom.xml
index a77809a..d5d93f3 100644
--- a/continuum-data-management/pom.xml
+++ b/continuum-data-management/pom.xml
@@ -25,7 +25,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<artifactId>continuum-data-management</artifactId>
diff --git a/continuum-data-management/redback-legacy/pom.xml b/continuum-data-management/redback-legacy/pom.xml
index 1ec2032..d24dbd5 100644
--- a/continuum-data-management/redback-legacy/pom.xml
+++ b/continuum-data-management/redback-legacy/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>continuum-data-management</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>redback-legacy</artifactId>
@@ -16,149 +16,59 @@
<execution>
<id>modello-rbac</id>
<goals>
- <goal>jpox-metadata-class</goal>
<goal>java</goal>
<goal>stax-reader</goal>
<goal>stax-writer</goal>
</goals>
<configuration>
- <model>src/main/mdo/rbac-jdo.mdo</model>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-rbac</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/rbac-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/authorization/rbac/jdo
- </outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-rbac-replication</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/rbac-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/authorization/rbac/jdo
- </outputDirectory>
- <replicationParameters>true</replicationParameters>
+ <models>
+ <model>src/main/mdo/rbac-jdo.mdo</model>
+ </models>
</configuration>
</execution>
<execution>
<id>modello-keys</id>
<goals>
- <goal>jpox-metadata-class</goal>
<goal>java</goal>
<goal>stax-reader</goal>
<goal>stax-writer</goal>
</goals>
<configuration>
- <model>src/main/mdo/keys-jdo.mdo</model>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-keys</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/keys-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/keys/jdo
- </outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-keys-replication</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/keys-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/keys/jdo
- </outputDirectory>
- <replicationParameters>true</replicationParameters>
+ <models>
+ <model>src/main/mdo/keys-jdo.mdo</model>
+ </models>
</configuration>
</execution>
<execution>
<id>modello-users</id>
<goals>
- <goal>jpox-metadata-class</goal>
<goal>java</goal>
<goal>stax-reader</goal>
<goal>stax-writer</goal>
</goals>
<configuration>
- <model>src/main/mdo/users-jdo.mdo</model>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-users</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/users-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/user/jdo
- </outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-users-replication</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <model>src/main/mdo/users-jdo.mdo</model>
- <outputDirectory>
- ${basedir}/target/classes/org/codehaus/plexus/security/user/jdo
- </outputDirectory>
- <replicationParameters>true</replicationParameters>
+ <models>
+ <model>src/main/mdo/users-jdo.mdo</model>
+ </models>
</configuration>
</execution>
</executions>
<configuration>
<version>0.9.0</version>
<packageWithVersion>true</packageWithVersion>
+ <!--<useJava5>true</useJava5>-->
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>hack-sources</id>
- <phase>generate-sources</phase>
+ <id>copy-resources</id>
+ <phase>process-resources</phase>
<configuration>
<tasks>
- <!-- Workaround for MODELLO-89 -->
- <replace file="target/generated-sources/modello/org/codehaus/plexus/security/keys/jdo/v0_9_0/PlexusSecurityKeyManagementJdoModelloMetadata.java" token="jdo;" value="jdo.v0_9_0;" />
- <replace file="target/generated-sources/modello/org/codehaus/plexus/security/authorization/rbac/jdo/v0_9_0/RbacJdoModelModelloMetadata.java" token="jdo;" value="jdo.v0_9_0;" />
- <replace file="target/generated-sources/modello/org/codehaus/plexus/security/user/jdo/v0_9_0/UserManagementModelloMetadata.java" token="jdo;" value="jdo.v0_9_0;" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>hack-resources</id>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <!-- Workaround for MODELLO-91 -->
- <replace dir="target/classes/org/codehaus/plexus/security/user/jdo" token="name="USER_PASSWORD"" value="name="PASSWORD"" />
- <replace dir="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo" token="SECURITY_" value="" />
- <replace dir="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo" token="name="RBAC_OPERATION"" value="name="OPERATION"" />
- <replace dir="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo" token="name="RBAC_RESOURCE"" value="name="RESOURCE"" />
- <replace dir="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo" token="name="LAST_UPDATED"" value="name="TIMESTAMP"" />
+ <copy file="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdorepl" todir="target/classes" />
+ <copy file="target/classes/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdo" todir="target/classes" />
</tasks>
</configuration>
<goals>
diff --git a/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/authorization/rbac/jdo/v0_9_0/RbacJdoModelModelloMetadata.java b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/authorization/rbac/jdo/v0_9_0/RbacJdoModelModelloMetadata.java
new file mode 100644
index 0000000..896edb1
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/authorization/rbac/jdo/v0_9_0/RbacJdoModelModelloMetadata.java
@@ -0,0 +1,16 @@
+package org.codehaus.plexus.security.authorization.rbac.jdo.v0_9_0;
+
+public class RbacJdoModelModelloMetadata
+{
+ private String modelVersion;
+
+ public String getModelVersion()
+ {
+ return modelVersion;
+ }
+
+ public void setModelVersion( String modelVersion )
+ {
+ this.modelVersion = modelVersion;
+ }
+}
diff --git a/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/keys/jdo/v0_9_0/PlexusSecurityKeyManagementJdoModelloMetadata.java b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/keys/jdo/v0_9_0/PlexusSecurityKeyManagementJdoModelloMetadata.java
new file mode 100644
index 0000000..cb012e1
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/keys/jdo/v0_9_0/PlexusSecurityKeyManagementJdoModelloMetadata.java
@@ -0,0 +1,16 @@
+package org.codehaus.plexus.security.keys.jdo.v0_9_0;
+
+public class PlexusSecurityKeyManagementJdoModelloMetadata
+{
+ private String modelVersion;
+
+ public String getModelVersion()
+ {
+ return modelVersion;
+ }
+
+ public void setModelVersion( String modelVersion )
+ {
+ this.modelVersion = modelVersion;
+ }
+}
diff --git a/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/user/jdo/v0_9_0/UserManagementModelloMetadata.java b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/user/jdo/v0_9_0/UserManagementModelloMetadata.java
new file mode 100644
index 0000000..cddc69c
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/java/org/codehaus/plexus/security/user/jdo/v0_9_0/UserManagementModelloMetadata.java
@@ -0,0 +1,16 @@
+package org.codehaus.plexus.security.user.jdo.v0_9_0;
+
+public class UserManagementModelloMetadata
+{
+ private String modelVersion;
+
+ public String getModelVersion()
+ {
+ return modelVersion;
+ }
+
+ public void setModelVersion( String modelVersion )
+ {
+ this.modelVersion = modelVersion;
+ }
+}
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdo b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdo
new file mode 100644
index 0000000..4075497
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdo
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.authorization.rbac.jdo.v0_9_0">
+ <class name="RbacDatabase" detachable="true" table="RbacDatabase">
+ <field name="roles">
+ <collection element-type="JdoRole" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="permissions">
+ <collection element-type="JdoPermission" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="operations">
+ <collection element-type="JdoOperation" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="resources">
+ <collection element-type="JdoResource" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="userAssignments">
+ <collection element-type="JdoUserAssignment" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="RbacDatabase_detail">
+ <field name="roles"/>
+ <field name="permissions"/>
+ <field name="operations"/>
+ <field name="resources"/>
+ <field name="userAssignments"/>
+ </fetch-group>
+ </class>
+ <class name="JdoRole" detachable="true" table="ROLES" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="assignable"/>
+ <field name="permanent"/>
+ <field name="childRoleNames" persistence-modifier="persistent" table="ROLE_CHILDROLE_MAP" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="false"/>
+ <join/>
+ </field>
+ <field name="permissions" table="ROLE_PERMISSION_MAP" default-fetch-group="true">
+ <collection element-type="JdoPermission" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="role-child-detail">
+ <field name="childRoleNames"/>
+ <field name="permissions"/>
+ </fetch-group>
+ </class>
+ <class name="JdoPermission" detachable="true" table="PERMISSIONS" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="permanent"/>
+ <field name="operation" indexed="true" default-fetch-group="true"/>
+ <field name="resource" indexed="true" default-fetch-group="true"/>
+ </class>
+ <class name="JdoOperation" detachable="true" table="OPERATIONS" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="permanent"/>
+ <field name="resourceRequired"/>
+ </class>
+ <class name="JdoResource" detachable="true" table="RESOURCES" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="identifier" primary-key="true"/>
+ <field name="pattern"/>
+ <field name="permanent"/>
+ </class>
+ <class name="JdoUserAssignment" detachable="true" table="USER_ASSIGNMENTS" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="principal" primary-key="true"/>
+ <field name="timestamp">
+ <column name="TIMESTAMP"/>
+ </field>
+ <field name="permanent"/>
+ <field name="roleNames" persistence-modifier="persistent" table="USERASSIGNMENT_ROLENAMES" indexed="false" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="true"/>
+ <join/>
+ </field>
+ </class>
+ <class name="RbacJdoModelModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdorepl b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdorepl
new file mode 100644
index 0000000..962eea2
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/authorization/rbac/jdo/package.jdorepl
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.authorization.rbac.jdo.v0_9_0">
+ <class name="RbacDatabase" detachable="true" table="RbacDatabase">
+ <field name="roles">
+ <collection element-type="JdoRole" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="permissions">
+ <collection element-type="JdoPermission" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="operations">
+ <collection element-type="JdoOperation" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="resources">
+ <collection element-type="JdoResource" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="userAssignments">
+ <collection element-type="JdoUserAssignment" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="RbacDatabase_detail">
+ <field name="roles"/>
+ <field name="permissions"/>
+ <field name="operations"/>
+ <field name="resources"/>
+ <field name="userAssignments"/>
+ </fetch-group>
+ </class>
+ <class name="JdoRole" detachable="true" table="ROLES" identity-type="application">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="assignable"/>
+ <field name="permanent"/>
+ <field name="childRoleNames" persistence-modifier="persistent" table="ROLE_CHILDROLE_MAP" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="false"/>
+ <join/>
+ </field>
+ <field name="permissions" table="ROLE_PERMISSION_MAP" default-fetch-group="true">
+ <collection element-type="JdoPermission" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="role-child-detail">
+ <field name="childRoleNames"/>
+ <field name="permissions"/>
+ </fetch-group>
+ </class>
+ <class name="JdoPermission" detachable="true" table="PERMISSIONS" identity-type="application">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="permanent"/>
+ <field name="operation" indexed="true" default-fetch-group="true"/>
+ <field name="resource" indexed="true" default-fetch-group="true"/>
+ </class>
+ <class name="JdoOperation" detachable="true" table="OPERATIONS" identity-type="application">
+ <field name="name" primary-key="true"/>
+ <field name="description"/>
+ <field name="permanent"/>
+ <field name="resourceRequired"/>
+ </class>
+ <class name="JdoResource" detachable="true" table="RESOURCES" identity-type="application">
+ <field name="identifier" primary-key="true"/>
+ <field name="pattern"/>
+ <field name="permanent"/>
+ </class>
+ <class name="JdoUserAssignment" detachable="true" table="USER_ASSIGNMENTS" identity-type="application">
+ <field name="principal" primary-key="true"/>
+ <field name="timestamp">
+ <column name="TIMESTAMP"/>
+ </field>
+ <field name="permanent"/>
+ <field name="roleNames" persistence-modifier="persistent" table="USERASSIGNMENT_ROLENAMES" indexed="false" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="true"/>
+ <join/>
+ </field>
+ </class>
+ <class name="RbacJdoModelModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdo b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdo
new file mode 100644
index 0000000..c8b9edb
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdo
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.keys.jdo.v0_9_0">
+ <class name="AuthenticationKeyDatabase" detachable="true" table="AuthenticationKeyDatabase">
+ <field name="keys">
+ <collection element-type="JdoAuthenticationKey" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="AuthenticationKeyDatabase_detail">
+ <field name="keys"/>
+ </fetch-group>
+ </class>
+ <class name="JdoAuthenticationKey" detachable="true" table="JdoAuthenticationKey" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="key" persistence-modifier="persistent" primary-key="true">
+ <column name="AUTHKEY"/>
+ </field>
+ <field name="forPrincipal"/>
+ <field name="purpose"/>
+ <field name="dateCreated"/>
+ <field name="dateExpires"/>
+ </class>
+ <class name="PlexusSecurityKeyManagementJdoModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdorepl b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdorepl
new file mode 100644
index 0000000..4fcab9f
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/keys/jdo/package.jdorepl
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.keys.jdo.v0_9_0">
+ <class name="AuthenticationKeyDatabase" detachable="true" table="AuthenticationKeyDatabase">
+ <field name="keys">
+ <collection element-type="JdoAuthenticationKey" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="AuthenticationKeyDatabase_detail">
+ <field name="keys"/>
+ </fetch-group>
+ </class>
+ <class name="JdoAuthenticationKey" detachable="true" table="JdoAuthenticationKey" identity-type="application">
+ <field name="key" persistence-modifier="persistent" primary-key="true">
+ <column name="AUTHKEY"/>
+ </field>
+ <field name="forPrincipal"/>
+ <field name="purpose"/>
+ <field name="dateCreated"/>
+ <field name="dateExpires"/>
+ </class>
+ <class name="PlexusSecurityKeyManagementJdoModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdo b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdo
new file mode 100644
index 0000000..cf551b5
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdo
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.user.jdo.v0_9_0">
+ <class name="UserDatabase" detachable="true" table="UserDatabase">
+ <field name="users">
+ <collection element-type="JdoUser" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="UserDatabase_detail">
+ <field name="users"/>
+ </fetch-group>
+ </class>
+ <class name="JdoUser" detachable="true" table="JdoUser" identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+ <field name="username" persistence-modifier="persistent" primary-key="true"/>
+ <field name="password">
+ <column name="PASSWORD"/>
+ </field>
+ <field name="encodedPassword"/>
+ <field name="fullName"/>
+ <field name="email"/>
+ <field name="lastPasswordChange"/>
+ <field name="lastLoginDate"/>
+ <field name="countFailedLoginAttempts"/>
+ <field name="locked"/>
+ <field name="permanent"/>
+ <field name="validated"/>
+ <field name="passwordChangeRequired"/>
+ <field name="previousEncodedPasswords" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="accountCreationDate"/>
+ </class>
+ <class name="UserManagementModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdorepl b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdorepl
new file mode 100644
index 0000000..96d7e44
--- /dev/null
+++ b/continuum-data-management/redback-legacy/src/main/resources/org/codehaus/plexus/security/user/jdo/package.jdorepl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.codehaus.plexus.security.user.jdo.v0_9_0">
+ <class name="UserDatabase" detachable="true" table="UserDatabase">
+ <field name="users">
+ <collection element-type="JdoUser" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="UserDatabase_detail">
+ <field name="users"/>
+ </fetch-group>
+ </class>
+ <class name="JdoUser" detachable="true" table="JdoUser" identity-type="application">
+ <field name="username" persistence-modifier="persistent" primary-key="true"/>
+ <field name="password">
+ <column name="PASSWORD"/>
+ </field>
+ <field name="encodedPassword"/>
+ <field name="fullName"/>
+ <field name="email"/>
+ <field name="lastPasswordChange"/>
+ <field name="lastLoginDate"/>
+ <field name="countFailedLoginAttempts"/>
+ <field name="locked"/>
+ <field name="permanent"/>
+ <field name="validated"/>
+ <field name="passwordChangeRequired"/>
+ <field name="previousEncodedPasswords" default-fetch-group="true">
+ <collection element-type="java.lang.String" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="accountCreationDate"/>
+ </class>
+ <class name="UserManagementModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="0.9.0"/>
+ </field>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-distributed/continuum-distributed-commons/pom.xml b/continuum-distributed/continuum-distributed-commons/pom.xml
new file mode 100644
index 0000000..f54f276
--- /dev/null
+++ b/continuum-distributed/continuum-distributed-commons/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>continuum-distributed</artifactId>
+ <groupId>org.apache.continuum</groupId>
+ <version>1.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>continuum-distributed-commons</artifactId>
+ <name>Continuum :: Distributed Build :: Commons</name>
+</project>
diff --git a/continuum-distributed/continuum-distributed-commons/src/main/java/org/apache/continuum/distributed/commons/utils/ContinuumDistributedUtil.java b/continuum-distributed/continuum-distributed-commons/src/main/java/org/apache/continuum/distributed/commons/utils/ContinuumDistributedUtil.java
new file mode 100644
index 0000000..be52c94
--- /dev/null
+++ b/continuum-distributed/continuum-distributed-commons/src/main/java/org/apache/continuum/distributed/commons/utils/ContinuumDistributedUtil.java
@@ -0,0 +1,126 @@
+package org.apache.continuum.distributed.commons.utils;
+
+/*
+ * 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.
+ */
+
+import java.util.Map;
+
+/**
+ * ContinuumDistributedUtil
+ */
+public class ContinuumDistributedUtil
+{
+ public static final String KEY_PROJECT_ID = "project-id";
+
+ public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+
+ public static final String KEY_PROJECT_NAME = "project-name";
+
+ public static final String KEY_ARTIFACT_ID = "artifact-id";
+
+ public static int getProjectId( Map<String, Object> context )
+ {
+ return getInteger( context, KEY_PROJECT_ID );
+ }
+
+ public static int getProjectGroupId( Map<String, Object> context )
+ {
+ return getInteger( context, KEY_PROJECT_GROUP_ID );
+ }
+
+ public static String getArtifactId( Map<String, Object> context )
+ {
+ return getString( context, KEY_ARTIFACT_ID );
+ }
+
+ public static String getProjectName( Map<String, Object> context )
+ {
+ return getString( context, KEY_PROJECT_NAME );
+ }
+
+ public static String getProjectNameAndId( Map<String, Object> context )
+ {
+ StringBuilder result = new StringBuilder();
+
+ if ( getProjectName( context ) != null )
+ {
+ result.append( getProjectName( context ) ).append( " " );
+ }
+ else if ( getArtifactId( context ) != null )
+ {
+ result.append( getArtifactId( context ) ).append( " " );
+ }
+
+ if ( context.containsKey( KEY_PROJECT_ID ) )
+ {
+ result.append( "(projectId=" ).append( getProjectId( context ) ).append( ")" );
+ }
+ else
+ {
+ result.append( "(projectGroupId=" ).append( getProjectGroupId( context ) ).append( ")" );
+ }
+
+ return result.toString();
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private static String getString( Map<String, Object> context, String key )
+ {
+ Object obj = getObject( context, key, null );
+
+ if ( obj == null )
+ {
+ return null;
+ }
+ else
+ {
+ return (String) obj;
+ }
+ }
+
+ private static int getInteger( Map<String, Object> context, String key )
+ {
+ Object obj = getObject( context, key, null );
+
+ if ( obj == null )
+ {
+ return 0;
+ }
+ else
+ {
+ return (Integer) obj;
+ }
+ }
+
+ private static Object getObject( Map<String, Object> context, String key, Object defaultValue )
+ {
+ Object value = context.get( key );
+
+ if ( value == null )
+ {
+ return defaultValue;
+ }
+
+ return value;
+ }
+}
+
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/pom.xml b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/pom.xml
index ba3c09a..687100b 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/pom.xml
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-master-api</artifactId>
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
index def851a..e748027 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
@@ -1,9 +1,5 @@
package org.apache.continuum.distributed.transport.master;
-import com.atlassian.xmlrpc.ServiceObject;
-
-import java.util.Map;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +19,10 @@
* under the License.
*/
+import com.atlassian.xmlrpc.ServiceObject;
+
+import java.util.Map;
+
/**
* MasterBuildAgentTransportService
*/
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/pom.xml b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/pom.xml
index 6ed0f41..ef9ded6 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/pom.xml
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-master-client</artifactId>
@@ -33,6 +33,11 @@
<artifactId>continuum-distributed-master-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-distributed-commons</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.atlassian.xmlrpc</groupId>
<artifactId>atlassian-xmlrpc-binder</artifactId>
</dependency>
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
index b95c5c1..d733352 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
@@ -30,6 +30,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.apache.continuum.distributed.commons.utils.ContinuumDistributedUtil;
+
/**
* MasterBuildAgentTransportClient
*/
@@ -71,16 +73,17 @@
throws Exception
{
Boolean result;
+ String projectInfo = ContinuumDistributedUtil.getProjectNameAndId( buildResult );
try
{
result = master.returnBuildResult( buildResult );
- log.info( "Returning the build result." );
+ log.info( "Returning the build result for project " + projectInfo + "." );
}
catch ( Exception e )
{
- log.error( "Failed to return the build result.", e );
- throw new Exception( "Failed to return the build result", e );
+ log.error( "Failed to return the build result for project " + projectInfo + ".", e );
+ throw new Exception( "Failed to return the build result for project " + projectInfo + ".", e );
}
return result;
@@ -109,16 +112,17 @@
throws Exception
{
Boolean result;
+ String projectInfo = ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult );
try
{
result = master.prepareBuildFinished( prepareBuildResult );
- log.info( "Prepare build finished." );
+ log.info( "Prepare build finished for project " + projectInfo + "." );
}
catch ( Exception e )
{
- log.error( "Failed to finish prepare build" );
- throw new Exception( "Failed to finish prepare build", e );
+ log.error( "Failed to finish prepare build for project " + projectInfo + "." );
+ throw new Exception( "Failed to finish prepare build for project " + projectInfo + ".", e );
}
return result;
@@ -132,12 +136,12 @@
try
{
result = master.startProjectBuild( projectId );
- log.info( "Return project currently building" );
+ log.info( "Return project currently building, projectId=" + projectId );
}
catch ( Exception e )
{
- log.error( "Failed to return project currently building", e );
- throw new Exception( "Failed to return project currently building", e );
+ log.error( "Failed to return project currently building, projectId=" + projectId, e );
+ throw new Exception( "Failed to return project currently building, projectId=" + projectId, e );
}
return result;
@@ -147,16 +151,17 @@
throws Exception
{
Boolean result;
+ String projectInfo = ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult );
try
{
result = master.startPrepareBuild( prepareBuildResult );
- log.info( "Started prepare build" );
+ log.info( "Start prepare build for project " + projectInfo );
}
catch ( Exception e )
{
- log.error( "Failed to start prepare build", e );
- throw new Exception( "Failed to start prepare build", e );
+ log.error( "Failed to start prepare build for project " + projectInfo, e );
+ throw new Exception( "Failed to start prepare build for project " + projectInfo, e );
}
return result;
@@ -169,12 +174,14 @@
try
{
result = master.getEnvironments( buildDefinitionId, installationType );
- log.info( "Retrieved environments" );
+ log.info( "Retrieved environments. buildDefinitionId=" + buildDefinitionId + ", installationType=" + installationType );
}
catch ( Exception e )
{
- log.error( "Failed to retrieve environments", e );
- throw new Exception( "Failed to retrieve environments", e );
+ log.error( "Failed to retrieve environments. buildDefinitionId=" + buildDefinitionId +
+ ", installationType=" + installationType, e );
+ throw new Exception( "Failed to retrieve environments. buildDefinitionId=" +
+ buildDefinitionId + ", installationType=" + installationType, e );
}
return result;
@@ -184,16 +191,17 @@
throws Exception
{
Boolean result;
+ String projectInfo = ContinuumDistributedUtil.getProjectNameAndId( project );
try
{
result = master.updateProject( project );
- log.info( "Updating project" );
+ log.info( "Updating project " + projectInfo );
}
catch ( Exception e )
{
- log.error( "Failed to update project", e );
- throw new Exception( "Failed to update project", e );
+ log.error( "Failed to update project " + projectInfo, e );
+ throw new Exception( "Failed to update project " + projectInfo, e );
}
return result;
@@ -203,16 +211,17 @@
throws Exception
{
Boolean result;
+ String projectInfo = ContinuumDistributedUtil.getProjectNameAndId( context );
try
{
result = master.shouldBuild( context );
- log.info( "Checking if project should build" );
+ log.info( "Checking if project " + projectInfo + " should build" );
}
catch ( Exception e )
{
- log.error( "Failed to determine if project should build", e );
- throw new Exception( "Failed to determine if project should build", e );
+ log.error( "Failed to determine if project " + projectInfo + " should build", e );
+ throw new Exception( "Failed to determine if project " + projectInfo + " should build", e );
}
return result;
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/pom.xml b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/pom.xml
index 8c127d2..0c871ec 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/pom.xml
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-master-server</artifactId>
@@ -38,6 +38,11 @@
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-distributed-commons</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.continuum</groupId>
<artifactId>continuum-api</artifactId>
<exclusions>
<exclusion>
diff --git a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
index 3fc7a09..e1dde30 100644
--- a/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
+++ b/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
@@ -21,7 +21,8 @@
import java.util.Map;
-import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
+import org.apache.continuum.builder.distributed.DistributedBuildService;
+import org.apache.continuum.distributed.commons.utils.ContinuumDistributedUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,18 +34,18 @@
{
private static final Logger log = LoggerFactory.getLogger( MasterBuildAgentTransportServer.class );
- private final DistributedBuildManager distributedBuildManager;
+ private final DistributedBuildService distributedBuildService;
- public MasterBuildAgentTransportServer( DistributedBuildManager distributedBuildManager )
+ public MasterBuildAgentTransportServer( DistributedBuildService distributedBuildService )
{
- this.distributedBuildManager = distributedBuildManager;
+ this.distributedBuildService = distributedBuildService;
}
public Boolean returnBuildResult( Map<String, Object> buildResult )
throws Exception
{
- log.info( "Build result returned." );
- distributedBuildManager.updateBuildResult( buildResult );
+ log.info( "Build result returned for project " + ContinuumDistributedUtil.getProjectNameAndId( buildResult ) + "." );
+ distributedBuildService.updateBuildResult( buildResult );
return Boolean.TRUE;
}
@@ -59,46 +60,46 @@
public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult )
throws Exception
{
- log.info( "Prepare build finished." );
- distributedBuildManager.prepareBuildFinished( prepareBuildResult );
+ log.info( "Prepare build finished for project " + ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ) + "." );
+ distributedBuildService.prepareBuildFinished( prepareBuildResult );
return Boolean.TRUE;
}
public Boolean startProjectBuild( Integer projectId )
throws Exception
{
- log.info( "Start project build." );
- distributedBuildManager.startProjectBuild( projectId );
+ log.info( "Start project '" + projectId + "' build." );
+ distributedBuildService.startProjectBuild( projectId );
return Boolean.TRUE;
}
public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult )
throws Exception
{
- log.info( "Start prepare build." );
- distributedBuildManager.startPrepareBuild( prepareBuildResult );
+ log.info( "Start prepare build of project " + ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ) + "." );
+ distributedBuildService.startPrepareBuild( prepareBuildResult );
return Boolean.TRUE;
}
public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
throws Exception
{
- log.info( "Retrieving environments" );
- return distributedBuildManager.getEnvironments( buildDefinitionId, installationType );
+ log.info( "Retrieving environments. buildDefinitionId=" + buildDefinitionId + ", installationType=" + installationType );
+ return distributedBuildService.getEnvironments( buildDefinitionId, installationType );
}
public Boolean updateProject( Map<String, Object> project )
throws Exception
{
- log.info( "Start updating project" );
- distributedBuildManager.updateProject( project );
+ log.info( "Start updating project " + ContinuumDistributedUtil.getProjectNameAndId( project ) );
+ distributedBuildService.updateProject( project );
return Boolean.TRUE;
}
public Boolean shouldBuild( Map<String, Object> context )
throws Exception
{
- log.info( "Checking if project should build" );
- return distributedBuildManager.shouldBuild( context );
+ log.info( "Checking if project " + ContinuumDistributedUtil.getProjectNameAndId( context ) + " should build" );
+ return distributedBuildService.shouldBuild( context );
}
}
diff --git a/continuum-distributed/continuum-distributed-master/pom.xml b/continuum-distributed/continuum-distributed-master/pom.xml
index 7cea261..83242e0 100644
--- a/continuum-distributed/continuum-distributed-master/pom.xml
+++ b/continuum-distributed/continuum-distributed-master/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-distributed</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-master</artifactId>
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/pom.xml b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/pom.xml
index 78cc89a..1a6d65f 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/pom.xml
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-slave-api</artifactId>
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
index ee5d3b6..9f1c045 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
@@ -1,10 +1,5 @@
package org.apache.continuum.distributed.transport.slave;
-import com.atlassian.xmlrpc.ServiceObject;
-
-import java.util.List;
-import java.util.Map;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,6 +19,11 @@
* under the License.
*/
+import com.atlassian.xmlrpc.ServiceObject;
+
+import java.util.List;
+import java.util.Map;
+
/**
* SlaveBuildAgentTransportService
*/
@@ -33,10 +33,10 @@
public Boolean buildProjects( List<Map<String, Object>> projectsBuildContext )
throws Exception;
- public Map getBuildResult( int projectId )
+ public Map<String, Object> getBuildResult( int projectId )
throws Exception;
- public Integer getProjectCurrentlyBuilding()
+ public Map<String, Object> getProjectCurrentlyBuilding()
throws Exception;
public List<Map<String, String>> getAvailableInstallations()
@@ -61,7 +61,7 @@
throws Exception;
public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
- Map environments )
+ Map environments, String username )
throws Exception;
public Map<String, Object> getReleaseResult( String releaseId )
@@ -77,12 +77,12 @@
throws Exception;
public Boolean releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
- Map repository )
+ Map repository, String username )
throws Exception;
public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map environments )
+ String scmTagBase, Map environments, String username )
throws Exception;
public String releaseCleanup( String releaseId )
@@ -90,4 +90,46 @@
public Boolean releaseRollback( String releaseId, int projectId )
throws Exception;
+
+ public Integer getBuildSizeOfAgent()
+ throws Exception;
+
+ public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws Exception;
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws Exception;
+
+ public List<Map<String, Object>> getProjectsInBuildQueue()
+ throws Exception;
+
+ public Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws Exception;
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws Exception;
+
+ public Boolean isProjectGroupInQueue( int projectGroupId )
+ throws Exception;
+
+ public Boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+ throws Exception;
+
+ public Boolean isProjectCurrentlyBuilding( int projectId )
+ throws Exception;
+
+ public Boolean isProjectInBuildQueue( int projectId )
+ throws Exception;
+
+ public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws Exception;
+
+ public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws Exception;
+
+ public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws Exception;
+
+ public Boolean removeFromBuildQueue( List<String> hashCodes )
+ throws Exception;
}
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/pom.xml b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/pom.xml
index 2b344f5..cb3a6ce 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/pom.xml
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-slave-client</artifactId>
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
index dd17d8f..2d01edb 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
@@ -106,34 +106,34 @@
return installations;
}
- public Map getBuildResult( int projectId )
+ public Map<String, Object> getBuildResult( int projectId )
throws Exception
{
- Map buildResult;
+ Map<String, Object> buildResult;
try
{
buildResult = slave.getBuildResult( projectId );
- log.info( "Build result for project " + projectId + " acquired." );
+ log.info( "Build result for project '" + projectId + "' acquired." );
}
catch ( Exception e )
{
- log.error( "Failed to get build result for project " + projectId, e );
- throw new Exception( "Failed to get build result for project " + projectId, e );
+ log.error( "Failed to get build result for project '" + projectId + "'", e );
+ throw new Exception( "Failed to get build result for project '" + projectId + "'", e );
}
return buildResult;
}
- public Integer getProjectCurrentlyBuilding()
+ public Map<String, Object> getProjectCurrentlyBuilding()
throws Exception
{
- Integer projectId;
+ Map map;
try
{
- projectId = slave.getProjectCurrentlyBuilding();
- log.info( "Currently building project " + projectId );
+ map = slave.getProjectCurrentlyBuilding();
+ log.info( "Retrieving currently building project" );
}
catch ( Exception e )
{
@@ -141,7 +141,7 @@
throw new Exception( "Failed to get the currently building project", e );
}
- return projectId;
+ return map;
}
public Boolean ping()
@@ -190,12 +190,12 @@
try
{
result = slave.generateWorkingCopyContent( projectId, directory, baseUrl, imagesBaseUrl );
- log.info( "Generated working copy content" );
+ log.info( "Generated working copy content for project '" + projectId + "'" );
}
catch ( Exception e )
{
- log.error( "Error generating working copy content", e );
- throw new Exception( "Error generating working copy content", e );
+ log.error( "Error generating working copy content for project '" + projectId + "'", e );
+ throw new Exception( "Error generating working copy content for project '" + projectId + "'", e );
}
return result;
@@ -209,12 +209,12 @@
try
{
result = slave.getProjectFileContent( projectId, directory, filename );
- log.info( "Retrived project file content" );
+ log.info( "Retrieved project '" + projectId + "' file content" );
}
catch ( Exception e )
{
- log.error( "Error retrieving project file content", e );
- throw new Exception( "Error retrieving project file content", e );
+ log.error( "Error retrieving project '" + projectId + "' file content", e );
+ throw new Exception( "Error retrieving project '" + projectId + "' file content", e );
}
return result;
@@ -228,12 +228,12 @@
try
{
result = slave.getReleasePluginParameters( projectId, pomFilename );
- log.info( "Retrieving release plugin parameters" );
+ log.info( "Retrieving release plugin parameters for project '" + projectId + "'" );
}
catch ( Exception e )
{
- log.error( "Error retrieving release plugin parameters", e );
- throw new Exception( "Error retrieving release plugin parameters", e );
+ log.error( "Error retrieving release plugin parameters for project '" + projectId + "'", e );
+ throw new Exception( "Error retrieving release plugin parameters for project '" + projectId + "'", e );
}
return result;
@@ -247,27 +247,27 @@
try
{
result = slave.processProject( projectId, pomFilename, autoVersionSubmodules );
- log.info( "Processing project" );
+ log.info( "Processing project '" + projectId + "'" );
}
catch ( Exception e )
{
- log.error( "Error processing project", e );
- throw new Exception( "Error processing project", e );
+ log.error( "Error processing project '" + projectId + "'", e );
+ throw new Exception( "Error processing project '" + projectId + "'", e );
}
return result;
}
public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
- Map environments )
+ Map environments, String username )
throws Exception
{
String releaseId;
try
{
- releaseId = slave.releasePrepare( project, properties, releaseVersion, developmentVersion, environments );
- log.info( "Preparing release" );
+ releaseId = slave.releasePrepare( project, properties, releaseVersion, developmentVersion, environments, username );
+ log.info( "Preparing release '" + releaseId + "'" );
}
catch ( Exception e )
{
@@ -286,12 +286,12 @@
try
{
result = slave.getReleaseResult( releaseId );
- log.info( "Retrieving release result for " + releaseId );
+ log.info( "Retrieving release result, releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error retrieving release result for " + releaseId, e );
- throw new Exception( "Error retrieving release result for " + releaseId, e );
+ log.error( "Error retrieving release result, releaseId=" + releaseId, e );
+ throw new Exception( "Error retrieving release result, releaseId=" + releaseId, e );
}
return result;
@@ -305,12 +305,12 @@
try
{
result = slave.getListener( releaseId );
- log.info( "Retrieving listener for " + releaseId );
+ log.info( "Retrieving listener for releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error retrieving listener for " + releaseId, e );
- throw new Exception( "Error retrieving listener for " + releaseId, e );
+ log.error( "Error retrieving listener for releaseId=" + releaseId, e );
+ throw new Exception( "Error retrieving listener for releaseId=" + releaseId, e );
}
return result;
@@ -325,12 +325,12 @@
{
slave.removeListener( releaseId );
result = Boolean.FALSE;
- log.info( "Removing listener for " + releaseId );
+ log.info( "Removing listener for releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error removing listener for " + releaseId, e );
- throw new Exception( "Error removing listener for " + releaseId, e );
+ log.error( "Error removing listener for releaseId=" + releaseId, e );
+ throw new Exception( "Error removing listener for releaseId=" + releaseId, e );
}
return result;
@@ -344,33 +344,33 @@
try
{
result = slave.getPreparedReleaseName( releaseId );
- log.info( "Retrieving prepared release name for " + releaseId );
+ log.info( "Retrieving prepared release name, releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error while retrieving prepared release name for " + releaseId );
- throw new Exception( "Error while retrieving prepared release name for " + releaseId );
+ log.error( "Error while retrieving prepared release name, releaseId=" + releaseId );
+ throw new Exception( "Error while retrieving prepared release name, releaseId=" + releaseId );
}
return result;
}
public Boolean releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
- Map repository )
+ Map repository, String username )
throws Exception
{
Boolean result;
try
{
- slave.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+ slave.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
result = Boolean.FALSE;
- log.info( "Performing release" );
+ log.info( "Performing release of releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error performing release", e );
- throw new Exception( "Error performing release", e );
+ log.error( "Error performing release of releaseId=" + releaseId, e );
+ throw new Exception( "Error performing release of releaseId=" + releaseId, e );
}
return result;
@@ -378,7 +378,7 @@
public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map environments )
+ String scmTagBase, Map environments, String username )
throws Exception
{
String result;
@@ -386,13 +386,13 @@
try
{
result = slave.releasePerformFromScm( goals, arguments, useReleaseProfile, repository, scmUrl, scmUsername,
- scmPassword, scmTag, scmTagBase, environments );
- log.info( "Performing release" );
+ scmPassword, scmTag, scmTagBase, environments, username );
+ log.info( "Performing release of scmUrl=" + scmUrl );
}
catch ( Exception e )
{
- log.error( "Error performing release from scm", e );
- throw new Exception( "Error performing release from scm", e );
+ log.error( "Error performing release from scm '" + scmUrl + "'", e );
+ throw new Exception( "Error performing release from scm '" + scmUrl + "'", e );
}
return result;
@@ -406,12 +406,12 @@
try
{
result = slave.releaseCleanup( releaseId );
- log.info( "Cleanup release of " + releaseId );
+ log.info( "Cleanup release, releaseId=" + releaseId );
}
catch ( Exception e )
{
- log.error( "Error cleaning up release of " + releaseId, e );
- throw new Exception( "Error cleaning up release of " + releaseId, e );
+ log.error( "Error cleaning up release, releaseId=" + releaseId, e );
+ throw new Exception( "Error cleaning up release, releaseId=" + releaseId, e );
}
return result;
@@ -426,12 +426,281 @@
{
slave.releaseRollback( releaseId, projectId );
result = Boolean.TRUE;
- log.info( "Rollback release " + releaseId );
+ log.info( "Rollback release. releaseId=" + releaseId + ", projectId=" + projectId );
}
catch ( Exception e )
{
- log.error( "Failed to rollback release " + releaseId );
- throw new Exception( "Failed to rollback release " + releaseId );
+ log.error( "Failed to rollback release. releaseId=" + releaseId + ", projectId=" + projectId );
+ throw new Exception( "Failed to rollback release. releaseId=" + releaseId + ", projectId=" + projectId );
+ }
+
+ return result;
+ }
+
+ public Integer getBuildSizeOfAgent()
+ throws Exception
+ {
+ Integer size;
+
+ try
+ {
+ size = slave.getBuildSizeOfAgent();
+ log.info( "Retrieving build size of agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve build size of agent", e );
+ throw new Exception( "Failed to retrieve build size of agent", e );
+ }
+
+ return size;
+ }
+
+ public Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws Exception
+ {
+ Map<String, Object> projects;
+
+ try
+ {
+ projects = slave.getProjectCurrentlyPreparingBuild();
+ log.info( "Retrieving projects currently preparing build" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve projects currently preparing build", e );
+ throw new Exception( "Failed to retrieve projects currently preparing build", e );
+ }
+
+ return projects;
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws Exception
+ {
+ List<Map<String, Object>> projects;
+
+ try
+ {
+ projects = slave.getProjectsAndBuildDefinitionsCurrentlyPreparingBuild();
+ log.info( "Retrieving projects currently preparing build" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve projects currently preparing build", e );
+ throw new Exception( "Failed to retrieve projects currently preparing build", e );
+ }
+
+ return projects;
+ }
+
+ public List<Map<String, Object>> getProjectsInBuildQueue()
+ throws Exception
+ {
+ List<Map<String, Object>> projects;
+
+ try
+ {
+ projects = slave.getProjectsInBuildQueue();
+ log.info( "Retrieving projects in build queue" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve projects in build queue", e );
+ throw new Exception( "Failed to retrieve projects in build queue", e );
+ }
+
+ return projects;
+ }
+
+ public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws Exception
+ {
+ List<Map<String, Object>> projects;
+
+ try
+ {
+ projects = slave.getProjectsInPrepareBuildQueue();
+ log.info( "Retrieving projects in prepare build queue" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve projects in prepare build queue", e );
+ throw new Exception( "Failed to retrieve projects in prepare build queue", e );
+ }
+
+ return projects;
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws Exception
+ {
+ List<Map<String, Object>> projects;
+
+ try
+ {
+ projects = slave.getProjectsAndBuildDefinitionsInPrepareBuildQueue();
+ log.info( "Retrieving projects in prepare build queue" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to retrieve projects in prepare build queue", e );
+ throw new Exception( "Failed to retrieve projects in prepare build queue", e );
+ }
+
+ return projects;
+ }
+
+ public Boolean isProjectGroupInQueue( int projectGroupId )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.isProjectGroupInQueue( projectGroupId );
+ log.info( "Checking if project group '" + projectGroupId + "' is in queue" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to check if project group '" + projectGroupId + "' is in queue", e );
+ throw new Exception( "Failed to check if project group '" + projectGroupId + "' is in queue", e );
+ }
+
+ return result;
+ }
+
+ public Boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.isProjectScmRootInQueue( projectScmRootId, projectIds );
+ log.info( "Checking if project scm root '" + projectScmRootId + "' is in queue" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to check if project scm root '" + projectScmRootId + "' is in queue", e );
+ throw new Exception( "Failed to check if project scm root '" + projectScmRootId + "' is in queue", e );
+ }
+
+ return result;
+ }
+
+ public Boolean isProjectCurrentlyBuilding( int projectId )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.isProjectCurrentlyBuilding( projectId );
+ log.info( "Checking if project " + projectId + " is currently building in agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to check if project " + projectId + " is currently building in agent", e );
+ throw new Exception( "Failed to check if project " + projectId + " is currently building in agent", e );
+ }
+
+ return result;
+ }
+
+ public Boolean isProjectInBuildQueue( int projectId )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.isProjectInBuildQueue( projectId );
+ log.info( "Checking if project " + projectId + "is in build queue of agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to check if project " + projectId + " is in build queue of agent", e );
+ throw new Exception( "Failed to check if project " + projectId + " is in build queue of agent", e );
+ }
+
+ return result;
+ }
+
+ public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+ log.debug( "Remove projects from prepare build queue. projectGroupId=" + projectGroupId +
+ ", scmRootId=" + scmRootId );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to remove projects from prepare build queue. projectGroupId=" + projectGroupId +
+ ", scmRootId=" + scmRootId );
+ throw new Exception( "Failed to remove from prepare build queue. projectGroupId=" + projectGroupId +
+ " scmRootId=" + scmRootId, e );
+ }
+
+ return result;
+ }
+
+ public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.removeFromPrepareBuildQueue( hashCodes );
+ log.info( "Removing projects from prepare build queue of agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to remove projects from prepare build queue of agent", e );
+ throw new Exception( "Failed to remove projects from prepare build queue of agent", e );
+ }
+
+ return result;
+ }
+
+ public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.removeFromBuildQueue( projectId, buildDefinitionId );
+ log.info( "Removing project '" + projectId + "' from build queue of agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to remove project '" + projectId + "' from build queue of agent", e );
+ throw new Exception( "Failed to remove project '" + projectId + "' from build queue of agent", e );
+ }
+
+ return result;
+ }
+
+ public Boolean removeFromBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ result = slave.removeFromBuildQueue( hashCodes );
+ log.info( "Removing projects from build queue of agent" );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Failed to remove projects from build queue of agent", e );
+ throw new Exception( "Failed to remove projects from build queue of agent", e );
}
return result;
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml
index fe33045..3288910 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-slave-server</artifactId>
diff --git a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
index e385281..7a180e8 100644
--- a/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
+++ b/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
@@ -90,33 +90,31 @@
try
{
buildResult = continuumBuildAgentService.getBuildResult( projectId );
- log.info( "Build result for project " + projectId + " acquired." );
+ log.info( "Build result for project '" + projectId + "' acquired." );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to get build result for project " + projectId, e );
+ log.error( "Failed to get build result for project '" + projectId + "'", e );
throw e;
}
return buildResult;
}
- public Integer getProjectCurrentlyBuilding()
+ public Map<String, Object> getProjectCurrentlyBuilding()
throws Exception
{
- Integer projectId = continuumBuildAgentService.getProjectCurrentlyBuilding();
+ Map<String, Object> project = continuumBuildAgentService.getProjectCurrentlyBuilding();
- log.info( "Currently building project " + projectId );
+ log.info( "Retrieving currently building project" );
- return projectId;
+ return project;
}
public Boolean ping()
throws Exception
{
- log.info( "Ping ok" );
-
- return Boolean.TRUE;
+ return continuumBuildAgentService.ping();
}
public Boolean cancelBuild()
@@ -144,12 +142,12 @@
{
try
{
- return continuumBuildAgentService.generateWorkingCopyContent( projectId, directory, baseUrl,
- imagesBaseUrl );
+ log.info( "Generate working copy content for project '" + projectId + "'" );
+ return continuumBuildAgentService.generateWorkingCopyContent( projectId, directory, baseUrl, imagesBaseUrl );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to generate working copy content", e );
+ log.error( "Failed to generate working copy content for projectId=" + projectId, e );
throw e;
}
}
@@ -159,11 +157,12 @@
{
try
{
+ log.info( "Retrieve project '" + projectId + "' file content" );
return continuumBuildAgentService.getProjectFileContent( projectId, directory, filename );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to retrieve project file content", e );
+ log.error( "Failed to retrieve project '" + projectId + "' file content", e );
throw e;
}
}
@@ -173,11 +172,12 @@
{
try
{
+ log.info( "Retrieving release plugin parameters for project '" + projectId + "'" );
return continuumBuildAgentService.getReleasePluginParameters( projectId, pomFilename );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to retrieve release plugin parameters", e );
+ log.error( "Failed to retrieve release plugin parameters for project '" + projectId + "'", e );
throw e;
}
}
@@ -187,23 +187,25 @@
{
try
{
+ log.info( "Processing project '" + projectId + "'" );
return continuumBuildAgentService.processProject( projectId, pomFilename, autoVersionSubmodules );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to process project", e );
+ log.error( "Failed to process project '" + projectId + "'", e );
throw e;
}
}
public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
- Map environments )
+ Map environments, String username )
throws Exception
{
try
{
+ log.info( "Preparing release" );
return continuumBuildAgentService.releasePrepare( project, properties, releaseVersion, developmentVersion,
- environments );
+ environments, username );
}
catch ( ContinuumBuildAgentException e )
{
@@ -217,11 +219,12 @@
{
try
{
+ log.info( "Retrieving listener for releaseId=" + releaseId );
return continuumBuildAgentService.getListener( releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to retrieve listener state of " + releaseId, e );
+ log.error( "Failed to retrieve listener state of releaseId=" + releaseId, e );
throw e;
}
}
@@ -231,11 +234,12 @@
{
try
{
+ log.info( "Retrieving release result, releaseId=" + releaseId );
return continuumBuildAgentService.getReleaseResult( releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to retrieve release result of " + releaseId, e );
+ log.error( "Failed to retrieve release result of releaseId=" + releaseId, e );
throw e;
}
}
@@ -249,10 +253,11 @@
{
continuumBuildAgentService.removeListener( releaseId );
result = Boolean.TRUE;
+ log.info( "Removing listener for releaseId=" + releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to remove listener of " + releaseId, e );
+ log.error( "Failed to remove listener of releaseId=" + releaseId, e );
throw e;
}
@@ -264,29 +269,31 @@
{
try
{
+ log.info( "Retrieving prepared release name, releaseId=" + releaseId );
return continuumBuildAgentService.getPreparedReleaseName( releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to retrieve prepared release name of " + releaseId );
+ log.error( "Failed to retrieve prepared release name of releaseId=" + releaseId );
throw e;
}
}
public Boolean releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
- Map repository )
+ Map repository, String username )
throws Exception
{
Boolean result;
try
{
- continuumBuildAgentService.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+ continuumBuildAgentService.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
result = Boolean.TRUE;
+ log.info( "Perform release of releaseId=" + releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Unable to perform release", e );
+ log.error( "Unable to perform release of releaseId=" + releaseId, e );
throw e;
}
@@ -295,18 +302,19 @@
public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
String scmUrl, String scmUsername, String scmPassword, String scmTag,
- String scmTagBase, Map environments )
+ String scmTagBase, Map environments, String username )
throws Exception
{
try
{
+ log.info( "Perform release of scmUrl=" + scmUrl );
return continuumBuildAgentService.releasePerformFromScm( goals, arguments, useReleaseProfile, repository,
scmUrl, scmUsername, scmPassword, scmTag,
- scmTagBase, environments );
+ scmTagBase, environments, username );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Unable to perform release", e );
+ log.error( "Unable to perform release of scmUrl=" + scmUrl, e );
throw e;
}
}
@@ -316,11 +324,12 @@
{
try
{
+ log.info( "Cleanup release, releaseId=" + releaseId );
return continuumBuildAgentService.releaseCleanup( releaseId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Unable to cleanup release of " + releaseId, e );
+ log.error( "Unable to cleanup release, releaseId=" + releaseId, e );
throw e;
}
}
@@ -334,10 +343,198 @@
{
continuumBuildAgentService.releaseRollback( releaseId, projectId );
result = Boolean.TRUE;
+ log.info( "Rollback release. releaseId=" + releaseId + ", projectId=" + projectId );
}
catch ( ContinuumBuildAgentException e )
{
- log.error( "Failed to rollback release " + releaseId, e );
+ log.error( "Failed to rollback release. releaseId=" + releaseId + ", projectId=" + projectId, e );
+ throw e;
+ }
+
+ return result;
+ }
+
+ public Integer getBuildSizeOfAgent()
+ throws Exception
+ {
+ try
+ {
+ return continuumBuildAgentService.getBuildSizeOfAgent();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve build size of agent", e );
+ throw e;
+ }
+ }
+
+ public Map<String, Object> getProjectCurrentlyPreparingBuild()
+ throws Exception
+ {
+ try
+ {
+ return continuumBuildAgentService.getProjectCurrentlyPreparingBuild();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve projects currently preparing build", e );
+ throw e;
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+ throws Exception
+ {
+ try
+ {
+ return continuumBuildAgentService.getProjectsAndBuildDefinitionsCurrentlyPreparingBuild();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve projects currently preparing build", e );
+ throw e;
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsInBuildQueue()
+ throws Exception
+ {
+ try
+ {
+ log.info( "Retrieving projects in build queue" );
+ return continuumBuildAgentService.getProjectsInBuildQueue();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve projects in build queue", e );
+ throw e;
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+ throws Exception
+ {
+ try
+ {
+ log.info( "Retrieving projects in prepare build queue" );
+ return continuumBuildAgentService.getProjectsInPrepareBuildQueue();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve projects in prepare build queue", e );
+ throw e;
+ }
+ }
+
+ public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+ throws Exception
+ {
+ try
+ {
+ log.info( "Retrieving projects in prepare build queue" );
+ return continuumBuildAgentService.getProjectsAndBuildDefinitionsInPrepareBuildQueue();
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to retrieve projects in prepare build queue", e );
+ throw e;
+ }
+ }
+
+ public Boolean isProjectGroupInQueue( int projectGroupId )
+ throws Exception
+ {
+ log.info( "Checking if project group '" + projectGroupId + "' is in queue" );
+ return continuumBuildAgentService.isProjectGroupInQueue( projectGroupId );
+ }
+
+ public Boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+ throws Exception
+ {
+ log.info( "Checking if project scm root '" + projectScmRootId + "' is in queue" );
+ return continuumBuildAgentService.isProjectScmRootInQueue( projectScmRootId, projectIds );
+ }
+
+ public Boolean isProjectCurrentlyBuilding( int projectId )
+ throws Exception
+ {
+ log.info( "Checking if project " + projectId + " is currently building in agent" );
+ return continuumBuildAgentService.isProjectCurrentlyBuilding( projectId );
+ }
+
+ public Boolean isProjectInBuildQueue( int projectId )
+ throws Exception
+ {
+ log.info( "Checking if project " + projectId + "is in build queue of agent" );
+ return continuumBuildAgentService.isProjectInBuildQueue( projectId );
+ }
+
+ public Boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+ throws Exception
+ {
+ try
+ {
+ log.info( "Remove projects from prepare build queue. projectGroupId=" + projectGroupId +
+ ", scmRootId=" + scmRootId );
+ return continuumBuildAgentService.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to remove projects from prepare build queue. projectGroupId=" + projectGroupId +
+ ", scmRootId=" + scmRootId );
+ throw e;
+ }
+ }
+
+ public Boolean removeFromPrepareBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ continuumBuildAgentService.removeFromPrepareBuildQueue( hashCodes );
+ result = Boolean.TRUE;
+ log.info( "Remove projects from prepare build queue" );
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to remove projects from prepare build queue" );
+ throw e;
+ }
+
+ return result;
+ }
+
+ public Boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+ throws Exception
+ {
+ try
+ {
+ log.debug( "Remove project '" + projectId + "' from build queue" );
+ return continuumBuildAgentService.removeFromBuildQueue( projectId, buildDefinitionId );
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to remove project '" + projectId + "' from build queue" );
+ throw e;
+ }
+ }
+
+ public Boolean removeFromBuildQueue( List<String> hashCodes )
+ throws Exception
+ {
+ Boolean result;
+
+ try
+ {
+ continuumBuildAgentService.removeFromBuildQueue( hashCodes );
+ result = Boolean.TRUE;
+ log.info( "Remove projects from build queue" );
+ }
+ catch ( ContinuumBuildAgentException e )
+ {
+ log.error( "Failed to remove projects from build queue" );
throw e;
}
diff --git a/continuum-distributed/continuum-distributed-slave/pom.xml b/continuum-distributed/continuum-distributed-slave/pom.xml
index ab677c7..ebcad8c 100644
--- a/continuum-distributed/continuum-distributed-slave/pom.xml
+++ b/continuum-distributed/continuum-distributed-slave/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>continuum-distributed</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed-slave</artifactId>
diff --git a/continuum-distributed/pom.xml b/continuum-distributed/pom.xml
index b5d0b8b..f18bd9a 100644
--- a/continuum-distributed/pom.xml
+++ b/continuum-distributed/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-distributed</artifactId>
@@ -30,6 +30,7 @@
<modules>
<module>continuum-distributed-master</module>
<module>continuum-distributed-slave</module>
+ <module>continuum-distributed-commons</module>
<!-- <module>continuum-distributed-tests</module> -->
</modules>
</project>
diff --git a/continuum-docs/pom.xml b/continuum-docs/pom.xml
index 65b958c..530f194 100644
--- a/continuum-docs/pom.xml
+++ b/continuum-docs/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-docs</artifactId>
<name>Continuum :: Documentation</name>
@@ -31,7 +31,7 @@
<distributionManagement>
<site>
<id>apache</id>
- <url>scpexe://people.apache.org/www/continuum.apache.org/docs/${project.version}</url>
+ <url>scp://people.apache.org/www/continuum.apache.org/docs/${project.version}</url>
</site>
</distributionManagement>
<build>
@@ -44,6 +44,21 @@
<template>continuum-site.vm</template>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-pdf-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>site-pdf</id>
+ <phase>site</phase>
+ <goals>
+ <goal>pdf</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<reporting>
@@ -73,28 +88,4 @@
</plugin>
</plugins>
</reporting>
- <profiles>
- <profile>
- <id>pdf</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-pdf-plugin</artifactId>
- <executions>
- <execution>
- <id>site-pdf</id>
- <phase>site</phase>
- <goals>
- <goal>pdf</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/continuum-docs/src/site/apt/administrator_guides/appearance.apt b/continuum-docs/src/site/apt/administrator_guides/appearance.apt
index 67d6c8b..ba41dc9 100755
--- a/continuum-docs/src/site/apt/administrator_guides/appearance.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/appearance.apt
@@ -3,18 +3,18 @@
------
Olivier Lamy
------
- Nov 13 2007
+ 2010-02-22
------
-
+
Configure Appearance
-
+
~~%{toc|section=0}
-
+
* {Banner}
You can configure the right logo of the banner including title and link on the image.
- You have to add some information in a pom (like a company pom) (coming from org.apache:apache in this example) :
-
+ You have to add some information in a POM (like a company POM) (coming from org.apache:apache in this example):
+
+----------------------------+
<organization>
<name>The Apache Software Foundation</name>
@@ -23,31 +23,31 @@
<properties>
<organization.logo>http://www.apache.org/images/asf_logo_wide.gif</organization.logo>
</properties>
-+----------------------------+
++----------------------------+
- From the menu, choose the 'Appearance' entry :
-
+ From the menu, choose the <<Appearance>> entry :
+
[../images/configure-appearance.png] Appearance
- Use the 'Select a Company POM' link :
-
-[../images/select-company-pom.png] 'Select a Company POM'
+ Use the <<Select a Company POM>> link :
- The result will be displayed (using org.apache:apache in this example) :
-
-[../images/selected-company-pom.png] 'Selected a Company POM'
+[../images/select-company-pom.png] 'Select a Company POM'
- Note : the pom is searched in central repository and the repositories available for the active profiles from your <<<${user.home}/.m2/settings.xml>>>
-
+ The result will be displayed (using org.apache:apache in this example):
+
+[../images/selected-company-pom.png] 'Selected a Company POM'
+
+ <<Note:>> the POM is searched for in the central repository and in the repositories available for the active profiles from your <<<${user.home}/.m2/settings.xml>>>.
+
* {Footer}
-
- You can configure the footer by putting your own html content in the 'Appearance' entry of the menu.
-
+
+ You can configure the footer by putting your own html content in the <<Appearance>> entry of the menu.
+
[../images/configuration-footer.png] 'Configure footer'
The default value is :
-
+
+----------------------------+
-<div class="xright">Copyright © 2005-${currentYear} The Apache Software Foundation</div> <div class="clear"><hr/></div>
-+----------------------------+
-
+<div class="xright">Copyright © 2005-${currentYear} The Apache Software Foundation</div> <div class="clear"><hr/></div>
++----------------------------+
+
diff --git a/continuum-docs/src/site/apt/administrator_guides/audit-logs.apt b/continuum-docs/src/site/apt/administrator_guides/audit-logs.apt
new file mode 100644
index 0000000..9b37024
--- /dev/null
+++ b/continuum-docs/src/site/apt/administrator_guides/audit-logs.apt
@@ -0,0 +1,46 @@
+ ------
+ Audit Logs
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ 23 Jul 2009
+ ------
+
+Audit Logs
+
+ Continuum's <<<logs>>> directory contains an audit log file named <<<continuum-audit.log>>>,
+ which tracks events that occur in the server.
+ For security measure, passwords are masked behind asterisks.
+
+ A typical record looks like this:
+
+----
+2009-07-22 12:27:58 - admin - BUILD_SCHEDULE BI_HOURLY - Added Build Schedule
+2009-07-22 12:28:23 - admin - BUILD_SCHEDULE BI_HOURLY - Modified Build Schedule
+2009-07-22 12:29:56 - admin - PROJECT http://svn.apache.org/repos/asf/continuum/trunk/pom.xml - Added M2 Project
+2009-07-22 12:31:00 - admin - PROJECT Project Group id=6 - Forced Project Build
+----
+
+ The space delimited records are:
+
+ * date and time (server local time)
+
+ * user that enacted the change (or guest if none)
+
+ * the project or configurations affected
+
+ * the event that occured
+
+ Currently, the following events are logged:
+
+ * add/delete of projects
+
+ * forced project builds
+
+ * release prepare/perform/rollback
+
+ * add/edit/delete of schedules
+
+ * add/edit/delete of build definition templates
+
+ []
diff --git a/continuum-docs/src/site/apt/administrator_guides/build-agent-groups.apt b/continuum-docs/src/site/apt/administrator_guides/build-agent-groups.apt
index 130d59e..ac74626 100644
--- a/continuum-docs/src/site/apt/administrator_guides/build-agent-groups.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/build-agent-groups.apt
@@ -23,3 +23,7 @@
[../images/build-agent-groups-edit.png] Add/Edit Build Agent Group
Build Agent can be associated to one or more Build Agent Group
+
+ To use a Build Agent Group in a Project, you need to attach it to a build environment.
+
+ Refer to {{{./buildEnvironment.html}Attach Build Agent Group to a Build Environment}}
diff --git a/continuum-docs/src/site/apt/administrator_guides/build-agents.apt b/continuum-docs/src/site/apt/administrator_guides/build-agents.apt
index 133e505..dcc0d58 100644
--- a/continuum-docs/src/site/apt/administrator_guides/build-agents.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/build-agents.apt
@@ -4,11 +4,11 @@
Managing Build Agents
- Before this, you may want to enable the Distributed Builds option in the {{{configuration.html}General Configuration}}
- and {{{../installation/build-agent.html}install a Build Agent}}, or read about the {{{distributed-builds.html}Distributed
+ Before this, you may want to enable the Distributed Builds option in the {{{./configuration.html}General Configuration}}
+ and {{{../installation/build-agent.html}install a Build Agent}}, or read about the {{{./distributed-builds.html}Distributed
Builds}} feature.
- From the menu, choose the 'Build Agents' item
+ From the menu, choose the <<Build Agents>> item
[../images/build-agents-menu.png] Build Agents Menu
@@ -16,15 +16,18 @@
[../images/build-agents.png] Build Agents List
- To add a new Build Agent, click the 'Add' button
+ To add a new Build Agent, click the <<Add>> button.
+ You will be prompted to enter the Build Agent URL and Description.
- To edit an existing Build Agent, click the 'edit' link to the right of the entry.
- You will be prompted to enter or edit the Build Agent URL and Description:
+ To edit an existing Build Agent, click the <<Edit>> link to the right of the entry.
+ You will be prompted to edit the Build Agent Description.
+
+ <<Note:>> Once a Build Agent has been saved you can not change its URL.
[../images/build-agent-edit.png] Add/Edit Build Agent
- Be sure to enable the agent by checking the 'Enabled' checkbox.
+ Be sure to enable the agent by checking the <<Enabled>> checkbox.
- After you save your changes, verify that 'Enabled' is true. If it is false, most likely Continuum was unable to ping
+ After you save your changes, verify that the <<Enabled>> checkbox is checked. If it is not checked, most likely Continuum was unable to ping
the agent. Consult the log file for additional information.
diff --git a/continuum-docs/src/site/apt/administrator_guides/profiles.apt b/continuum-docs/src/site/apt/administrator_guides/buildEnvironment.apt
similarity index 85%
rename from continuum-docs/src/site/apt/administrator_guides/profiles.apt
rename to continuum-docs/src/site/apt/administrator_guides/buildEnvironment.apt
index 4c0c395..3a179e1 100755
--- a/continuum-docs/src/site/apt/administrator_guides/profiles.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/buildEnvironment.apt
@@ -15,6 +15,10 @@
The main goal is to compile/test sources against the targeted jvm, mvn/maven version, ant version and to add defined
envvar (MAVEN_OPTS, ANT_OPTS ...). This is now possible at the build definition level (in 1.1).
+ As of Continuum 1.2.1, build environments can be used in releasing projects.
+ This is set upon supplying the release prepare parameters during the
+ {{{../user_guides/release/prepare.html} Release preparation}} of the project.
+
* Setup Build Environments/Installations
** {Creating a Build Environment}
@@ -29,7 +33,7 @@
** {Attach Build Agent Group to a Build Environment}
- The list box contains all available Build Agent Groups. The list box will only be visible if Distributed Builds is enabled in the {{{configuration.html}General Configuration}} Page
+ The list box contains all available Build Agent Groups. The list box will only be visible if Distributed Builds is enabled in the {{{./configuration.html}General Configuration}} Page
[../images/profile-build-agent-group.png] Add Build Agent Group to Build Environment
@@ -58,11 +62,11 @@
[]
+-------------------------------+
- Java Home version :
+ Java Home version :
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
-
+
Builder version :
- Maven version: 2.0.5
+ Maven version: 2.0.5
+-------------------------------+
diff --git a/continuum-docs/src/site/apt/administrator_guides/buildQueue.apt b/continuum-docs/src/site/apt/administrator_guides/buildQueue.apt
new file mode 100644
index 0000000..6434932
--- /dev/null
+++ b/continuum-docs/src/site/apt/administrator_guides/buildQueue.apt
@@ -0,0 +1,36 @@
+ ------
+ Managing Build Queues
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ May 21 2009
+ ------
+
+Managing Build Queues
+
+* Adding a Build Queue
+
+ By default, there is already a DEFAULT_BUILD_QUEUE that cannot be deleted configured in Continuum. To add more build queues..
+
+ Click the <<Build Queue>> link under the <<Administration>> section.
+
+[../images/buildQueue.png] Build Queue
+
+ You will see all the build queues.
+
+[../images/listBuildQueue.png] Build Queues list
+
+ Here you can add/delete the build queue. Take note that you would only be allowed to create N number of build queues, where
+ N = the Number of Allowed Builds in Parallel set in the Configuration page.
+
+ Input the name for the build queue and save.
+
+[../images/addBuildQueue.png] Add Parallel Build Queue
+
+* Deleting a Build Queue
+
+ From the build queue page, you can delete a build queue by clicking the delete icon
+
+[../images/delete.gif] Delete icon
+
+
diff --git a/continuum-docs/src/site/apt/administrator_guides/continuum-logs.apt b/continuum-docs/src/site/apt/administrator_guides/continuum-logs.apt
new file mode 100644
index 0000000..7bad588
--- /dev/null
+++ b/continuum-docs/src/site/apt/administrator_guides/continuum-logs.apt
@@ -0,0 +1,42 @@
+ ------
+ Continuum Logs
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ 23 Jul 2009
+ ------
+
+Continuum Logs
+
+ Continuum's <<<logs>>> directory contains an continuum log file named <<<continuum.log>>>,
+ which logs all the startup information of Continuum.
+
+ A typical record looks like this:
+
+------
+2009-07-22 11:57:48,397 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - Initializing Continuum.
+2009-07-22 11:57:48,397 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - Showing all groups:
+2009-07-22 11:57:48,912 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - Showing all projects:
+2009-07-22 11:57:49,081 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - Starting Continuum.
+2009-07-22 11:57:49,082 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum -
+2009-07-22 11:57:49,082 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum -
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - < Continuum 1.3.2 started! >
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - ------------------------------------
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - \ ^__^
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - \ (oo)\_______
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - (__)\ )\/\
+2009-07-22 11:57:49,083 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - ||----w |
+2009-07-22 11:57:49,084 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum - || ||
+2009-07-22 11:57:49,084 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum -
+2009-07-22 11:57:49,084 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.DefaultContinuum -
+2009-07-22 11:57:49,084 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.initialization.DefaultContinuumInitializer -
+ Continuum initializer running ...
+2009-07-22 11:57:49,177 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.initialization.DefaultContinuumInitializer -
+ Default Project Group exists
+2009-07-22 11:57:49,177 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.initialization.DefaultContinuumInitializer -
+ Continuum initializer end running ...
+2009-07-22 11:57:49,186 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.build.settings.DefaultSchedulesActivator -
+ Activating schedules ...
+2009-07-22 11:57:49,236 [WrapperSimpleAppMain] INFO org.apache.maven.continuum.build.settings.DefaultSchedulesActivator -
+ DEFAULT_SCHEDULE: next fire time ->Wed Jul 22 12:00:00 PHT 2009
+------
diff --git a/continuum-docs/src/site/apt/administrator_guides/distributed-builds.apt b/continuum-docs/src/site/apt/administrator_guides/distributed-builds.apt
index ad90d05..d6ff463 100644
--- a/continuum-docs/src/site/apt/administrator_guides/distributed-builds.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/distributed-builds.apt
@@ -1,6 +1,9 @@
------------------
Distributed Builds
------------------
+ ------------------
+ 2010-02-22
+ ------------------
Understanding Distributed Builds
@@ -25,19 +28,17 @@
listens for any build requests from the Master it is
assigned to.
- There is a one-to-many relationship between the Master and the Slaves.
+ There is a one-to-many relationship between the Master and the Build Agents.
A Master may have many Build Agents, but each Build Agent can only have one Master.
- TODO: insert image here
+~~TODO: insert image here
* Behavior
Distributed Builds happen at the project group level of Continuum.
When the entire project group is built in the Master, independent projects
- (single project or multi-module project) are distributed to any available
- registered Slave. A Slave is said to be available when it is currently not
- building anything as it can only attend to a single build request from the
- Master.
+ (single project or multi-module project) are distributed to a single
+ registered Build Agent.
In a project group containing a mix of projects, the distribution of work
goes through the following steps:
@@ -47,20 +48,24 @@
[[2]] Every independent project within the project group is identified,
whether as a single project or a multi-module project. Projects with
inter-dependencies cannot be distributed separately, so multi-module
- projects are delegated to a Slave as one build.
+ projects are delegated to a Build Agent as one build.
[[3]] For each independent project, the Master iterates over the list of
- registered Slaves and queries each if available. The query is an XML-RPC
- <<<ping()>>> followed by an <<<isAvailable()>>> invocation.
+ registered Build Agents and queries each if available. The query is an XML-RPC
+ <<<ping()>>> followed by a <<<getBuildSizeOfAgent()>>> invocation.
- [[4]] If a Build Agent is available, the Master collects the information
- necessary for the build (SCM url, project id, etc.) and passes it when
- invoking <<<buildProjects()>>>.
+ [[4]] If there is a Build Agent available, the Master collects the information
+ necessary for the build (SCM URL, project id, etc.) and passes it when
+ invoking <<<buildProjects()>>> to the Build Agent with the smallest number of
+ tasks in its queue. The Master also passes the <<<name>>> of the local repository
+ of the project's project group. Make sure that a local repository with the same <<<name>>>
+ is configured in the Build Agent's configuration file since that is what will be
+ used when the project is built in the build agent. Otherwise, it will use the
+ local repository set in the build agent's <<<settings.xml>>> file.
[[5]] In the Build Agent, the build request is processed: the build is queued and
- executed. Upon execution, the Build Agent first performs an SCM checkout then
- the actual build follows. The SCM checkout will result in invoking a
- <<<returnScmResult()>>> callback method in the Master.
+ executed. Upon execution, the Build Agent first performs an SCM checkout or an SCM
+ update followed by an SCM changelog to get the latest update date, then the actual build follows.
[[6]] At this point, when the build is running, the Master can invoke
<<<cancelBuild()>>> which returns a transient build result, and
@@ -68,51 +73,61 @@
[[7]] After the build, the Build Agent returns the complete build result to the
Master by invoking the callback method <<<returnBuildResult()>>>, which the
- Master aggregates to provide a unified view of projects
+ Master aggregates to provide a unified view of projects.
- TODO: insert sequence diagram here
+ A <<<ping()>>> is always called before each XML-RPC invocation to check if
+ the agent is available. If it's not, the agent will be disabled.
+
+~~TODO: insert sequence diagram here
* Setup
- * {{{../installation/build-agent.html}Install and Configure}} one or more Build Agents, then
+ * {{{../installation/build-agent.html}Install and Configure}} one or more Build Agents.
- * {{{configuration.html}Enable}} the Distributed Builds option in the General Configuration, and
+ * {{{./configuration.html}Enable}} the Distributed Builds option in the General Configuration.
- * {{{build-agents.html}Add}} your Build Agents to the Continuum Master.
-
- * {{{build-agent-groups.html}Add}} your Build Agents to a Build Agent Group.
+ * {{{./build-agents.html}Add}} your Build Agents to the Continuum Master.
- * {{{profiles.html} Add}} your Build Agent Group to Build Environment.
+ * {{{./build-agent-groups.html}Add}} your Build Agents to a Build Agent Group.
- <<WARNING>> Need to have a central remote repository to store the artifacts created from the build agent so that other agents will be able to use the new artifacts.
+ * {{{./buildEnvironment.html} Add}} your Build Agent Group to a Build Environment.
+
+ * Configure a project to use that Build Environment.
+
+ * Make sure that the {{{./localRepository.html} local repository}} of the {{{./projectgroup.html} project group}} is properly configured.
+ In this case, it should point to the path of the repository where the Build Agent is installed/running.
+
+ []
+
+ <<Warning:>> You need to have a central remote repository to store the artifacts created from the Build Agent so that other agents will be able to use the new artifacts.
* Limitations
- * only system administrator can enable/disable distributed builds
+ * Only system administrator can enable/disable distributed builds
- * releases are not supported
+ * Credentials (i.e. svn credentials) are passed along if specified, but if server cache is used it will need to be done individually on the Build Agents
- * credentials (s.a. svn credentials) are passed along if specified, but if server cache is used it will need to be done individually on the slaves
+ * There is no tracking of SCM changes
- * there is no tracking of scm changes
+ * The Build Agent needs a configuration web interface
- * the Build Agent needs a configuration web interface
+ * All projects in a project group will be distributed to the same Build Agent
* Future Enhancements
* Remote builders
- * Builders can be installed on remote machines, a Continuum manager will send actions to run to builders. An action can be something to run on all builders, on some of them or eventually only to an available builder if we don't want to run more than one build. Actions can be sent with JMS and builders can apply some filters if they don't want to receive all actions. With that, we can do some parallel builds but the dependency tree must be respected for the build order. To work correctly with dependencies, each builders must use a central local repository. Maybe we can use an internal Archiva.
+ * Builders can be installed on remote machines, a Continuum manager will send actions to run to builders. An action can be something to run on all builders, on some of them or eventually only to an available builder if we don't want to run more than one build. Actions can be sent with JMS and builders can apply some filters if they don't want to receive all actions. With that, we can do some parallel builds but the dependency tree must be respected for the build order. To work correctly with dependencies, each builder must use a central local repository. Maybe we can use an internal Archiva.
- * With Continuum builders configured to receive all commands, users can run multi-platform build for each build definition execution
+ * With Continuum builders configured to receive all commands, users can run multi-platform build for each build definition execution.
- * With Continuum builders configured to receive only some project types, users can use a different builder by project group. In this case, the build of all projects will be done quickly because commands are balanced on few servers
+ * With Continuum builders configured to receive only some project types, users can use a different builder by project group. In this case, the build of all projects will be done quickly because commands are balanced on several servers.
- * With Continuum builders configured to build something when it is available, users can install few builders on several machine to balance the charge. In this case, it will be possible to run some parallel builds.
+ * With Continuum builders configured to build something when it is available, users can install builders on several machine to balance the charge. In this case, it will be possible to run some parallel builds.
- * When the builder work will be done, a message will be sent to the manager to notify the end of the process.
+ * When the builders work is done, a message will be sent to the manager to notify the end of the process.
- * With JMS used for the communication, we can add some listeners to create reports/statistics, log some informations
+ * With JMS used for the communication, we can add some listeners to create reports/statistics, log some information.
* Policy-based distribution
diff --git a/continuum-docs/src/site/apt/administrator_guides/external-db.apt b/continuum-docs/src/site/apt/administrator_guides/external-db.apt
index a12f45d..0049f2f 100644
--- a/continuum-docs/src/site/apt/administrator_guides/external-db.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/external-db.apt
@@ -29,3 +29,10 @@
** Webapp
To use an external database with the Continuum webapp, you should configure the DataSource in your container.
+
+* Shutdown Procedure
+
+ When using an external database, it is very important to stop Continuum prior to stopping or restarting the database.
+ Continuum may exhibit unpredictable behavior if the database disappears while it is running, and may not recover
+ once the database comes back up. If this happens, you must re-start Continuum. If you experience errors after
+ re-starting, the data may be corrupted and may need to be fixed by editing records directly in the database.
\ No newline at end of file
diff --git a/continuum-docs/src/site/apt/administrator_guides/index.apt b/continuum-docs/src/site/apt/administrator_guides/index.apt
index 196085f..4b666e1 100644
--- a/continuum-docs/src/site/apt/administrator_guides/index.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/index.apt
@@ -3,43 +3,49 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Administrator's Guides
- * {{{security/index.html}Managing Users and Security}}
+ * {{{./security/index.html}Managing Users and Security}}
- * {{{projectgroup.html}Adding a Project Group}}
+ * {{{./projectgroup.html}Managing Project Groups}}
- * {{{builder.html}Managing Builders}}
+ * {{{./builder.html}Managing Builders}}
- * {{{jdk.html}Managing JDKs}}
+ * {{{./jdk.html}Managing JDKs}}
- * {{{profiles.html}Managing Build Environments}}
+ * {{{./buildEnvironment.html}Managing Build Environments}}
- * {{{build-agents.html}Managing Build Agents}}
+ * {{{./build-agents.html}Managing Build Agents}}
- * {{{build-agent-groups.html}Managing Build Agent Groups}}
+ * {{{./build-agent-groups.html}Managing Build Agent Groups}}
- * {{{schedules.html}Managing Schedules}}
+ * {{{./schedules.html}Managing Schedules}}
- * {{{configuration.html}Managing General Configuration}}
+ * {{{./configuration.html}Managing General Configuration}}
- * {{{localRepository.html}Managing Local Repositories}}
+ * {{{./localRepository.html}Managing Local Repositories}}
- * {{{purgeConfiguration.html}Managing Purge Configuration}}
+ * {{{./purgeConfiguration.html}Managing Purge Configuration}}
- * {{{parallelBuilds.html}Managing Parallel Builds}}
+ * {{{./parallelBuilds.html}Managing Parallel Builds}}
- * {{{external-db.html}External Databases}}
+ * {{{./buildQueue.html}Managing Build Queues}}
- * {{{monitoring.html}Monitoring Continuum}}
+ * {{{./queues.html}Managing Project Queues}}
- * {{{appearance.html}Appearance Configuration}}
+ * {{{./external-db.html}External Databases}}
- * {{{builddefTemplate.html}Build Definition Templates}}
+ * {{{./monitoring.html}Monitoring Continuum}}
- * {{{shutdown.html}Shutting Down Continuum}}
+ * {{{./logging.html} Log Files}}
- * {{{distributed-builds.html}Understanding Distributed Builds}}
+ * {{{./appearance.html}Appearance Configuration}}
+
+ * {{{./builddefTemplate.html}Build Definition Templates}}
+
+ * {{{./shutdown.html}Shutting Down Continuum}}
+
+ * {{{./distributed-builds.html}Understanding Distributed Builds}}
diff --git a/continuum-docs/src/site/apt/administrator_guides/localRepository.apt b/continuum-docs/src/site/apt/administrator_guides/localRepository.apt
index a1ebe9c..e02fb56 100644
--- a/continuum-docs/src/site/apt/administrator_guides/localRepository.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/localRepository.apt
@@ -1,39 +1,49 @@
------
Local Repository
------
-
+ ------
+ 2010-02-18
+ ------
+
Local Repository
+ Local repositories can be configured for a specific project group's use.
+ This is where the artifacts used for building the projects can be found
+ instead of the default (<<<$USER_HOME/.m2/repository>>>).
+
Click the <<Local Repositories>> link under the <<Administration>> section
[../images/localrepositories.png] Local Repositories
You will see all the local repositories that have been created.
-
+
To display:
-
+
[../images/localrepositories-view.png]
-
- In this screen you can add/edit/delete/purge a local repository.
-
- You can purge a repository if it has a default {{{purgeConfiguration.html} Purge Configuration}}, otherwise the purge icon is disabled.
+
+ In this screen you can add/edit/delete/purge a local repository.
+
+ You can purge a repository if it has a default {{{./purgeConfiguration.html} Purge Configuration}}, otherwise the purge icon is disabled.
[../images/disabled_purgenow.gif] disabled purge icon
* Adding / Editing a Local Repository
- All fields are mandatory.
-
+ All fields are mandatory.
+
* Name: must be a unique repository name.
-
+
* Location: must be the absolute path of a unique repository location.
-
+
* Layout: "default" or "legacy". Default layout is for maven2, while legacy layout is for maven1.
[../images/localrepository-add.png]
+
+ Adding a local repository will automatically create a default {{{./purgeConfiguration.html} Purge Configuration}} for that repository.
- Adding a local repository will automatically create a default {{{purgeConfiguration.html} Purge Configuration}} for that repository.
+ If you're using distributed builds, you must configure a <<<localRepository>>> with the same <<<name>>> in the build agent's configuration file where the
+ <<<location>>> is the local path to the local repository in the build agent machine. See {{{./distributed-builds.html}Distributed Builds}} for more details.
* Default
diff --git a/continuum-docs/src/site/apt/administrator_guides/logging.apt b/continuum-docs/src/site/apt/administrator_guides/logging.apt
new file mode 100644
index 0000000..06dbde6
--- /dev/null
+++ b/continuum-docs/src/site/apt/administrator_guides/logging.apt
@@ -0,0 +1,24 @@
+ ------
+ Log Files
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ 2010-02-19
+ ------
+
+Log Files
+
+ To keep track of the Continuum performance and problems, log files are created during runtime.
+ These files can be found in the <<<logs/>>> directory.
+
+ * {{{./continuum-logs.html} <<continuum.log>>}} - contains all the start-up information for Continuum.
+
+ * {{{./audit-logs.html} <<continuum-audit.log>>}} - contains information regarding the project operations and configurations being modified.
+ For example, projects added are logged here, with date and timestamp,
+ userId of who performed the deploy, and the project that was built.
+ For security measure, passwords are masked behind asterisks.
+
+ * {{{./security-logs.html} <<continuum-security-audit.log>>}} - contains information regarding Continuum's security.
+ For example, a successful login of a user or a user account is created.
+
+ []
diff --git a/continuum-docs/src/site/apt/administrator_guides/parallelBuilds.apt b/continuum-docs/src/site/apt/administrator_guides/parallelBuilds.apt
index 7c688d6..eedde0b 100644
--- a/continuum-docs/src/site/apt/administrator_guides/parallelBuilds.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/parallelBuilds.apt
@@ -1,7 +1,10 @@
------
Parallel Build Queue
------
-
+ ------
+ 2010-02-18
+ ------
+
Managing Parallel Builds
Since 1.3.1, Continuum can be configured to checkout and build projects in parallel or concurrently.
@@ -9,51 +12,26 @@
* Configuring Parallel Builds
The number of build queues to be used when checking out or building projects can be configured in the Configuration page, via
- the Number of Allowed Builds in Parallel field (see {{{configuration.html} Managing General Configuration}}).
+ the Number of Allowed Builds in Parallel field (see {{{./configuration.html} Managing General Configuration}}).
The value should be greater than one (1) to be able to create a build queue aside from the default.
Another thing to note is that if Distributed Builds is enabled, Parallel Builds is automatically disabled. To make it
short, you're only allowed to use one of these functionalities at a time in the current implementation.
-* Adding a Build Queue
+ To configure parallel builds:
- By default, there is already a DEFAULT_BUILD_QUEUE that cannot be deleted configured in Continuum. To add more build queues..
+ [[1]] Create a build queue to be used for the projects.
+ Refer to {{{./buildQueue.html} Managing Build Queues}}
- Click the <<Build Queue>> link under the <<Administration>> section.
+ [[2]] Attach the build queue(s) to a build schedule.
+ Refer to {{{./schedules.html} Attaching Build Queue to a Schedule}}
-[../images/buildQueue.png] Build Queue
+ [[3]] Create or edit the project's build definition to use the build schedule configured with the build queue(s).
+ Refer to {{{../user_guides/managing_builddef/index.html} Managing Build Definitions}}
- You will see all the build queues.
+ []
-[../images/listBuildQueue.png] Build Queues list
-
- Here you can add/delete the build queue. Take note that you would only be allowed to create N number of build queues, where
- N = the Number of Allowed Builds in Parallel set in the Configuration page.
-
- Input the name for the build queue and save.
-
-[../images/addBuildQueue.png] Add Parallel Build Queue
-
-* Attaching Build Queues to a Schedule
-
- Build queues can be attached to a schedule. When a build is triggered, Continuum gets the build queues attached to the build
- definition's associated schedule. The project build will then be queued to the build queue with the least number of tasks.
-
- To attach build queues to a schedule:
-
- [[1]] Click the <<Schedules>> link under the <<Administration>> section. From the schedules list page, create a new schedule
- or edit an existing one.
-
- [[2]] In the Add Build Queue field, move build queues from the left hand list box to the right hand list box by clicking the appropriate
- buttons in between the two list boxes. All build queues on the right hand list box will be attached to the schedule when you click Save.
-
-[../images/editSchedule.png] Edit Schedule
-
-* Viewing Checkouts and Builds in Queues
-
- Current checkouts and builds, and all other projects queued in the checkout and build queues can be viewed in the <<Queues>> page.
- These executing and queued tasks can also be cancelled by clicking the corresponding Cancel icons for each task. Multiple-cancel is
- also supported.
+ A screen similar to the following is displayed under the <<Queues>> page when the project is built (force/sheduled).
[../images/parallelBuildsQueues.png] Queues
@@ -65,3 +43,5 @@
[[2]] Concurrent build of inter-dependent projects in a group is not yet supported.
+ [[3]] All projects in a project group will be enqueued to the same {{{./buildQueue.html} Build Queue}}.
+
diff --git a/continuum-docs/src/site/apt/administrator_guides/projectgroup.apt b/continuum-docs/src/site/apt/administrator_guides/projectgroup.apt
index 5397b94..adb3db9 100755
--- a/continuum-docs/src/site/apt/administrator_guides/projectgroup.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/projectgroup.apt
@@ -1,26 +1,71 @@
------
- Adding Project Group
+ Managing Project Groups
------
Olivier Lamy
------
- Oct 11 2007
+ 2010-02-18
------
-Adding Project Group
+Managing Project Groups
- From the home page (Group Summary) Use the the 'Add Project Group' button
-
+[../images/project-groups.png] Group Summary homepage
+
+* Adding a Project Group
+
+ From the home page (Group Summary) Use the the <<<Add Project Group>>> button
+
[../images/add-project-group.png] Add Project Group
- Then You will have the project Group detail.
-
+ Then You will have the project Group detail.
+
[../images/add-project-group-detail.png] Edit Project Group detail
Some fields are mandatory :
-
+
* Project Group Name
-
+
* Project Group Id
-
-
+ []
+
+* Editing a Project Group
+
+ From the home page (Group Summary), click the project group name link.
+
+ The project group information will then be displayed.
+
+[../images/project-group-summary.png] Project Group Summary
+
+ Then, click on the <<<Edit>>> button.
+
+[../images/update-project-group.png] Update Project Group
+
+ The following fields can be updated:
+
+ * <<Project Group Name>>: The name of the project group.
+
+ * <<Description>>: A brief description about the group.
+
+ * {{{./localRepository.html} <<Local Repository>>}}: The specific repository used for the project
+ which points to the exact location of the repository in the machine used for building.
+
+ * <<Homepage Url>>: The site of the project.
+
+ []
+
+ And, projects can be moved to another project group.
+
+* Deleting a Project Group
+
+ There are two ways to delete a project group.
+
+ From the home page (Group Summary), click the Delete icon to the right of the group you wish to delete.
+
+ From the Project Group Summary page, click the <<<Delete Group>>> button.
+
+ Confirm the deletion
+
+ Note that user roles for this project group will not be removed. This is intentional so that if you are
+ sharing a user database among several Continuum instances, users will still be able to access the same
+ group on a different server.
+
diff --git a/continuum-docs/src/site/apt/administrator_guides/queues.apt b/continuum-docs/src/site/apt/administrator_guides/queues.apt
index 72b8cca..a80a639 100644
--- a/continuum-docs/src/site/apt/administrator_guides/queues.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/queues.apt
@@ -8,19 +8,30 @@
Managing Queues
- Click the <<Queues>> link under the <<Administration>> section
+ Current checkouts and builds, and all other projects queued in the checkout, build, and prepare build queues
+ can be viewed in the <<Queues>> page.
[../images/queues.png] Queues
- To display :
+ Prepare Build Queue
-[../images/queues-view.png] Queues View
-
- You must have a <<"Manage Continuum Queues">> role for you to:
+[../images/queues-prepare.png] Prepare Build Queue
- [[1]] Cancel current checkouts, current builds, queued checkouts and queued builds by clicking the
+ Build Queues
+
+[../images/queues-view.png] Queues View
+
+ Checkout Queue
+
+[../images/queues-checkout.png] Checkout Queue
+
+ You must have a <<Manage Continuum Queues>> role for you to:
+
+ [[1]] Cancel current checkouts, current builds, queued prepare builds, queued checkouts and queued builds by clicking the
[../images/cancelbuild.gif] cancel build icon.
- [[2]] Cancel multiple queued tasks by selecting the corresponding checkboxes of the checkouts or builds you want to cancel and
- then click the <<Cancel Entries>> button.
\ No newline at end of file
+ [[2]] Cancel multiple queued tasks by selecting the corresponding checkboxes of the checkouts, builds, or project updates
+ you want to cancel and then click the <<Cancel Entries>> button.
+
+ Note: Cancelling current prepare build is not allowed to prevent data corruption.
diff --git a/continuum-docs/src/site/apt/administrator_guides/schedules.apt b/continuum-docs/src/site/apt/administrator_guides/schedules.apt
index 13d3f48..d47e8fc 100755
--- a/continuum-docs/src/site/apt/administrator_guides/schedules.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/schedules.apt
@@ -23,7 +23,7 @@
[[2]] Fill in the needed information in the <<Edit Schedules>> page shown below.
-[../images/add_schedule.png] Adding a build schedule
+[../images/editSchedule.png] Adding a build schedule
* <<Name>> The unique identifier of the schedule. This is a required field.
@@ -39,6 +39,10 @@
not atomic and a developer might be committing midway through an update. It is not typically
needed if using Subversion.
+ *<<Add Build Queue>> Move build queues from the left hand list box to the right hand list box by
+ clicking the appropriate buttons in between the two list boxes. All build queues on the right
+ hand list box will be attached to the schedule.
+
* <<Enabled>> When selected, scheduled build will be executed.
[]
@@ -56,4 +60,4 @@
* Deleting Schedules
- To delete a schedule, click the delete icon, the rightmost icon inline with the schedule to be deleted.
\ No newline at end of file
+ To delete a schedule, click the delete icon, the rightmost icon inline with the schedule to be deleted.
diff --git a/continuum-docs/src/site/apt/administrator_guides/security-logs.apt b/continuum-docs/src/site/apt/administrator_guides/security-logs.apt
new file mode 100644
index 0000000..22e9aa2
--- /dev/null
+++ b/continuum-docs/src/site/apt/administrator_guides/security-logs.apt
@@ -0,0 +1,42 @@
+ ------
+ Security Logs
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ 23 Jul 2009
+ ------
+
+Security Logs
+
+ Continuum's <<<logs>>> directory contains a security log file named <<<continuum-security-audit.log>>>,
+ which keeps track of all the security operations.
+
+ A typical record looks like this:
+
+------
+2009-07-22 12:32:00 - admin - User Created: continuum
+2009-07-22 12:32:10 - admin - Role Assigned to user continuum: Continuum Group Project Administrator
+2009-07-22 12:32:17 - admin - User Modified: continuum
+2009-07-22 12:32:34 - - Logged Out user admin
+2009-07-22 12:32:47 - - Successful Login for user continuum
+------
+
+ The hyphen delimited records are:
+
+ * date and time (server local time)
+
+ * current user performing the operation
+
+ * the operation performed
+
+ []
+
+ Currently, the following events are logged:
+
+ * user creation/modification/deletion
+
+ * user log in/out
+
+ * assigning roles to a user
+
+ []
diff --git a/continuum-docs/src/site/apt/administrator_guides/security/index.apt b/continuum-docs/src/site/apt/administrator_guides/security/index.apt
index e9df223..2311df1 100644
--- a/continuum-docs/src/site/apt/administrator_guides/security/index.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/security/index.apt
@@ -3,11 +3,11 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Managing Users and Security
- {{{customising-security.html}Security Configuration}}
+ {{{./customising-security.html}Security Configuration}}
- {{{ldap.html}LDAP Configuration}}
+ {{{./ldap.html}LDAP Configuration}}
diff --git a/continuum-docs/src/site/apt/administrator_guides/security/ldap.apt b/continuum-docs/src/site/apt/administrator_guides/security/ldap.apt
index 1cc2b6c..e81ba0e 100644
--- a/continuum-docs/src/site/apt/administrator_guides/security/ldap.apt
+++ b/continuum-docs/src/site/apt/administrator_guides/security/ldap.apt
@@ -12,28 +12,32 @@
* Shutdown Continuum
- * Open <<<apps/continuum/webapp/WEB-INF/classes/META-INF/plexus/application.xml>>> and uncomment the following xml
-
- []
-
-%{snippet|id=ldap|url=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml}
-
- All you need to configure is the ConfigurableLdapConnectionFactory and LdapUserMapper components
-
* Add a security.properties files under $CONTINUUM_HOME/conf/ with the following content:
--------------------------------------------
+security.policy.password.expiration.enabled=false
+
user.manager.impl=ldap
ldap.bind.authenticator.enabled=true
-redback.default.admin=adminuser
-security.policy.password.expiration.enabled=false
-user.manager.impl=cached
-ldap.bind.authenticator.enabled=true
+
+ldap.config.context.factory=com.sun.jndi.ldap.LdapCtxFactory
+ldap.config.hostname=[ldap_hostname]
+ldap.config.base.dn=[ldap_base_dn]
+ldap.config.port=[ldap_port]
+ldap.config.mapper.attribute.user.id=cn
+ldap.config.mapper.attribute.user.email=email
+ldap.config.mapper.attribute.fullname=givenName
+ldap.config.mapper.attribute.password=userPassword
+
+redback.default.admin=[adminuser]
+redback.default.guest=[guestuser]
--------------------------------------------
<<adminuser>> is a LDAP user and will be the default Continuum admin. <<guestuser>> is a LDAP user and will be used for the <<<guest>>> role, generally, it is an utility LDAP account.
* Restart Continuum
+
+ []
* Other resources
diff --git a/continuum-docs/src/site/apt/developer_guides/index.apt b/continuum-docs/src/site/apt/developer_guides/index.apt
index 8e9ebb1..be4b410 100644
--- a/continuum-docs/src/site/apt/developer_guides/index.apt
+++ b/continuum-docs/src/site/apt/developer_guides/index.apt
@@ -3,11 +3,11 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Developer's Guides
- * {{{building.html}Building Continuum}}
+ * {{{./building.html}Building Continuum}}
- * {{{xmlrpc.html}XML-RPC}}
+ * {{{./xmlrpc.html}XML-RPC}}
diff --git a/continuum-docs/src/site/apt/getting-started.apt b/continuum-docs/src/site/apt/getting-started.apt
index 2380b5d..7307c96 100644
--- a/continuum-docs/src/site/apt/getting-started.apt
+++ b/continuum-docs/src/site/apt/getting-started.apt
@@ -4,19 +4,19 @@
Emmanuel Venisse
Olivier Lamy
------
- Oct 5 2007
+ 2010-02-18
------
Getting Started
When you start Continuum for the first time (without an existing database), the first thing you will
- do is create the admin account and perform the {{{administrator_guides/configuration.html}General Configuration}}.
-
+ do is create the admin account and perform the {{{./administrator_guides/configuration.html}General Configuration}}.
+
[images/admin-account-creation.png] Admin account creation
- After admin account creation, you can log as the admin. The next thing you will see is the General Configuration
+ After the admin account has been created, you can log as the admin user. The next thing you will see is the <<General Configuration>>
page.
[images/configuration.png] General Configuration
- You may also create users, {{{user_guides/managing_project/addProject.html}add projects}}, etc.
\ No newline at end of file
+ You may also create more users, {{{./user_guides/managing_project/addProject.html}add projects}}, etc.
\ No newline at end of file
diff --git a/continuum-docs/src/site/apt/index.apt b/continuum-docs/src/site/apt/index.apt
index e9980dc..b449ca7 100644
--- a/continuum-docs/src/site/apt/index.apt
+++ b/continuum-docs/src/site/apt/index.apt
@@ -3,60 +3,56 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
+ ------
Welcome to Apache Continuum
Apache Continuum is an enterprise-ready continuous integration server with features such as automated builds,
- release management, role-based security, and integration with popular build tools and source control management
+ release management, role-based security and integration with popular build tools and source control management
systems. Whether you have a centralized build team or want to put control of releases in the hands of developers,
- Continuum can help you improve quality and maintain a consistent build environment.
+ Continuum can help you improve quality and maintain a consistent build environment.
-Documentation
+* Documentation
-* Installation/Upgrade Guides
+ * {{{./release-notes.html} Release Notes}}
-** {{{installation/index.html}Installation}}
+ * Installation/Upgrade Guides
-*** Standalone version
+ * {{{./installation/index.html}Installation}}
- {{{installation/standalone.html}Standard (Linux, Mac OSX, Solaris, Windows, others) as a service or not}}
+ * Standalone version:
-*** Webapp
+ {{{./installation/standalone.html}Standard (Linux, Mac OSX, Solaris, Windows, others) as a service or not}}
- {{{installation/tomcat.html}Tomcat}},
- {{{installation/jetty.html}Jetty}},
- {{{installation/jboss.html}JBoss}},
- {{{installation/geronimo.html}Geronimo}},
- {{{installation/glassfish.html}GlassFish}},
- ...
+ * Webapp:
-** Release Notes
+ {{{./installation/tomcat.html}Tomcat}}
- {{{release-notes.html} Release Notes}}
+ []
-** Upgrade
+ * {{{./installation/upgrade.html} How to upgrade from a previous version}}
- {{{installation/upgrade.html} How to upgrade from a previous version}}
+ []
-* User's Guide
+ * {{{./user_guides/index.html} User's Guide}}
- {{{user_guides/index.html} User's Guide}}
+ * {{{./administrator_guides/index.html} Administrator's Guide}}
-* Administrator's Guide
+ * {{{./developer_guides/building.html} Developer's Guide to building Continuum}}
- {{{administrator_guides/index.html} Administrator's Guide}}
+ * Knowledge Base
-* Developer's Guide
+ {{{http://continuum.apache.org/faqs.html}Frequently Asked Questions}}
- {{{developer_guides/building.html}Guide to building Continuum}}
+ {{{http://cwiki.apache.org/confluence/display/CONTINUUM}Wiki}}
-* Knowledge Base
+ {{{http://docs.codehaus.org/display/CONTINUUMUSER/Home}Old Wiki}}
- {{{http://continuum.apache.org/faqs.html}Frequently Asked Questions}}
+ {{{http://apache-continuum.blogspot.com/}Blog}}
- {{{http://cwiki.apache.org/confluence/display/CONTINUUM}Wiki}}
+ []
- {{{http://docs.codehaus.org/display/CONTINUUMUSER/Home}Old Wiki}}
+ This documentation is also available in {{{./apache-continuum.pdf}PDF}} format.
- {{{http://apache-continuum.blogspot.com/}Blog}}
+
diff --git a/continuum-docs/src/site/apt/installation/build-agent.apt b/continuum-docs/src/site/apt/installation/build-agent.apt
index 6c42260..7dba741 100644
--- a/continuum-docs/src/site/apt/installation/build-agent.apt
+++ b/continuum-docs/src/site/apt/installation/build-agent.apt
@@ -1,82 +1,113 @@
-
-
+ ------
+ Installing and Configuring a Build Agent
+ ------
+ ------
+ 2010-02-22
+ ------
Installing and Configuring a Build Agent
First, {{{http://continuum.apache.org/download.html}download}} the Continuum Build Agent standalone
distribution or webapp.
+ <<Note>>: It is recommended to use Build Agents that come with the release of Continuum (Continuum Master) to be used.
+ While 1.3.x Build Agents can be used with 1.4.x Continuum (Continuum Master), using a later version of Build Agent than the
+ Continuum (Continuum Master) will not work.
+
* Standalone
The Build Agent is available as a separate standalone Jetty-bundled
webapp. Installing it is as simple as extracting it to a preferred
- directory.
+ directory.
The Build Agent runs on a specific port (defaulting to 8181), so it is possible
to install multiple Build Agents in one machine. It is also possible to
- install Slaves in the same machine as the Master. To configure the Build Agent
- to run using a different port, edit the
+ install Build Agents in the same machine as the Master. To configure the Build Agent
+ to run using a different port, edit the
<<<$CONTINUUM_BUILDAGENT_HOME/conf/jetty.xml>>> file.
Another configuration file to look at is the
<<<$CONTINUUM_BUILDAGENT_HOME/conf/continuum-buildagent.xml>>>. This file must
- be manually edited, as there is no web interface for configuration.
+ be manually edited, as there is no web interface for this configuration.
+--------------+
<continuum-buildagent-configuration>
-<buildOutputDirectory>/path/to/build/agent/data/build-output-directory</buildOutputDirectory>
- <workingDirectory>/path/to/build/agent/data/working-directory</workingDirectory>
- <continuumServerUrl>http://builds.example.com:8080/continuum/master-xmlrpc</continuumServerUrl>
- <installations>
- <installation>
- <name>Maven 2 Home</name>
- <type>maven2</type>
- <varValue>/Applications/apache-maven-2.0.9</varValue>
- </installation>
- </installations>
+ <buildOutputDirectory>/path/to/build/agent/data/build-output-directory</buildOutputDirectory>
+ <workingDirectory>/path/to/build/agent/data/working-directory</workingDirectory>
+ <continuumServerUrl>http://builds.example.com:8080/continuum/master-xmlrpc</continuumServerUrl>
+ <installations>
+ <installation>
+ <name>Maven 2 Home</name>
+ <type>maven2</type>
+ <varValue>/Applications/apache-maven-2.0.9</varValue>
+ </installation>
+ </installations>
+ <localRepositories>
+ <localRepository>
+ <name>default</name>
+ <location>/home/user/.m2/repository</location>
+ <layout>default</layout>
+ </localRepository>
+ </localRepositories>
</continuum-buildagent-configuration>
+----------------+
-
+
A minimal configuration will have the following fields:
* <<<buildOutputDirectory>>> - similar to the build output directory of Continuum
* <<<workingDirectory>>> - similar to the working directory of Continuum
- * <<<continuumServerUrl>>> - the url pointing to the XML-RPC context of the Master Build Agent
+ * <<<continuumServerUrl>>> - the URL pointing to the XML-RPC context of the Continuum Master
- * <<<installations>>> - a list of the installations available on the build agent, including Maven, Ant, JDK, etc.
-
- Note that all of your agents need to be identical, as there is no way to control which agent Continuum chooses.
- In addition, if you are using the Continuum Release functionality, the master needs to match the agents, as releases
- will be executed on the master.
+ * <<<installations>>> - a list of the installations available on the Build Agent, including Maven, Ant, JDK, etc.
+
+ * <<<localRepositories>>> - a list of the local repositories that will be used by the build agent when building and releasing projects.
+ The local repository <<<name>>> must match that of the local repository configured in the Continuum Master. This configuration is
+ only available in Continuum 1.4.0+ to fix {{{http://jira.codehaus.org/browse/CONTINUUM-2391}CONTINUUM-2391}}.
+
+ Note that all of your agents need not be identical, as there is a way to control which agent Continuum chooses by using a
+ {{{../administrator_guides/build-agent-groups.html}Build Agent Group}}. In addition, you need to {{{../administrator_guides/buildEnvironment.html} configure}}
+ the Build Environment from the Master in order to specify which installation to use for the build.
Now start the Build Agent by executing the startup script available in
<<<$CONTINUUM_BUILDAGENT_HOME/bin/>>>. For example:
- <<<continuum-buildagent start>>> (or <<<continuum-buildagent console>>> on Windows).
++---+
+continuum-buildagent start
++---+
- Next, enable the Distributed Builds option in the {{{../administrator_guides/configuration.html}General Configuration}},
- and {{{../administrator_guides/build-agents.html}add the agent}} to the Continuum master server.
+ or if you are on Windows
- TODO: Does the Jetty bundle still want CONTINUUM_BUILDAGENT_HOME set?
++---+
+continuum-buildagent.bat console
++---+
+
+ Next, enable the <<Distributed Builds>> option in the {{{../administrator_guides/configuration.html}General Configuration}},
+ and {{{../administrator_guides/build-agents.html}add the agent}} to the Continuum Master server.
+
+~~ TODO: Does the Jetty bundle still want CONTINUUM_BUILDAGENT_HOME set?
* Webapp
- The build agent is also available as a web application which you can install into your own container.
+ The Build Agent is also available as a web application which you can install into your own container.
- The build agent needs two things in order to function properly: A CONTINUUM_BUILDAGENT_HOME environment variable,
- and a continuum-buildagent.xml configuration file in $CONTINUUM_BUILDAGENT_HOME/conf.
+ The Build Agent needs two things in order to function properly: A <<<CONTINUUM_BUILDAGENT_HOME>>> environment variable,
+ and a <<<continuum-buildagent.xml>>> configuration file in <<<$CONTINUUM_BUILDAGENT_HOME/conf>>>.
First, set the environment variable:
- export CONTINUUM_BUILDAGENT_HOME=/path/to/build/agent/home
++---+
+export CONTINUUM_BUILDAGENT_HOME=/path/to/build/agent/home
++---+
or
- set CONTINUUM_BUILDAGENT_HOME=c:\path\to\build\agent\home
++---+
+set CONTINUUM_BUILDAGENT_HOME=c:\path\to\build\agent\home
++---+
- Next, create the continuum-buildagent.xml file as shown above, and save it in $CONTINUUM_BUILDAGENT_HOME/conf.
+ Next, create the <<<continuum-buildagent.xml>>> file as shown above, and save it in <<<$CONTINUUM_BUILDAGENT_HOME/conf>>>.
You will need to create these directories.
Finally, drop the webapp into your container, and start it.
diff --git a/continuum-docs/src/site/apt/installation/geronimo.apt b/continuum-docs/src/site/apt/installation/geronimo.apt
deleted file mode 100644
index f585c2c..0000000
--- a/continuum-docs/src/site/apt/installation/geronimo.apt
+++ /dev/null
@@ -1,95 +0,0 @@
- ------
- Guide to Install Continuum on Geronimo
- ------
- Emmanuel Venisse
- ------
- Oct 25 2007
- ------
-
-Guide to Install Continuum on Geronimo
-
- Instructions for installing, deploying, configuring Continuum for Apache Geronimo.
-
- Sections:
-
-~~%{toc|section=0}
-
-* {Datasource Configuration}
-
- Continuum uses two datasources (<<<jdbc/continuum>>> and <<<jdbc/users>>>). You can create one or two databases for them.
-
- Here, we create only one database '<<<continuum>>>' used by both datasources.
- Look at {{{http://cwiki.apache.org/GMOxDOC20/configuring-database-pools.html}Configuring database pools}} in Geronimo User's Guide.
-
-* {Deployment Plan}
-
- When your datasource is created, before you install Continuum, you must create a <<Geronimo Deployment Plan>> like this one (Geronimo 2.0.2):
-
------------------------------
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app
- xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
- <environment>
- <moduleId>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum</artifactId>
- <version>1.2</version>
- </moduleId>
- <dependencies>
- <dependency>
- <groupId>console.dbpool</groupId>
- <artifactId>continuum</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>javamail</artifactId>
- <version>2.0.2</version>
- <type>car</type>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- <type>jar</type>
- </dependency>
- </dependencies>
-
- <hidden-classes>
- <filter>org.apache.commons.lang.</filter>
- <filter>org.jaxen.</filter>
- </hidden-classes>
- </environment>
-
- <context-root>/continuum</context-root>
-
- <resource-ref>
- <ref-name>jdbc/continuum</ref-name>
- <resource-link>continuum</resource-link>
- </resource-ref>
- <resource-ref>
- <ref-name>jdbc/users</ref-name>
- <resource-link>continuum</resource-link>
- </resource-ref>
- <resource-ref>
- <ref-name>mail/Session</ref-name>
- <resource-link>mail/MailSession</resource-link>
- </resource-ref>
-</web-app>
------------------------------
-
- The '<<<continuum>>>' string used in <<<console.dbpool>>> and <<<\<resource-link\>>>> is the name of the datasource created in the previous part.
-
- <<<commons-lang 2.2>>> is required by Continuum and must be installed in the geronimo repository.
-
- <<<org.jaxen.>>> needs to be added as a <<<\<filter\>>>> in the <<<\<hidden-classes\>>>> section because of {{{https://issues.apache.org/jira/browse/GERONIMO-3894}GERONIMO-3894}}
-
-* {Install Continuum}
-
- To Install Continuum, you'll need the Continuum war and the deployment plan.
-
- Look at {{{http://cwiki.apache.org/GMOxDOC20/installing-and-removing-applications.html}Installing and removing applications}} in Geronimo.
-
-* {Continuum Configuration}
-
- By default, the '<<<working directory>>>' and the '<<<build output directory>>>' are stored under the WEB-INF directory. If you want to change them (necessary on Windows
- due to the path length limitation), you can configure them in the {{{../administrator_guides/configuration.html}Configuration page}}.
diff --git a/continuum-docs/src/site/apt/installation/glassfish.apt b/continuum-docs/src/site/apt/installation/glassfish.apt
deleted file mode 100644
index abf5e42..0000000
--- a/continuum-docs/src/site/apt/installation/glassfish.apt
+++ /dev/null
@@ -1,35 +0,0 @@
- ------
- Guide to Install Continuum on GlassFish
- ------
- Emmanuel Venisse
- ------
- Oct 26 2007
- ------
-
-Guide to Install Continuum on GlassFish V2
-
-
- Instructions for installing, deploying, configuring Continuum for GlassFish.
-
- Sections:
-
-~~%{toc|section=0}
-
-* {Datasource Configuration}
-
- * Create a connection pool named '<<continuum>>' for your database
-
- * Create a JDBC resource named '<<jdbc/continuum>>' linked to the '<<continuum>>' connection pool
-
- * Create a JDBC resource named '<<jdbc/users>>' linked to the '<<continuum>>' connection pool
-
-* {Install Continuum}
-
- To Install Continuum, you'll need the Continuum war.
-
- Look at {{{https://glassfish.dev.java.net/downloads/quickstart/index.html#ProcedureTo_Deploy_From_the_Admin}Procedure To Deploy From the Admin Console}} in GlassFish.
-
-* {Continuum Configuration}
-
- By default, the '<<<working directory>>>' and the '<<<build output directory>>>' are stored under the WEB-INF directory. If you want to change them (necessary on Windows
- due to the path length limitation), you can configure them in the {{{../administrator_guides/configuration.html}Configuration page}}.
diff --git a/continuum-docs/src/site/apt/installation/index.apt b/continuum-docs/src/site/apt/installation/index.apt
index bfd34b3..dd84cb8 100644
--- a/continuum-docs/src/site/apt/installation/index.apt
+++ b/continuum-docs/src/site/apt/installation/index.apt
@@ -3,19 +3,19 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Installation/Upgrade Guides
- In this section, you'll find informations about Continuum installations:
+ In this section, you'll find information about Continuum installations:
- * {{{requirements.html}System Requirements}}
+ * {{{./requirements.html}System Requirements}}
- * {{{installation.html}Installation in different environment (standalone, webapp, service)}}
+ * {{{./installation.html}Installation in different environments (standalone, webapp, service)}}
* {{{../release-notes.html}Release Notes}}
- * {{{upgrade.html}How to upgrade from a previous version?}}
+ * {{{./upgrade.html}How to upgrade from a previous version?}}
- * {{{build-agent.html}Installation of Build Agent for Distributed Builds}}
\ No newline at end of file
+ * {{{./build-agent.html}Installation of Build Agent for Distributed Builds}}
\ No newline at end of file
diff --git a/continuum-docs/src/site/apt/installation/installation.apt b/continuum-docs/src/site/apt/installation/installation.apt
index 8eab288..a1e9a36 100644
--- a/continuum-docs/src/site/apt/installation/installation.apt
+++ b/continuum-docs/src/site/apt/installation/installation.apt
@@ -3,21 +3,13 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Continuum Installation
- In this section, you'll find all information about Continuum installation:
+ In this section, you'll find information about Continuum installations:
- * {{{standalone.html}Standalone}}
+ * {{{./standalone.html}Standalone}}
- * {{{tomcat.html}Tomcat}}
-
- * {{{jboss.html}JBoss}}
-
- * {{{jetty.html}Jetty}}
-
- * {{{geronimo.html}Geronimo}}
-
- * {{{glassfish.html}GlassFish}}
+ * {{{./tomcat.html}Tomcat}}
diff --git a/continuum-docs/src/site/apt/installation/jboss.apt b/continuum-docs/src/site/apt/installation/jboss.apt
deleted file mode 100644
index cd58662..0000000
--- a/continuum-docs/src/site/apt/installation/jboss.apt
+++ /dev/null
@@ -1,100 +0,0 @@
- ------
- Guide to Install Continuum on JBoss
- ------
- Emmanuel Venisse
- ------
- Nov 12 2007
- ------
-
-Guide to Install Continuum on JBoss
-
- Instructions for installing, deploying, configuring Continuum in JBoss. Tested with JBoss 4.2.2.GA and 4.0.5.GA.
-
- Sections:
-
-~~%{toc|section=0}
-
-* {DataSource Configuration}
-
- * Copy {{{http://repo1.maven.org/maven2/org/apache/derby/derby/10.1.3.1/derby-10.1.3.1.jar}derby-10.1.3.1.jar}} into <<<$JBOSS_HOME/server/default/lib/>>>
-
- * Create a JDBC deployment configuration file named <<<derby-continuum-ds.xml>>> in <<<$JBOSS_HOME/server/default/deploy>>> with the following contents:
-
-+--------------------------------+
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
- <!-- Datasources are not available outside the virtual machine -->
- <jndi-name>continuum</jndi-name>
- <!-- for in-process persistent db, saved when jboss stops. The
- org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
- <connection-url>jdbc:derby:../database/continuum;create=true</connection-url>
- <!-- The driver class -->
- <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
- <!-- The login and password -->
- <user-name>sa</user-name>
- <password></password>
- <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
- <min-pool-size>5</min-pool-size>
- <!-- The maximum connections in a pool/sub-pool -->
- <max-pool-size>20</max-pool-size>
- <!-- The time before an unused connection is destroyed -->
- <idle-timeout-minutes>5</idle-timeout-minutes>
- <!-- Whether to check all statements are closed when the connection is returned to the pool,
- this is a debugging feature that should be turned off in production -->
- <track-statements/>
- </local-tx-datasource>
-</datasources>
-+--------------------------------+
-
- * Create a JDBC deployment configuration file named <<<derby-users-ds.xml>>> in <<<$JBOSS_HOME/server/default/deploy>>> with the following contents:
-
-+--------------------------------+
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
- <!-- Datasources are not available outside the virtual machine -->
- <jndi-name>users</jndi-name>
- <!-- for in-process persistent db, saved when jboss stops. The
- org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
- <connection-url>jdbc:derby:../database/users;create=true</connection-url>
- <!-- The driver class -->
- <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
- <!-- The login and password -->
- <user-name>sa</user-name>
- <password></password>
- <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
- <min-pool-size>5</min-pool-size>
- <!-- The maximum connections in a pool/sub-pool -->
- <max-pool-size>20</max-pool-size>
- <!-- The time before an unused connection is destroyed -->
- <idle-timeout-minutes>5</idle-timeout-minutes>
- <!-- Whether to check all statements are closed when the connection is returned to the pool,
- this is a debugging feature that should be turned off in production -->
- <track-statements/>
- </local-tx-datasource>
-</datasources>
-+--------------------------------+
-
- With <<<../database>>> used for the derby db path, databases will be created into <<<$JBOSS_HOME>>>
-
-* {Mail Configuration}
-
- Edit <<<$JBOSS_HOME/server/default/deploy/mail-service.xml>>>
-
-* {Install Continuum}
-
- To Install Continuum, you'll need the Continuum war.
-
- Extract the Continuum war into <<<$JBOSS_HOME/server/default/deploy/continuum.war>>>
-
-* {Continuum Configuration}
-
- By default, the '<<<working directory>>>' and the '<<<build output directory>>>' are stored under the WEB-INF directory. If you want to change them (necessary on Windows
- due to the path length limitation), you can configure them in the {{{../administrator_guides/configuration.html}Configuration page}}.
-
- By default, Continuum logs are stored into <<<${appserver.base}/logs/>>>. appserver.base is a system property. If you don't define it in the JBoss startup script, it will be empty,
- so the Continuum logs directory will be at the root of your disk. If you want to use another location, you should modify
- <<<$JBOSS_HOME/server/default/deploy/continuum.war/WEB-INF/classes/log4j.xml>>>
diff --git a/continuum-docs/src/site/apt/installation/jetty.apt b/continuum-docs/src/site/apt/installation/jetty.apt
deleted file mode 100644
index 5e85a5b..0000000
--- a/continuum-docs/src/site/apt/installation/jetty.apt
+++ /dev/null
@@ -1,114 +0,0 @@
- ------
- Guide to Install Continuum on Jetty
- ------
- Emmanuel Venisse
- ------
- Nov 12 2007
- ------
-
-Guide to Install Continuum on Jetty
-
- Instructions for installing, deploying, configuring Continuum for Jetty. Tested with Jetty 6.1.5.
-
- Sections:
-
-~~%{toc|section=0}
-
-* {Datasource Configuration}
-
- * Create a JDBC resource named '<<jdbc/continuum>>'
-
- * Create a JDBC resource named '<<jdbc/users>>'
-
- For derby you can copy the following configuration in your <<<$JETTY_HOME/etc/jetty.xml>>>
-
- For other databases see {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp/src/jetty-env-postgres.xml}PostgreSQL}}
- and {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp/src/jetty-env-mysql.xml}MySQL}}
-
-+-------------------------------------+
- <!-- =========================================================== -->
- <!-- Continuum datasources -->
- <!-- =========================================================== -->
- <New id="continuum" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>jdbc/continuum</Arg>
- <Arg>
- <New class="org.apache.derby.jdbc.EmbeddedDataSource">
- <Set name="DatabaseName">your_directory/continuum_database</Set>
- <Set name="user">sa</Set>
- <Set name="createDatabase">create</Set>
- </New>
- </Arg>
- </New>
- <New id="continuum_shutdown" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>jdbc/continuum_shutdown</Arg>
- <Arg>
- <New class="org.apache.derby.jdbc.EmbeddedDataSource">
- <Set name="DatabaseName">your_directory/continuum_database</Set>
- <Set name="user">sa</Set>
- <Set name="shutdownDatabase">shutdown</Set>
- </New>
- </Arg>
- </New>
- <New id="users" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>jdbc/users</Arg>
- <Arg>
- <New class="org.apache.derby.jdbc.EmbeddedDataSource">
- <Set name="DatabaseName">your_directory/users_database</Set>
- <Set name="user">sa</Set>
- <Set name="createDatabase">create</Set>
- </New>
- </Arg>
- </New>
- <New id="users_shutdown" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>jdbc/users_shutdown</Arg>
- <Arg>
- <New class="org.apache.derby.jdbc.EmbeddedDataSource">
- <Set name="DatabaseName">your_directory/users_database</Set>
- <Set name="user">sa</Set>
- <Set name="shutdownDatabase">shutdown</Set>
- </New>
- </Arg>
- </New>
-+-------------------------------------+
-
-* {Mail Configuration}
-
- The following xml can be used for the jetty mail configuration:
-
-+-------------------------------------+
- <!-- =========================================================== -->
- <!-- Mail configuration -->
- <!-- =========================================================== -->
- <New id="validation_mail" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>mail/Session</Arg>
- <Arg>
- <New class="org.mortbay.naming.factories.MailSessionReference">
- <Set name="user"></Set>
- <Set name="password"></Set>
- <Set name="properties">
- <New class="java.util.Properties">
- <Put name="mail.smtp.host">localhost</Put>
- <Put name="mail.from">continuum@localhost</Put>
- <Put name="mail.senderName">Continuum</Put>
- <Put name="mail.debug">true</Put>
- </New>
- </Set>
- </New>
- </Arg>
- </New>
-+-------------------------------------+
-
-* {Install Continuum}
-
- To Install Continuum, you'll need the Continuum war.
-
- Copy or extract the Continuum war into $JETTY_HOME/webapps-plus/
-
-* {Start Jetty}
-
- To start Jetty, you'll need to use $JETTY_HOME/etc/jetty.xml <<and>> $JETTY_HOME/etc/jetty-plus.xml due to the datasources and mail configuration.
-
-* {Continuum Configuration}
-
- By default, the '<<<working directory>>>' and the '<<<build output directory>>>' are stored under the WEB-INF directory. If you want to change them (necessary on Windows
- due to the path length limitation), you can configure them in the {{{../administrator_guides/configuration.html}Configuration page}}.
diff --git a/continuum-docs/src/site/apt/installation/requirements.apt b/continuum-docs/src/site/apt/installation/requirements.apt
index c6aa894..7740c92 100644
--- a/continuum-docs/src/site/apt/installation/requirements.apt
+++ b/continuum-docs/src/site/apt/installation/requirements.apt
@@ -13,7 +13,7 @@
*----------------------+--------------------------------------------------------------------------------------------------------------------------------+
| <<Memory>> | No minimum requirement |
*----------------------+--------------------------------------------------------------------------------------------------------------------------------+
-| <<Disk>> | The Continuum application package is less than 30MB but will use more disk space when it's checking out and building sources |
+| <<Disk>> | The Continuum application package is less than 30MB but will use more disk space when it's checking out and building sources |
*----------------------+--------------------------------------------------------------------------------------------------------------------------------+
| <<Operating System>> | No minimum requirement. Tested on Windows XP, Debian, Fedora Core, Solaris and Mac OS X |
*----------------------+--------------------------------------------------------------------------------------------------------------------------------+
diff --git a/continuum-docs/src/site/apt/installation/standalone.apt b/continuum-docs/src/site/apt/installation/standalone.apt
index c9ba0dc..93e7f00 100644
--- a/continuum-docs/src/site/apt/installation/standalone.apt
+++ b/continuum-docs/src/site/apt/installation/standalone.apt
@@ -3,7 +3,7 @@
------
Emmanuel Venisse
------
- 2008-09-01
+ 2010-02-19
------
Installing Continuum Standalone
@@ -15,14 +15,14 @@
* Download the standalone version from the {{{http://continuum.apache.org/download.html} Download page}}
* Extract the file
-
- * Set a JAVA_HOME environment variable which use a jdk >= 1.5
+
+ * Set a <<<JAVA_HOME>>> environment variable which use a jdk >= 1.5
** {Defining JNDI Resources}
*** {Mail server configuration}
- Before to start Continuum, you must configure your SMTP configuration for mail notification. The configuration to do is in <<<$CONTINUUM_HOME/conf/jetty.xml>>>:
+ Before you start Continuum, you must configure your SMTP configuration for mail notification. The configuration is in <<<$CONTINUUM_HOME/conf/jetty.xml>>>:
%{snippet|id=mail|url=http://svn.apache.org/repos/asf/continuum/trunk/continuum-jetty/src/main/conf/jetty.xml}
@@ -41,40 +41,40 @@
continuum.bat install
------------------
- * Edit the <<<'Apache Continuum'>>> service
+ * Edit the <<Apache Continuum>> service
- * To see the services that are on your computer go to Start|Run and enter <<<'services.msc'>>>.
+ * To see the services that are on your computer go to Start|Run and enter <<<services.msc>>>.
- * Select the <<<'Startup Type'>>>
+ * Select the <<Startup Type>>
- * Go to the <<<'Log On'>>> tab and select a real user. A real user is required because you'll need a home directory for maven repository and some other things
+ * Go to the <<Log On>> tab and select a real user. A real user is required because you'll need a home directory for Maven repository and some other things
* Validate your changes
* {Installing as a Linux Service}
- Since the Continuum linux script bin/linux/run.sh understands the same arguments as linux boot scripts, there is no need to write a particular
- startup script to add Continuum to the linux boot process. All you need to do, as root, is:
-
+ Since the Continuum Linux script <<<bin/continuum>>> understands the same arguments as Linux boot scripts, there is no need to write a particular
+ startup script to add Continuum to the Linux boot process. All you need to do, as root, is:
+
** {Basic script in /etc/init.d}
- * Create a <<<'continuum'>>> file under <<</etc/init.d/>>> with the following content (replacing <<<continuum_user>>> with the name of an account you have already created):
+ * Create a <<<continuum>>> file under <<</etc/init.d/>>> with the following content. Replace <<<continuum_user>>> with the name of an account you have already created.
------------------
#!/bin/sh
-CONTINUUM_HOME=/opt/continuum-1.2
+CONTINUUM_HOME=/opt/continuum-1.3
su - continuum_user -c "$CONTINUUM_HOME/bin/continuum console $@ &"
------------------
-** {In a Debian-based system}
+** {On a Debian-based system}
------------------
-ln -s /usr/local/continuum-[VERSION]/bin/linux/run.sh /etc/init.d/continuum
+ln -s /usr/local/continuum-[VERSION]/bin/continuum /etc/init.d/continuum
------------------
- At this point you have Continuum ready to be symlinked from different runlevels. This might sound a bit esoteric, but it is not, you will find these words
- very fast as soon as you start reading about the init process. Fortunately, Debian GNU/Linux comes with a very handy utility to create this links, just run as root:
+ At this point you have Continuum ready to be symlinked from different runlevels. This might sound a bit esoteric, but it is not. You will find these words
+ very fast as soon as you start reading about the init process. Fortunately, Debian GNU/Linux comes with a very handy utility to create these links, just run as root:
------------------
update-rc.d -n continuum defaults 80
@@ -93,20 +93,20 @@
/etc/rc5.d/S80continuum -> ../init.d/continuum
------------------
- What you see is the symlinks that would be created. The above command didn't do anything because of the -n switch, remove it to get the real links created.
+ What you see is the symlinks that would be created. The above command didn't actually create anything because of the -n switch. Remove that switch and run the command again to have the real links created.
-** {In a RedHat-based system}
+** {On a RedHat-based system}
- Configuring Continuum in a RedHat-based system (like Fedora Core) is slightly different: Instead of running update-rc.d, you need to add a new
- service using chkconfig. And in order to add Continuum to chkconfig, it is necessary to add some comments to the /etc/rc.d/init.d/continuum script
- and run a couple of commands; these tasks are automatically executed by running the chkconfig_install.sh script (note that _continuum_user_ needs to be
- replaced by the name of an account you have already created):
+ Configuring Continuum on a RedHat-based system (like Fedora Core) is slightly different. Instead of running <<<update-rc.d>>>, you need to add a new
+ service using the <<<chkconfig>>> command. In order to add Continuum using <<<chkconfig>>>, it is necessary to add some comments to the <<</etc/rc.d/init.d/continuum>>> script
+ and run a couple of commands. These tasks are executed by running the <<<chkconfig_install.sh>>> script below. Note that <<<_continuum_user_>>> needs to be
+ replaced by the name of an account you have already created.
------------------
#! /bin/sh
#
-# chkconfig_install.sh - install Continuum on a chkconfig-bases system
-#
+# chkconfig_install.sh - install Continuum on a chkconfig-based system
+#
# Author: Felipe Leme <felipeal at apache.org>
#
@@ -123,7 +123,7 @@
exit 1
fi
-echo "Creating file ${INITD_SCRIPT}"
+echo "Creating file ${INITD_SCRIPT}"
cat >> ${INITD_SCRIPT} <<EOF
#! /bin/sh
# chkconfig: 345 90 10
@@ -140,19 +140,19 @@
fi
# run Continuum as root
cd ${CONTINUUM_HOME}
-./run.sh \$*
+./bin/continuum \$*
# run Continuum as user _continuum_user_
-#su - _continuum_user_ -c "cd ${CONTINUUM_HOME}; ./run.sh \$*"
+#su - _continuum_user_ -c "cd ${CONTINUUM_HOME}; ./bin/continuum \$*"
EOF
chmod +x ${INITD_SCRIPT}
-echo "Adding Continuum to chkconfig"
+echo "Adding Continuum to chkconfig"
chkconfig --add continuum
-echo "Enabling Continuum on chkconfig"
+echo "Enabling Continuum on chkconfig"
chkconfig continuum on
echo "Continuum set to start on run levels 3, 4 and 5."
-echo "To start continuum now, run 'service continuum start'"
+echo "To start Continuum now, run 'service continuum start'"
------------------
diff --git a/continuum-docs/src/site/apt/installation/tomcat.apt b/continuum-docs/src/site/apt/installation/tomcat.apt
index 475add9..4bfba87 100644
--- a/continuum-docs/src/site/apt/installation/tomcat.apt
+++ b/continuum-docs/src/site/apt/installation/tomcat.apt
@@ -4,7 +4,7 @@
Joakim Erdfelt
Emmanuel Venisse
------
- 2008-09-01
+ 2010-02-18
------
Guide to Install Continuum on Tomcat
@@ -19,7 +19,7 @@
With every Tomcat version you will need a few things before you can deploy Continuum.
- [[1]] Use at least Java JDK 1.5.0_11 to run Tomcat w/Continuum.
+ [[1]] Use at least Java JDK 1.5.0_11 to run Tomcat with Continuum.
[[1]] A defined \<Context\> xml section to define the JNDI resources.
@@ -54,7 +54,7 @@
The individual techniques for describing these resources, and the parameters associated with them are specific to the Tomcat version, resource type, and even JDBC implementation type.
For the purposes of this document, the following assumptions are made.
-
+
[[1]] You are an Apache Tomcat administrator.
[[1]] You have an SMTP Server on localhost, port 25, with no login / password.
@@ -67,14 +67,14 @@
<<Note:>> Continuum requires JavaMail 1.4 (or later)
- Apache Tomcat does not typically ship with a copy of the JavaMail or Activation jar files.
- In your role as the Apache Tomcat administrator of your installation, you will need to obtain these jar files and place it into your preferred lib directory.
+ Apache Tomcat does not typically ship with a copy of the JavaMail or Activation JAR files.
+ In your role as the Apache Tomcat administrator of your installation, you will need to obtain these JAR files and place it into your preferred <<<lib>>> directory.
The appropriate lib directory to choose is a personal preference, and we do not encourage or enforce a specific location for it, as all installations of Apache Tomcat are different.
For the record, we personally put them in the <<<$CATALINA_HOME/common/lib/>>> directory.
- Direct download links for these jar files.
+ Direct download links for these JAR files.
* JavaMail 1.4 - {{{http://repo1.maven.org/maven2/javax/mail/mail/1.4/mail-1.4.jar}mail-1.4.jar}}
@@ -84,13 +84,15 @@
<<Note:>>Continuum 1.2 has been tested with Apache Derby 10.1.3.1
+~~TODO What version of Derby should be used with Continuum 1.3?
+
The default installation of Continuum uses the Apache Derby 100% Java database to maintain Continuum-specific information, and also the Users / Security Database.
- You will need to obtain the derby.jar and derbytools.jar and place them into your preferred lib directory.
+ You will need to obtain the <<<derby.jar>>> and <<<derbytools.jar>>> and place them into your preferred lib directory.
We put them into the <<<$CATALINA_HOME/common/lib/>>> directory.
- Direct download links for these jar files:
+ Direct download links for these JAR files:
* {{{http://repo1.maven.org/maven2/org/apache/derby/derby/10.1.3.1/derby-10.1.3.1.jar}derby-10.1.3.1.jar}}
@@ -104,7 +106,7 @@
The format typically expected is <<<\-Dappserver.base=\<SOMEWHERE\>>>>
- You can utilize the <<<$CATALINA_HOME/bin/setenv.sh>>> script to set this value in a tomcat specific way.
+ You can utilize the <<<$CATALINA_HOME/bin/setenv.sh>>> script to set this value in a Tomcat specific way.
------------------------------------------
#!/bin/bash
@@ -115,10 +117,12 @@
* {Tomcat 5.0.x Specifics}
- Tested on Tomcat v5.0.28
+ Tested on Tomcat v5.0.28.
These instructions explain how to deploy the Continuum 1.2 web application in an existing installation of Tomcat 5.0.x.
+~~TODO What about for Continuum 1.3?
+
<<Extra Jars:>>
* You will need the {{{http://repo1.maven.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar}xalan-2.7.0.jar}} copied into your <<<$CATALINA_HOME/common/lib/>>> directory.
@@ -191,9 +195,9 @@
* {Tomcat 5.5.x Specifics}
- Tested on Tomcat v5.5.17 and v5.5.25
+ Tested on Tomcat v5.5.17 and v5.5.25.
- This example \<Context\> assumes technique #2 in the {{{#Defining_JNDI_Resources}Define JNDI Resource}} list. (This example lists out the <<<docBase>>> to the war file itself.)
+ This example \<Context\> assumes technique #2 in the {{{Defining_JNDI_Resources}Define JNDI Resource}} list. (This example lists out the <<<docBase>>> to the WAR file itself.)
------------------------------------------
<Context path="/continuum"
@@ -222,12 +226,12 @@
</Context>
------------------------------------------
- <<Warning:>> The Tomcat 5.5.20 and 5.5.23 releases are missing MailSessionFactory and a few other classes.
+ <<Warning:>> The Tomcat 5.5.20 and 5.5.23 releases are missing MailSessionFactory and a few other classes.
JNDI mail sessions will <<not>> work. Use Tomcat 5.5.17 or see the workaround on {{{http://issues.apache.org/bugzilla/show_bug.cgi?id=40668}Bug 40668}}.
* {Tomcat 6.0.x Specifics}
- Tested on Tomcat v6.0.14
+ Tested on Tomcat v6.0.14.
------------------------------------------
<Context path="/continuum"
diff --git a/continuum-docs/src/site/apt/installation/upgrade.apt b/continuum-docs/src/site/apt/installation/upgrade.apt
index 4869ded..f1ac7b3 100644
--- a/continuum-docs/src/site/apt/installation/upgrade.apt
+++ b/continuum-docs/src/site/apt/installation/upgrade.apt
@@ -12,9 +12,23 @@
This document will help you upgrade Continuum from 1.2.x to 1.3.3 and above.
When upgrading Continuum, it could have some database model changes. Usually these changes will be migrated for you, but in some cases
- you may need to use a backup from the previous version and to restore the data into the new version. The Data Management tool exports data from the
+ you may need to use a backup from the previous version and restore that data into the new version. The Data Management tool exports data from the
old database model and imports the data into the new database model.
+ If you had used the <<<APP_BASE>>> environment variable in Continuum 1.2 to differentiate your configuration from the
+ installation, you should rename it to <<<CONTINUUM_BASE>>> in Continuum 1.3.
+
+* Changes to Take Note of in Continuum 1.3.x
+
+ The Jetty version in Continuum 1.3.4 and above has been upgraded to 6.1.19. When upgrading to Continuum 1.3.4 or higher, there is a need to update
+ the library contents listed in <<<$CONTINUUM_BASE/conf/wrapper.conf>>> with the ones included in the new distribution especially if the
+ <<<$CONTINUUM_BASE>>> directory is separate from the installation.
+
+ In Continuum 1.3.6, configuration for local repositories in build agents were added. This is used to match the local repository in the build
+ agent to that of the local repository (used by the project to be built) set in the master. So if you are upgrading from a lower version,
+ you might need to add the <<<localRepositories>>> configuration in your build agent's configuration file. For more details,
+ read {{{./build-agent.html}Installing and Configuring a Build Agent}}.
+
* Using Backup and Restore to upgrade
There are 2 databases that need to be considered: one for the builds and one for the users.
@@ -24,7 +38,7 @@
The builds database has had model changes, and will need to be exported and imported.
- First, download the Data Management tools you will need. The tool is a standalone jar that you can download from the central repo.
+ First, download the Data Management tools you will need. The tool is a standalone JAR that you can download from the central repo.
You will need to download two versions of the tool, one for the export out of the old version and one for the import into the new version:
@@ -59,11 +73,13 @@
* Execute this command to import the builds data from the xml file you created earlier:
+------------------------------------------+
-java -Xmx512m -jar data-management-cli-1.3.2-app.jar -buildsJdbcUrl jdbc:derby:${new.continuum.home}/data/databases/continuum -mode IMPORT -directory backups
+java -Xmx512m -jar data-management-cli-1.3.2-app.jar -buildsJdbcUrl jdbc:derby:${new.continuum.home}/data/databases/continuum -mode IMPORT -directory backups -strict
+------------------------------------------+
-
+
+ <<Note:>> Remove <<<-strict>>> when importing data from 1.3.1 to 1.3.x to ignore unrecognized tags due to model changes.
+
[]
-
+
Finally, be aware that sometimes the NEXT_VAL values in the SEQUENCE_TABLE need to be adjusted.
* Before starting Continuum for the first time after the import, connect to the db with a client like {{{http://squirrel-sql.sourceforge.net/}Squirrel SQL}} and check the values in the <<NEXT_VAL>> column of the SEQUENCE_TABLE.
@@ -90,4 +106,4 @@
[]
Now you can start your new version of Continuum.
-
+
diff --git a/continuum-docs/src/site/apt/user_guides/building_project/build_results.apt b/continuum-docs/src/site/apt/user_guides/building_project/build_results.apt
index 644600b..a168cff 100644
--- a/continuum-docs/src/site/apt/user_guides/building_project/build_results.apt
+++ b/continuum-docs/src/site/apt/user_guides/building_project/build_results.apt
@@ -10,32 +10,37 @@
[../../images/build_result-2.png] Builds tab
To view the result of the build:
-
+
[[1]] Click the link for the project group of the project you want to view - the link will be
under the <<Name>> column.
-
+
[[2]] Click the build number link under the <<Build>> column of the project you want to view.
Or you can click the project link again and click the <<Builds>> link at the top of the page, then click
- the <<Result>> link, next to the State column.
-
+ the <<Result>> link, next to the <<State>> column.
+
[]
-
+
When builds are executed frequently, deleting unnecessary and failed build results is needed.
To delete build results, follow these steps:
[[1]] Click the name of the project group.
-
+
[[2]] Click on the build number under the <<Build>> column. You will be directed to the build result
page as shown below.
+ \
+
[../../images/build_result-1.png] Build Results page
+ The <<Triggered by>> field displays the username of the person who forced the build.
+ However, this field is empty when the build is triggered by a schedule.
+
Or you can click on the name of the project that you want to delete build results from.
- * Click the <<Builds>> tab. Build results list will be displayed.
-
+ * Click the <<Builds>> tab. The build results list will be displayed.
+
* Check the box of the build results that you want to delete.
-
+
[]
-
- [[3]] Click the <<Delete>> button.
\ No newline at end of file
+
+ [[3]] Click the <<Delete>> button.
diff --git a/continuum-docs/src/site/apt/user_guides/building_project/forced_build.apt b/continuum-docs/src/site/apt/user_guides/building_project/forced_build.apt
index 2627e71..c952cf2 100644
--- a/continuum-docs/src/site/apt/user_guides/building_project/forced_build.apt
+++ b/continuum-docs/src/site/apt/user_guides/building_project/forced_build.apt
@@ -2,38 +2,50 @@
Force Project Build
------
------
- Feb 23 2009
+ 2010-02-18
------
Force Project Build
Occasionally you may want to force a build outside of the regular schedule.
- The following procedure explains how to do this.
-
+ When builds are triggered manually, the following happens:
+
+ * Projects are updated from the SCM.
+ These are queued under the <<Prepare Build Queues>> section in <<Queues>> page.
+
+ * Builds of the projects are executed.
+ These are queued under the <<Build Queues>> in <<Queues>> page.
+
+ []
+
To manually build a project perform the following steps:
-
+
[[1]] Click <<Show Project Groups>>.
-
+
[[2]] Click the project group link of the project you want to build.
This will put you on the <<Summary>> page of the project group.
-
+
[[3]] You can click <<Build all projects>> button under <<Group Actions>> to build all
the projects in the project group.
-
+
[../../images/force_build.png] Project Group Actions
[[4]] To build an individual project, you can click on the build icon that is found
along the row of the project you want to build. It is the first icon on the right of
the project name. This will execute the default build goal you have defined for that project.
-
+
To build selected projects, check the box beside the name of the project,
then click the <<Build Project(s)>> button.
-
+
If you want to build the project according to a specific build goal other than the
default build goal, click on the project name to go to the <<Project's Information>> page.
All build goal definitions for the project are listed under the <<Build Definitions>> section.
Click on the build icon to the right of the specific build goal you want to execute.
-
+
[]
- To view the results of the build, refer to {{{build_results.html}Build Results Management}}.
\ No newline at end of file
+ *Note* In a distributed build setup, the project builds are not executed if no build agent is
+ configured or if a build agent group with no build agent, is configured in the build environment
+ that is attached to the project's build definition.
+
+ To view the results of the build, refer to {{{./build_results.html}Build Results Management}}.
diff --git a/continuum-docs/src/site/apt/user_guides/building_project/index.apt b/continuum-docs/src/site/apt/user_guides/building_project/index.apt
index e773e17..2fe0a70 100644
--- a/continuum-docs/src/site/apt/user_guides/building_project/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/building_project/index.apt
@@ -3,31 +3,49 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Building Projects
- For Ant and maven builds the following system properties will be added via -D command line:
-
- * continuum.project.group.name
-
- * continuum.project.lastBuild.state : last build state int flag
-
- * continuum.project.lastBuild.number
-
- * continuum.project.nextBuild.number
-
- * continuum.project.id
-
- * continuum.project.name
-
- * continuum.project.version
-
- []
-
+ For Ant and Maven builds the following system properties will be added via -D command line:
+
+ * <<<continuum.project.group.name>>>
+
+ * <<<continuum.project.lastBuild.state>>> : last build state int flag
+
+ * <<<continuum.project.lastBuild.number>>>
+
+ * <<<continuum.project.nextBuild.number>>>
+
+ * <<<continuum.project.id>>>
+
+ * <<<continuum.project.name>>>
+
+ * <<<continuum.project.version>>>
+
+ []
+
+ When building projects, the build order is determined by the inter-dependency of the projects.
+ This would mean that the dependencies of a project are built first.
+
+ In cases when a project group can build projects in parallel build queues but one of those projects depend
+ on another project, the inter-dependent projects will build in the same build queue.
+
Projects can be built in two ways:
-
- [[1]] {{{schedule_build.html} Scheduled Builds}}
-
- [[2]] {{{forced_build.html} Forced Builds}}
\ No newline at end of file
+
+ [[1]] {{{./schedule_build.html} Scheduled Builds}}
+
+ [[2]] {{{./forced_build.html} Forced Builds}}
+
+ []
+
+ Projects will have the <<in queue>> icon once the forced build or a scheduled build is triggered. This means that the project is either in the <<prepare build
+ queue>> or in the <<build queue>>.
+
+[../../images/inqueue.gif]
+
+ []
+
+ Checkout or update of projects takes longer with distributed builds enabled because after an SCM checkout or SCM update, an SCM changelog follows to get the "latest
+ update date" needed to determine whether projects should build or not.
diff --git a/continuum-docs/src/site/apt/user_guides/building_project/schedule_build.apt b/continuum-docs/src/site/apt/user_guides/building_project/schedule_build.apt
index d525130..4780494 100644
--- a/continuum-docs/src/site/apt/user_guides/building_project/schedule_build.apt
+++ b/continuum-docs/src/site/apt/user_guides/building_project/schedule_build.apt
@@ -2,14 +2,24 @@
Scheduling Project Build
------
------
- Feb 23 2009
+ 2010-02-18
------
Scheduling Project Build
- Schedules determine the project's time interval to build. In this section,
- how to configure a project to build on a schedule is discussed.
-
+ Schedules determine the project's time interval to build.
+
+ When scheduled builds are triggered, there is no dependency ordering between project groups
+ and the following happens:
+
+ * Projects are updated from the SCM.
+ These are queued under the <<Prepare Build Queues>> section in <<Queues>> page.
+
+ * Builds of the projects are executed.
+ These are queued under the <<Build Queues>> in <<Queues>> page.
+
+ []
+
To configure a scheduled build:
[[1]] Create a schedule. You can refer to {{{../../administrator_guides/schedules.html} Managing Schedules}} section.
@@ -21,4 +31,8 @@
[]
- To view the results of the build, refer to {{{build_results.html}Build Results Management}}.
\ No newline at end of file
+ *Note* In a distributed build setup, the project builds are not executed if no build agent is
+ configured or if a build agent group with no build agent, is configured in the build environment
+ that is attached to the project's build definition.
+
+ To view the results of the build, refer to {{{./build_results.html}Build Results Management}}.
diff --git a/continuum-docs/src/site/apt/user_guides/cancelling_build/cancelProjectBuild.apt b/continuum-docs/src/site/apt/user_guides/cancelling_build/cancelProjectBuild.apt
index 009615c..98898b8 100644
--- a/continuum-docs/src/site/apt/user_guides/cancelling_build/cancelProjectBuild.apt
+++ b/continuum-docs/src/site/apt/user_guides/cancelling_build/cancelProjectBuild.apt
@@ -10,6 +10,6 @@
This will cancel the build of the selected project.
- To cancel build for project, click the
+ To cancel the build for project, click the <<Cancel>> button of the project on the <<Project Group Summary>> page or on the <<Queues>> page.
-[../../images/cancelbuild.gif] Cancel Button of the project on the Project Group Summary page or on the Queues page.
+[../../images/cancelbuild.gif] Cancel Button
diff --git a/continuum-docs/src/site/apt/user_guides/index.apt b/continuum-docs/src/site/apt/user_guides/index.apt
index 8239d7e..1809e8c 100644
--- a/continuum-docs/src/site/apt/user_guides/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/index.apt
@@ -1,17 +1,20 @@
------
User's Guides
------
+ ------
+ 2010-02-18
+ ------
User's Guides
- * {{{building_project/index.html}Building Projects}}
+ * {{{./building_project/index.html}Building Projects}}
- * {{{cancelling_build/index.html}Cancelling Builds}}
+ * {{{./cancelling_build/index.html}Cancelling Builds}}
- * {{{managing_builddef/index.html}Managing Build Definitions}}
+ * {{{./managing_builddef/index.html}Managing Build Definitions}}
- * {{{managing_project/index.html}Managing Projects}}
+ * {{{./managing_project/index.html}Managing Projects}}
- * {{{notification/index.html}Notifications}}
+ * {{{./notification/index.html}Notifications}}
- * {{{release/index.html}Releasing Projects}}
+ * {{{./release/index.html}Releasing Projects}}
diff --git a/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt b/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
index cc4468e..09324ae 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefGroup.apt
@@ -12,35 +12,35 @@
[../../images/buildDefGroup.png] Project Group Build Definitions
- To add build defintion to your project group:
-
+ To add a build defintion to your project group:
+
[[1]] Under the <<Build Definitions>> tab in the <<Project Information>> screen, click <<Add>>.
-
+
[[2]] Supply the values for the necessary fields.
* Enter your <<POM filename>>, which is very likely the same as previous builds, <<<pom.xml>>>.
-
+
* In the <<Goals>> text box, enter your new goals. For example, <<<clean site deploy>>> or <<<release:branch>>>.
* You may have arguments for Maven, such as <<<--batch-mode --non-recursive>>>.
- Add your arguments in the Arguments text box or leave it empty.
+ Add your arguments in the <<Arguments>> text box or leave it empty.
- * Check <<Build Fresh>> to do a fresh checkout from CVS before the build process.
+ * Check <<Build Fresh>> to do a fresh checkout from SCM before the build process.
Check <<Always Build>> if you want to execute the goal every time you build the project.
If you want this build definition to be your default for building your project,
check the <<Is it default?>> check box.
-
+
* Select your build schedule from the pull-down menu. There will only be the <<<DEFAULT_SCHEDULE>>>
if you have not defined any others.
-
- * Select from the pull-down menu the <<Build Environment>> for the build goal.
-
+
+ * Select from the pull-down menu the <<Build Environment>> for the build definition.
+
* Select the <<Type>> from the pull-down menu.
-
+
* You can supply a short description of the build definition (<<Definition>>).
-
+
[]
[../../images/add_goal.png]
-
+
[[3]] Click <<Save>>.
\ No newline at end of file
diff --git a/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt b/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
index 29cc3e2..c680843 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_builddef/builddefProject.apt
@@ -8,41 +8,41 @@
Project Build Definition
- The project level build definition is executed to a specific project where the build definition is defined.
+ The project level build definition is executed for a specific project where the build definition is defined.
[../../images/buildDefProject.png] Project Build Definitions
- To add build defintion to your project:
-
+ To add a build defintion to your project:
+
[[1]] Select a project within the group.
-
+
[[2]] Under the <<Build Definitions>> section in the <<Project Information>> screen, click <<Add>>.
-
+
[[3]] Supply the values for the necessary fields.
* Enter your <<POM filename>>, which is very likely the same as previous builds, <<<pom.xml>>>.
-
+
* In the <<Goals>> text box, enter your new goals. For example, <<<clean site deploy>>> or <<<release:branch>>>.
* You may have arguments for Maven, such as <<<--batch-mode --non-recursive>>>.
- Add your arguments in the Arguments text box or leave it empty.
+ Add your arguments in the <<Arguments>> text box or leave it empty.
- * Check <<Build Fresh>> to do a fresh checkout from CVS before the build process.
+ * Check <<Build Fresh>> to do a fresh checkout from SCM before the build process.
Check <<Always Build>> if you want to execute the goal every time you build the project.
If you want this build definition to be your default for building your project,
check the <<Is it default?>> check box.
-
+
* Select your build schedule from the pull-down menu. There will only be the <<<DEFAULT_SCHEDULE>>>
if you have not defined any others.
-
- * Select from the pull-down menu the <<Build Environment>> for the build goal.
-
+
+ * Select from the pull-down menu the <<Build Environment>> for the build definition.
+
* Select the <<Type>> from the pull-down menu.
-
+
* You can supply a short description of the build definition (<<Definition>>).
-
+
[]
[../../images/add_goal.png]
-
+
[[4]] Click <<Save>>.
\ No newline at end of file
diff --git a/continuum-docs/src/site/apt/user_guides/managing_builddef/index.apt b/continuum-docs/src/site/apt/user_guides/managing_builddef/index.apt
index f745bb9..329cbe0 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_builddef/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_builddef/index.apt
@@ -4,17 +4,16 @@
Emmanuel Venisse
Olivier Lamy
------
- Oct 3 2007
+ 2010-02-18
------
Managing Build Definitions
Each project or project group must have at least one attached build definition in order to build.
-
+
Depending on the project, you can define different values which will be used in order to build your project.
-
- Continuum includes some default build definitions which can be changed in the <<{{{../../administrator_guides/builddefTemplate.html}Build Definition Templates screen}}>>.
-
- You can add or edit build definitions at the <<{{{builddefGroup.html}Project Group level}}>> or at the <<{{{builddefProject.html}Project level}}>>.
-
-
\ No newline at end of file
+
+ Continuum includes some default build definitions which can be changed in the <<{{{../../administrator_guides/builddefTemplate.html}Build Definition Templates}}>> screen.
+
+ You can add or edit build definitions at the <<{{{./builddefGroup.html}Project Group level}}>> or at the <<{{{./builddefProject.html}Project level}}>>.
+
diff --git a/continuum-docs/src/site/apt/user_guides/managing_project/addProject.apt b/continuum-docs/src/site/apt/user_guides/managing_project/addProject.apt
index 07f49f1..81b67d1 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_project/addProject.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_project/addProject.apt
@@ -13,66 +13,86 @@
* {Maven 2 project}
- From the menu, choose the 'Maven 2.0.x Project' entry
-
-[../../images/add-m2-project-menu.png] Add a maven2 project
+ From the menu, choose the <<Maven 2.0.x Project>> entry
- The pom.xml file must be available through one of the following protocols: http, https, or ftp
- (The file protocol is also supported but is disabled by default for security and must enabled manually).
-
- Or it can be uploaded from a local file (Note this doesn't support multi modules project).
-
-[../../images/add-m2-project.png] Add a maven2 project
+[../../images/add-m2-project-menu.png] Add a Maven 2 project
- You can define username/password if the POM URL requires authentication.
+ The <<<pom.xml>>> file must be available through one of the following protocols: http, https, or ftp.
- If your SCM stores credentials like CVS or SVN and you want to use the SCM Credentials cache, check the "Use SCM Credentials Cache" field.
+ <<Note:>> The file protocol is also supported but is disabled by default for security and must be enabled manually.
- You can define the group you want to use or "Defined by POM" in this case project.name will be use as Project Group.
+~~ TODO: Explain how to enable the file protocol
- By default, Continuum adds each sub-module POM as an individual Continuum Project. If you want to add only the root POM without sub-modules, check the "load only root as recursive build" field.
-
- You can choose a Build Definition Template which will be applied to your project. If you choose a Build Definition
- Template, the build definitions from the template will be added in addition to any build definitions that are defined
+ The <<<pom.xml>>> can also be uploaded from a local file.
+
+ <<Note:>> This doesn't support multi module projects.
+
+[../../images/add-m2-project.png] Add a Maven 2 project
+
+ You can supply a username and password if the POM URL requires authentication. This information will be stored in the database in plain text and reused later for SCM checkouts and updates.
+
+ If your SCM stores credentials like CVS or SVN and you want to use the SCM Credentials cache, check the <<Use SCM Credentials Cache>> field.
+
+~~ TODO: If 'use cached credentials' is checked, then the credentials should NOT be stored in the database. Need to see whether that's actually true before documenting it.
+
+ You can define the group you want to use or <<Defined by POM>> in this case <<<project.name>>> will be used as <<Project Group>>.
+
+ You cannot add a duplicate project (duplicates would mean another instance of a project with the same groupId, artifactId, and version) in the same Project Group.
+
+ By default, Continuum adds each sub-module POM as an individual Continuum Project. If you want to add only the root POM without sub-modules, check the <<load only root as recursive build>> field.
+
+ You can choose a <<Build Definition Template>> which will be applied to your project. If you choose a <<Build Definition
+ Template>>, the build definitions from the template will be added in addition to any build definitions that are defined
at the project group level.
-* {Maven 1 project}
-
- From the menu, choose the 'Maven 1.x Project' entry
-
-[../../images/add-m1-project-menu.png] Add a maven1 project
+ When adding projects whose parent project is building on another server,
+ make sure that the <<<settings.xml>>> with the necessary repositories exists in <<<[USER_HOME]/.m2/>>> directory.
+ Continuum uses <<<[USER_HOME]/.m2/settings.xml>>> and not the one found in <<<[M2_HOME]/conf/>>>.
- The project.xml file must be available through one of the following format : http, https and ftp
- (file protocol is off by default for security and must enabled manually).
-
- Or it can be uploaded (Note this doesn't support multi modules project).
+ The scm connection url must be present in the POM and must match the actual location of the pom in the scm repository.
+
+* {Maven 1 project}
+
+ From the menu, choose the <<Maven 1.x Project>> entry
+
+[../../images/add-m1-project-menu.png] Add a Maven 1 project
+
+ The <<<project.xml>>> file must be available through one of the following format : http, https and ftp.
+
+ <<Note:>> The file protocol is off by default for security and must enabled manually.
+
+ The <<<project.xml>>> can also be uploaded from a local file.
+
+ <<Note:>> This doesn't support multi modules project.
The project you're adding can't use a parent.
-
-[../../images/add-m1-project.png] Add a maven1 project
+
+[../../images/add-m1-project.png] Add a Maven 1 project
You can define username/password if the POM URL require an authentication.
- If your SCM store credentials like CVS or SVN and you want to use the SCM Credentials cache, check the "Use SCM Credentials Cache" field.
+ If your SCM store credentials like CVS or SVN and you want to use the SCM Credentials cache, check the <<Use SCM Credentials Cache>> field.
- You can define the group you want to use or "Defined by POM." In this case project.name will be used as the Project Group.
-
- You can choose a Build Definition Template which will be applied to your project.
+ You can define the group you want to use or <<Defined by POM>>. In this case <<<project.name>>> will be used as the <<Project Group>>.
+
+ You cannot add a duplicate project (duplicates would mean another instance of a project with the same groupId, artifactId, and version) in the same <<Project Group>>.
+
+ You can choose a <<Build Definition Template>> which will be applied to your project.
* {ANT Project}
- From the menu, choose the 'Ant Project' entry
-
-[../../images/add-ant-project-menu.png] Add a Ant project
+ From the menu, choose the <<Ant Project>> entry
+
+[../../images/add-ant-project-menu.png] Add an Ant project
TO WRITE
-[../../images/add-ant-project.png] Add a Ant project
+[../../images/add-ant-project.png] Add an Ant project
* {Shell Project}
- From the menu, choose the 'Shell Project' entry
-
+ From the menu, choose the <<Shell Project>> entry
+
[../../images/add-shell-project-menu.png] Add a shell project
TO WRITE
@@ -81,11 +101,11 @@
* {Add a project from the Project Group}
- From the Project Group, you can add a project without using the menu. With this operation, the Project Group will be set to the current group.
+ From the <<Project Group>>, you can add a project without using the menu. With this operation, the <<Project Group>> will be set to the current group.
[../../images/add-project-from-group.png] Add a project from a project group
-* {Scm hints}
+* {SCM hints}
** {ClearCase}
@@ -109,4 +129,4 @@
+----------------------------+
This configuration won't work with each ClearCase installation because each ClearCase configuration is different, so we recommend reading the
- {{{http://maven.apache.org/scm/clearcase.html}ClearCase page}} on the Maven-SCM site.
+ {{{http://maven.apache.org/scm/clearcase.html}ClearCase page}} on the Maven SCM site.
diff --git a/continuum-docs/src/site/apt/user_guides/managing_project/editProject.apt b/continuum-docs/src/site/apt/user_guides/managing_project/editProject.apt
index 4aa1a5d..6b01ead 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_project/editProject.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_project/editProject.apt
@@ -13,14 +13,14 @@
* {Project View}
- When you edit a project from the Group Summary page, you will see basic information.
+ When you edit a project from the <<Group Summary>> page, you will see basic information.
The first part of the page contains information regarding:
* project name
- * project version
+ * project version
- * project scm url
+ * project SCM URL
* project Last Build Date
@@ -30,16 +30,16 @@
[../../images/project-view-top.png] Project View Top
- With the <<<'Edit'>>> button, you can change some project informations like the scm url if your project was moved.
- With the <<<'Build Now'>>> button, you build the project manually with the default build definition.
+ With the <<Edit>> button, you can change some project information like the SCM URL if your project was moved.
+ With the <<Build Now>> button, you build the project manually with the default build definition.
- Second part contains information regarding:
+ The second part contains information regarding:
* project notifiers
* project dependencies
- * project developpers
+ * project developers
[]
@@ -47,9 +47,9 @@
* {Build Results}
- You can view all project's Build Results with the link Builds
- You will see all build results summary : start/end Time, result.
- It's possible to delete some build results with checkboxes
+ You can view all project's <<Build Results>> with the link <<Builds>>.
+ You will see all build results summary: start/end time, result.
+ It's possible to delete some build results with checkboxes.
[../../images/build-results.png] Build Results
@@ -57,11 +57,11 @@
* {Build Result}
- Editing a build result will display :
+ Editing a build result will display:
- * scm changes (author and file path)
+ * SCM changes (author and file path)
- * project dependencies (project recorded in this continuum instance)
+ * project dependencies (project recorded in this Continuum instance)
* detail of the build definition used
@@ -70,7 +70,3 @@
[]
[../../images/build-result.png] Build Result
-
-
-
-
diff --git a/continuum-docs/src/site/apt/user_guides/managing_project/index.apt b/continuum-docs/src/site/apt/user_guides/managing_project/index.apt
index 70177f8..39d62f1 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_project/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_project/index.apt
@@ -3,13 +3,15 @@
------
Emmanuel Venisse
------
- Nov 15 2007
+ 2010-02-18
------
Managing Projects
- * {{{addProject.html}How to add a project}}
+ * {{{./addProject.html}How to add a project}}
- * {{{editProject.html}How to edit a project}}
+ * {{{./editProject.html}How to edit a project}}
- * {{{removeProject.html}How to remove a project}}
+ * {{{./removeProject.html}How to remove a project}}
+
+ * {{{./workingCopy.html}Viewing the project's working copy}}
diff --git a/continuum-docs/src/site/apt/user_guides/managing_project/removeProject.apt b/continuum-docs/src/site/apt/user_guides/managing_project/removeProject.apt
index c62cc69..f47e74f 100644
--- a/continuum-docs/src/site/apt/user_guides/managing_project/removeProject.apt
+++ b/continuum-docs/src/site/apt/user_guides/managing_project/removeProject.apt
@@ -8,8 +8,8 @@
Remove a Project
- To remove a project, go to the Project Group Summary and click the <<delete>> icon.
+ To remove a project, go to the <<Project Group Summary>> and click the <<delete>> icon.
[../../images/delete.gif] Delete icon
- You can also use the <<<'Delete group'>>> button in the Project Group Summary to remove the whole project group.
+ You can also use the <<Delete group>> button in the <<Project Group Summary>> to remove the whole project group.
diff --git a/continuum-docs/src/site/apt/user_guides/managing_project/workingCopy.apt b/continuum-docs/src/site/apt/user_guides/managing_project/workingCopy.apt
new file mode 100644
index 0000000..bbe4b0d
--- /dev/null
+++ b/continuum-docs/src/site/apt/user_guides/managing_project/workingCopy.apt
@@ -0,0 +1,17 @@
+ ------
+ Project Working Copy
+ ------
+ Jevica Arianne B. Zurbano
+ ------
+ Feb 01, 2010
+ ------
+
+Project Working Copy
+
+ The <<Working Copy>> tab displays the working copy used for the project.
+
+ The source files can be viewed by clicking the filename and can be downloaded as text using the <<Download as Text>> link.
+
+ <<Note>>: The file is automatically loaded as an attachment for download when it exceeds 100KB in size.
+
+[../../images/workingCopy.png] Working Copy
diff --git a/continuum-docs/src/site/apt/user_guides/notification/index.apt b/continuum-docs/src/site/apt/user_guides/notification/index.apt
index c8ce119..10713a9 100644
--- a/continuum-docs/src/site/apt/user_guides/notification/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/index.apt
@@ -3,15 +3,15 @@
------
Emmanuel Venisse
------
- Oct 3 2007
+ 2010-02-18
------
Managing Notification
- Notifiers can be attached to a Maven project by adding them to the pom in the {{{http://maven.apache.org/pom.html#Continuous_Integration_Management}ciManagement section}}.
-
+ Notifiers can be attached to a Maven project by adding them to the POM in the {{{http://maven.apache.org/pom.html#Continuous_Integration_Management}ciManagement section}}.
+
+-------------------------------+
-
+
<ciManagement>
<system>continuum</system>
<url>http://127.0.0.1:8080/continuum</url>
@@ -27,32 +27,32 @@
</configuration>
</notifier>
</notifiers>
- </ciManagement>
-
-+-------------------------------+
+ </ciManagement>
- Or they can be added to a Project Group with the Notifiers link:
-
-[../../images/notifiers-link-project-group.png] Notifiers Link
-
- Or to a project with the Add button on the Edit Project page:
-
-[../../images/notifiers-button-project.png] Notifier Button
++-------------------------------+
- Here you select between Notifier implementations provided with Continuum:
+ Or they can be added to a <<Project Group>> with the <<Notifiers>> link:
+
+[../../images/notifiers-link-project-group.png] Notifiers Link
+
+ Or added to a project with the <<Add>> button on the <<Edit Project>> page:
+
+[../../images/notifiers-button-project.png] Notifier Button
+
+ Here you select between the Notifier implementations provided with Continuum:
[../../images/notifiers-type-choice.png] Notifier Type Choice
You have the following choices:
-
- * {{{mail.html}Mail}}
-
- * {{{irc.html}IRC}}
-
- * {{{jabber.html}Jabber}}
-
- * {{{msn.html}MSN}}
-
- * {{{wagon.html}Wagon}}
-
-
+
+ * {{{./mail.html}Mail}}
+
+ * {{{./irc.html}IRC}}
+
+ * {{{./jabber.html}Jabber}}
+
+ * {{{./msn.html}MSN}}
+
+ * {{{./wagon.html}Wagon}}
+
+
diff --git a/continuum-docs/src/site/apt/user_guides/notification/irc.apt b/continuum-docs/src/site/apt/user_guides/notification/irc.apt
index 91c1038..f4abf98 100755
--- a/continuum-docs/src/site/apt/user_guides/notification/irc.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/irc.apt
@@ -1,5 +1,5 @@
------
- Irc Notification
+ IRC Notification
------
Olivier Lamy
------
@@ -8,33 +8,33 @@
IRC Notification
- [[1]] Under Notifiers from the Project Information page, click Add.
-
- [[2]] On the Add Notifier form select IRC from the pull-down menu and click Submit.
-
+ [[1]] Under <<Notifiers>> from the <<Project Information>> page, click <<Add>>.
+
+ [[2]] On the <<Add Notifier>> form select <<IRC>> from the pull-down menu and click <<Submit>>.
+
[[3]] On the next page, fill out the form with the following information:
-
+
* IRC Host
-
+
* IRC Port
-
+
* IRC Channel
-
+
* Nick Name
-
+
* Alternate Nick Name
-
+
* User Name
-
+
* Full Name
-
+
* Password which can be left blank if you did not specify one in your IRC account
-
+
[]
-
+
[../../images/notifier-irc-add.png] Add IRC Notifier
-
- [[4]] Select the “Send on ...” options you want.
-
- [[5]] Click Save. The IRC notifier you just added will be listed under Notifiers on the Project
- Information page along with the other notifiers you may have set up prior to this.
+
+ [[4]] Select the <<Send on ...>> options you want.
+
+ [[5]] Click <<Save>>. The IRC notifier you just added will be listed under <<Notifiers>> on the <<Project
+ Information>> page along with the other notifiers you may have set up prior to this.
diff --git a/continuum-docs/src/site/apt/user_guides/notification/jabber.apt b/continuum-docs/src/site/apt/user_guides/notification/jabber.apt
index bebd8d9..ab9d301 100755
--- a/continuum-docs/src/site/apt/user_guides/notification/jabber.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/jabber.apt
@@ -8,32 +8,32 @@
Jabber Notification
- [[1]] Under Notifiers from the Project Information page, click Add.
-
- [[2]] Select Jabber from the pull-down menu and click Submit.
-
- [[3]] On the Add/Edit Jabber Notifier page, fill out the form with the following:
-
+ [[1]] Under <<Notifiers>> from the <<Project Information>> page, click <<Add>>.
+
+ [[2]] Select <<Jabber>> from the pull-down menu and click Submit.
+
+ [[3]] On the <<Add/Edit Jabber Notifier>> page, fill out the form with the following:
+
* Jabber Host
-
+
* Jabber Port is typically 5222
-
+
* Jabber Login
-
+
* Jabber Password
-
+
* Jabber Domain Name is the fully qualified domain name of your Jabber login
-
+
* Jabber Recipient Address
-
+
[]
-
+
[../../images/notifier-jabber-add.png] Add Jabber Notifier
-
+
The Jabber login and Jabber recipient address must be different. The Jabber
recipient must also be added in the contact list of the sender (at least for Google talk).
-
- [[4]] Select the “Send on ...” options you want.
-
- [[5]] Click Save. The Jabber notifier you just added will be listed under Notifiers on the Project
- Information page along with the other notifiers you may have set up prior to this.
\ No newline at end of file
+
+ [[4]] Select the <<Send on ...>> options you want.
+
+ [[5]] Click <<Save>>. The Jabber notifier you just added will be listed under <<Notifiers>> on the <<Project
+ Information>> page along with the other notifiers you may have set up prior to this.
diff --git a/continuum-docs/src/site/apt/user_guides/notification/mail.apt b/continuum-docs/src/site/apt/user_guides/notification/mail.apt
index 7bd433e..adebd36 100755
--- a/continuum-docs/src/site/apt/user_guides/notification/mail.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/mail.apt
@@ -3,41 +3,44 @@
------
Olivier Lamy
------
- Oct 23 2007
+ 2010-03-02
------
Mail Notification
- If you are using Maven 2, email notifiers configured in pom.xml will be automatically added, and you may
+ If you are using Maven 2, email notifiers configured in <<<pom.xml>>> will be automatically added, and you may
have as many as you need.
-
+
+-------------------------------+
-
+
<ciManagement>
<system>continuum</system>
<notifiers>
<notifier>
<configuration>
<address>email adress</address>
+ <committers>true</committers>
+ <developers>true</developers>
</configuration>
</notifier>
</notifiers>
- </ciManagement>
-
-+-------------------------------+
+ </ciManagement>
+
++-------------------------------+
Or can you can manually add mail notifiers at the project group or individual project level.
-
- On the <<Add Notifier>> form select <<Mail>> from the pull-down menu and click Submit.
-
-[../../images/notifier-mail-add.png] Add Email Notifier
- You must either provide a single email address, or select to notify the latest committers.
+ On the <<Add Notifier>> form select <<Mail>> from the pull-down menu and click <<Submit>>.
+
+[../../images/notifier-mail-add.png] Add Email Notifier
+
+ You must either provide a single email address, or select to notify the latest committers or project
+ developers.
~~ TODO: Does notifying an email address in addition to the latest committers also work?
- In addition you may select one or more "Send on..." options.
+ In addition you may select one or more <<Send on...>> options.
~~ TODO: What is "Send on Warning"? We only have three build states: error, failure, success
-
+
Then, click <<Save>>.
diff --git a/continuum-docs/src/site/apt/user_guides/notification/msn.apt b/continuum-docs/src/site/apt/user_guides/notification/msn.apt
index eb9729f..e1156f3 100755
--- a/continuum-docs/src/site/apt/user_guides/notification/msn.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/msn.apt
@@ -8,23 +8,23 @@
MSN Notification
- [[1]] Under Notifiers from the Project Information page, click Add.
-
- [[2]] On the Add Notifier form select, MSN from the pull-down menu and click Submit.
-
+ [[1]] Under <<Notifiers>> from the <<Project Information>> page, click <<Add>>.
+
+ [[2]] On the <<Add Notifier>> form select <<MSN>> from the pull-down menu and click <<Submit>>.
+
[[3]] On the next page, fill out the form with the following:
-
+
* MSN Login
-
+
* MSN Password
-
+
* MSN Recipient Address
-
+
[]
-
+
[../../images/notifier-msn-add.png] Add MSN Notifier
-
- [[4]] Select the “Send on ...” options you want.
-
- [[5]] Click Save. The MSN notifier you just added will be listed under Notifiers on the Project
- Information page along with the other notifiers you may have set up prior to this.
\ No newline at end of file
+
+ [[4]] Select the <<Send on ...>> options you want.
+
+ [[5]] Click <<Save>>. The MSN notifier you just added will be listed under <<Notifiers>> on the <<Project
+ Information>> page along with the other notifiers you may have set up prior to this.
diff --git a/continuum-docs/src/site/apt/user_guides/notification/wagon.apt b/continuum-docs/src/site/apt/user_guides/notification/wagon.apt
index 2ef684b..e783e5d 100755
--- a/continuum-docs/src/site/apt/user_guides/notification/wagon.apt
+++ b/continuum-docs/src/site/apt/user_guides/notification/wagon.apt
@@ -1,5 +1,5 @@
------
- Jabber Notification
+ Wagon Notification
------
Olivier Lamy
------
@@ -8,16 +8,16 @@
Wagon Notification
- [[1]] Under Notifiers from the Project Information page, click Add.
-
- [[2]] On the Add Notifier form select Wagon from the pull-down menu and click Submit.
-
+ [[1]] Under <<Notifiers>> from the <<Project Information>> page, click <<Add>>.
+
+ [[2]] On the <<Add Notifier>> form select <<Wagon>> from the pull-down menu and click <<Submit>>.
+
[[3]] On the next page, enter the Project Site URL.
-
+
It must be a Wagon URL like the URL used in <<<distributionManagement>>>. For the Webdav protocol,
- you can use <<<dav:[http_url]>>> or <<<file:///path_to_the_directory>>> if you want to copy it locally
+ you can use <<<dav:[http_url]>>>, or <<<file:///path_to_the_directory>>> if you want to copy it locally
with the file protocol.
-
+
[[4]] Enter the ServerId. This should match the value of the <<<\<id\>>>> in the server configuration found in
<<<settings.xml>>>. Sample configuration follows:
@@ -30,23 +30,23 @@
+------+
Using the server configuration in <<<[user_home]/.m2/settings.xml>>> is a workaround
- for user authentication using the wagon notifier.
+ for user authentication using the Wagon notifier.
The <<<\<username\>>>> and <<<\<password\>>>> should be set to the user account that has the <<Site
Producer>> and <<Site Observer>> roles.
-
+
[../../images/notifier-wagon-add.png] Add Wagon Notifier
-
- [[5]] Select the “Send on ...” options you want.
-
- [[6]] Click Save. The Wagon notifier you just added will be listed under Notifiers on the Project
- Information page along with the other notifiers you may have set up prior to this.
-
+
+ [[5]] Select the <<Send on ...>> options you want.
+
+ [[6]] Click <<Save>>. The Wagon notifier you just added will be listed under <<Notifiers>> on the <<Project
+ Information>> page along with the other notifiers you may have set up prior to this.
+
[]
-
- The file protocol will create <<<buildresult.txt>>> file locally in the location specified in the
- Wagon Notifier configuration. If you used the Webdav protocol, a <<<buildresult.txt>>> file will
+
+ The file protocol will create a <<<buildresult.txt>>> file locally in the location specified in the
+ Wagon Notifier configuration. If you use the Webdav protocol, a <<<buildresult.txt>>> file will
be copied to your disk, relative to where you told it to be placed when you set up the Wagon
notifier.
-
- You can also view the <<<buildresult.txt>>> file from a browser at the Project Site URL you specified.
\ No newline at end of file
+
+ You can also view the <<<buildresult.txt>>> file from a browser at the Project Site URL you specified.
diff --git a/continuum-docs/src/site/apt/user_guides/release/index.apt b/continuum-docs/src/site/apt/user_guides/release/index.apt
index 37f2d76..cfce998 100644
--- a/continuum-docs/src/site/apt/user_guides/release/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/release/index.apt
@@ -1,41 +1,44 @@
------
Releasing Projects
------
+ ------
+ 2010-02-18
+ ------
Releasing Projects
- The release process has two steps, {{{prepare.html}Prepare}} and {{{perform.html}Perform}}.
+ The release process has two steps, {{{./prepare.html}Prepare}} and {{{./perform.html}Perform}}.
[[1]] First, it prepares your project for release by doing the following:
* Checks that your project is in a "releasable" state.
-
+
* Updates the POMs for the new development version.
-
+
* Runs a test build.
-
+
* Generates a tag for the release.
-
- * Generates the artifact to be deployed, such as a jar file.
-
+
+ * Generates the artifact to be deployed, such as a JAR file.
+
* Generates the site and deploys it.
-
- * Commits the new POMs to the new development version. It will do the commit to the SCM
+
+ * Commits the new POMs with the new development version. It will do the commit to the SCM
connection URL you specify (explained later).
-
+
[]
-
+
[[2]] Then the release management system performs the release by checking out a clean copy
of the tagged release and deploying the artifacts and site.
-
+
[]
-
+
* Modifying POM for Release
- The source code control system you use must be specified in your POM file in an <<<scm>>> entry
+ The source code control system you use must be specified in your POM file in an <<<\<scm\>>>> entry
similar to the one shown here:
-
-+----------------------------------------------------------------------------------+
+
++----------------------------------------------------------------------------------+
<scm>
<connection>
scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk
@@ -46,19 +49,26 @@
<url>http://svn.apache.org/viewcvs.cgi/maven/components/trunk</url>
</scm>
+---------------------------------------------------------------------------------+
-
- To determine what to enter for your connection URL (the "<<< \<connection\> >>>" tag) go to the link
+
+ To determine what to enter for your connection URL (the <<<\<connection\>>>> tag) go to the link
{{http://maven.apache.org/scm/scms-overview.html}} for a list of supported SCMs and click on your
source code control system to see the appropriate syntax for your particular software.
-
+
In general the format for an SCM URL is:
<<< scm:<scm_provider><delimiter><provider_specific_part> >>>
-
- In the example above, the <<<scm_provider>>> is "<<<svn>>>" (Subversion). The <<<delimiter>>> is a colon.
- And the rest of the line is the "<<<provider_specific_part>>>".
-
+
+ In the example above, the <<<scm_provider>>> is <<<svn>>> (Subversion). The <<<delimiter>>> is a colon.
+ And the rest of the line is the <<<provider_specific_part>>>.
+
It is important to prepare the release just before performing the release. The reason these
processes have been separated into two steps is to allow the user to confirm that everything has been
set correctly before the actual release. If between the prepare and performing of the release there is
a change to the SCM tree, an error will occur causing the prepare process to restart.
-
\ No newline at end of file
+
+ []
+
+* Releasing projects in a distributed build
+
+ Release will happen in the Build Agent where the last build of project occurred.
+
+ To view on-going releases from different build agents, click the <<Releases>> button under the <<Distributed Builds>> menu.
diff --git a/continuum-docs/src/site/apt/user_guides/release/perform.apt b/continuum-docs/src/site/apt/user_guides/release/perform.apt
index 75b47a2..f2d0e33 100644
--- a/continuum-docs/src/site/apt/user_guides/release/perform.apt
+++ b/continuum-docs/src/site/apt/user_guides/release/perform.apt
@@ -1,19 +1,27 @@
------
Perform Release
------
+ ------
+ 2010-02-19
+ ------
Perform Release
- Choose "Perform Release" and the version number
+ Choose <<Perform Release>> and the version number
[../../images/release-choose-perform-goal.png]
- Fill in the form and click Submit
+ Fill in the form and click <<Submit>>
+
+ To specify a different Maven goal to execute during the release, fill in the <<Perform Goals>> field with another goal.
+ By default, the goal for this field is <<<clean deploy>>>.
+
+ To specify additional arguments during execution, fill in the <<Arguments>> field.
[../../images/release-perform-parameters.png]
- Wait for the process to complete, then click Done.
+ Wait for the process to complete, then click <<Done>>.
[../../images/release-perform-executing.png]
- To view the release perform results, refer to {{{release_results.html}Release Results Management}}.
\ No newline at end of file
+ To view the release perform results, refer to {{{./release_results.html}Release Results Management}}.
diff --git a/continuum-docs/src/site/apt/user_guides/release/prepare.apt b/continuum-docs/src/site/apt/user_guides/release/prepare.apt
index 8bf2948..c30433c 100644
--- a/continuum-docs/src/site/apt/user_guides/release/prepare.apt
+++ b/continuum-docs/src/site/apt/user_guides/release/prepare.apt
@@ -1,31 +1,49 @@
------
Preparing for Release
------
+ ------
+ 2010-02-19
+ ------
Prepare for Release
- Navigate to the Project Group Summary and click the Release button or icon.
+ Navigate to the <<Project Group Summary>> and click the <<Release>> button or icon.
[../../images/release-project-group-summary.png] Release
- Choose "Prepare project for release" and click "Submit"
+ Choose <<Prepare project for release>> and click <<Submit>>.
[../../images/release-choose-prepare-goal.png] Release
- Complete the form, providing the scm tag name, etc.
+ Complete the form, providing the SCM tag name, etc.
- Check the 'Use edit mode' checkbox if you are using a SCM system that requires you to obtain a lock before editing.
+ Check the <<Use edit mode>> checkbox if you are using an SCM system that requires you to obtain a lock before editing.
- Click Submit.
+ Click <<Submit>>.
+
+ <<Note:>> When releasing in a {{{../../administrator_guides/distributed-builds.html} distributed builds}} setup, a <<Build environment>>
+ should be selected containing at least one enabled build agent. Furthermore, the release will not happen in the following cases:
+
+ * no build environment selected
+
+ * no build agent found in the build agent group attached to the build environment
+
+ * all build agents configured in the selected build environment are disabled
+
+ []
[../../images/release-prepare-parameters.png] Release Prepare parameters
- Wait for the process to complete, then click Done.
+ Wait for the process to complete, then click <<Done>>.
+
+ <<Note:>> Hitting the <<Rollback>> button does not roll back or delete the SCM tag created during the <<<scm-tag>>> phase.
+ So when re-doing the release prepare of the same version, make sure that the tag does not exist in SVN, if so,
+ the tag should be manually deleted.
[../../images/release-prepare-executing.png]
- You will be returned to this page to make another selection
+ You will be returned to this page to make another selection.
[../../images/release-choose-perform-goal.png]
- To view the release prepare results, refer to {{{release_results.html}Release Results Management}}.
+ To view the release prepare results, refer to {{{./release_results.html}Release Results Management}}.
diff --git a/continuum-docs/src/site/apt/user_guides/release/release_results.apt b/continuum-docs/src/site/apt/user_guides/release/release_results.apt
index e0f330e..dac0f71 100644
--- a/continuum-docs/src/site/apt/user_guides/release/release_results.apt
+++ b/continuum-docs/src/site/apt/user_guides/release/release_results.apt
@@ -7,13 +7,17 @@
Release Results Management
- <<Release Results>> tab from the <<Project Information>> page displays all the release results of a
- project when executing release goals prepare and perform.
+ The <<Release Results>> tab from the <<Project Information>> page displays all the release results of a
+ project when executing the release goals prepare and perform.
+
+~~TODO What does the last part of the above mean?
[../../images/release_result-1.png] Release Results page
To view the release result, click the <<View Result>> link in-line with the release goal being executed.
+
+ The <<Triggered by>> field displays the username of the person who initiated the release.
[../../images/release_result-2.png] Release Summary
- To delete release results, select the boxes beside the project name then click <<Delete>>.
\ No newline at end of file
+ To delete release results, select the boxes beside the project name then click <<Delete>>.
diff --git a/continuum-docs/src/site/apt/user_guides/viewing_queues/index.apt b/continuum-docs/src/site/apt/user_guides/viewing_queues/index.apt
index 5a54e46..5f2c365 100644
--- a/continuum-docs/src/site/apt/user_guides/viewing_queues/index.apt
+++ b/continuum-docs/src/site/apt/user_guides/viewing_queues/index.apt
@@ -8,10 +8,10 @@
Viewing Queues
- Click the <<Queues>> link under the <<Administration>> section
+ Click the <<Queues>> link under the <<Administration>> section.
[../../images/queues.png] Queues
- You can only view the current checkout, current build, checkout queues and build queues.
-
-[../../images/queues-view.png] Queues View
+ You can only view the current checkout, current prepare build, current build, checkout queues, prepare build queues and build queues.
+
+[../../images/queues-view.png] Queues View
diff --git a/continuum-docs/src/site/pdf.xml b/continuum-docs/src/site/pdf.xml
index 910e6f9..ecaf971 100644
--- a/continuum-docs/src/site/pdf.xml
+++ b/continuum-docs/src/site/pdf.xml
@@ -21,7 +21,7 @@
<document outputName="apache-continuum">
<meta>
- <title>Apache Continuum</title>
+ <title>Apache Continuum ${project.version}</title>
<author>The Apache Continuum Project</author>
</meta>
@@ -34,14 +34,9 @@
<item name="Installation" ref="installation/installation.html"/>
<item name="Standalone" ref="installation/standalone.html"/>
<item name="Tomcat" ref="installation/tomcat.html"/>
- <item name="JBoss" ref="installation/jboss.html"/>
- <item name="Jetty" ref="installation/jetty.html"/>
- <item name="Geronimo" ref="installation/geronimo.html"/>
- <item name="Glassfish" ref="installation/glassfish.html"/>
- <item name="Release Notes" ref="installation/release-notes.html"/>
<item name="Upgrade" ref="installation/upgrade.html"/>
- <item name="User's Guides" collapse="true" ref="user_guides/index.html"/>
+ <item name="User's Guides" ref="user_guides/index.html"/>
<item name="Managing Projects" ref="user_guides/managing_project/index.html"/>
<item name="Add a Project" ref="user_guides/managing_project/addProject.html"/>
<item name="Edit a Project" ref="user_guides/managing_project/editProject.html"/>
@@ -56,13 +51,19 @@
<item name="MSN Notification" ref="user_guides/notification/msn.html"/>
<item name="Wagon Notification" ref="user_guides/notification/wagon.html"/>
<item name="Building a project" ref="user_guides/building_project/index.html"/>
+ <item name="Scheduled Build" ref="user_guides/building_project/schedule_build.html"/>
+ <item name="Forced Build" ref="user_guides/building_project/forced_build.html"/>
+ <item name="Build Results Management" ref="user_guides/building_project/build_results.html"/>
<item name="Release Management" ref="user_guides/release/index.html"/>
+ <item name="Prepare Project Release" ref="user_guides/release/prepare.html"/>
+ <item name="Perform Project Release" ref="user_guides/release/perform.html"/>
+ <item name="Release Results Management" ref="user_guides/release/release_results.html"/>
<item name="Administrator's Guides" ref="administrator_guides/index.html"/>
<item name="Managing Users and Security" ref="administrator_guides/security/index.html"/>
<item name="Security Configuration" ref="administrator_guides/security/customising-security.html"/>
<item name="LDAP Configuration" ref="administrator_guides/security/ldap.html"/>
- <item name="Adding Project Group" ref="administrator_guides/projectgroup.html"/>
+ <item name="Managing Project Groups" ref="administrator_guides/projectgroup.html"/>
<item name="Managing Builders" ref="administrator_guides/builder.html"/>
<item name="Managing JDKs" ref="administrator_guides/jdk.html"/>
<item name="Managing Build Environments" ref="administrator_guides/profiles.html"/>
@@ -71,11 +72,20 @@
<item name="Managing Local Repositories" ref="administrator_guides/localRepository.html"/>
<item name="Managing Purge Configuration" ref="administrator_guides/purgeConfiguration.html"/>
<item name="Managing Parallel Builds" ref="administrator_guides/parallelBuilds.html"/>
+ <item name="Managing Build Queues" ref="administrator_guides/buildQueue.html"/>
+ <item name="Managing Build Agents" ref="administrator_guides/build-agents.html"/>
+ <item name="Managing Build Agent Groups" ref="administrator_guides/build-agent-groups.html"/>
+ <item name="Managing Project Queues" ref="administrator_guides/queues.html"/>
<item name="External databases" ref="administrator_guides/external-db.html"/>
<item name="Monitoring Continuum" ref="administrator_guides/monitoring.html"/>
+ <item name="Log Files" ref="administrator_guides/logging.html"/>
+ <item name="Audit Logs" ref="administrator_guides/audit-logs.html"/>
+ <item name="Continuum Logs" ref="administrator_guides/continuum-logs.html"/>
+ <item name="Security Logs" ref="administrator_guides/security-logs.html"/>
<item name="Appearance Configuration" ref="administrator_guides/appearance.html"/>
<item name="Build Definition Template" ref="administrator_guides/builddefTemplate.html"/>
<item name="Shutdown Continuum" ref="administrator_guides/shutdown.html"/>
+ <item name="Understanding Distributed Builds" ref="administrator_guides/distributed-builds.html"/>
<item name="Developer's Guides" ref="developer_guides/index.html"/>
<item name="Building Continuum" ref="developer_guides/building.html"/>
diff --git a/continuum-docs/src/site/resources/images/build_result-1.png b/continuum-docs/src/site/resources/images/build_result-1.png
index d5c4045..74baa6c 100755
--- a/continuum-docs/src/site/resources/images/build_result-1.png
+++ b/continuum-docs/src/site/resources/images/build_result-1.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/inqueue.gif b/continuum-docs/src/site/resources/images/inqueue.gif
new file mode 100644
index 0000000..e9907fb
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/inqueue.gif
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/notifier-mail-add.png b/continuum-docs/src/site/resources/images/notifier-mail-add.png
index 1c299c9..31bee16 100755
--- a/continuum-docs/src/site/resources/images/notifier-mail-add.png
+++ b/continuum-docs/src/site/resources/images/notifier-mail-add.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/project-group-summary.png b/continuum-docs/src/site/resources/images/project-group-summary.png
new file mode 100644
index 0000000..c8ef3dc
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/project-group-summary.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/project-groups.png b/continuum-docs/src/site/resources/images/project-groups.png
new file mode 100644
index 0000000..926268e
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/project-groups.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/queues-checkout.png b/continuum-docs/src/site/resources/images/queues-checkout.png
new file mode 100644
index 0000000..02a15be
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/queues-checkout.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/queues-prepare.png b/continuum-docs/src/site/resources/images/queues-prepare.png
new file mode 100644
index 0000000..6ed7334
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/queues-prepare.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/release-perform-parameters.png b/continuum-docs/src/site/resources/images/release-perform-parameters.png
index 6030e01..397c127 100644
--- a/continuum-docs/src/site/resources/images/release-perform-parameters.png
+++ b/continuum-docs/src/site/resources/images/release-perform-parameters.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/release-prepare-parameters.png b/continuum-docs/src/site/resources/images/release-prepare-parameters.png
index 8ae4241..94cc25c 100644
--- a/continuum-docs/src/site/resources/images/release-prepare-parameters.png
+++ b/continuum-docs/src/site/resources/images/release-prepare-parameters.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/release_result-2.png b/continuum-docs/src/site/resources/images/release_result-2.png
index 93a8f33..c8afa14 100755
--- a/continuum-docs/src/site/resources/images/release_result-2.png
+++ b/continuum-docs/src/site/resources/images/release_result-2.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/update-project-group.png b/continuum-docs/src/site/resources/images/update-project-group.png
new file mode 100644
index 0000000..0c411f6
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/update-project-group.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/images/workingCopy.png b/continuum-docs/src/site/resources/images/workingCopy.png
new file mode 100644
index 0000000..c9a5bba
--- /dev/null
+++ b/continuum-docs/src/site/resources/images/workingCopy.png
Binary files differ
diff --git a/continuum-docs/src/site/resources/pdf-config.xml b/continuum-docs/src/site/resources/pdf-config.xml
new file mode 100644
index 0000000..33b127a
--- /dev/null
+++ b/continuum-docs/src/site/resources/pdf-config.xml
@@ -0,0 +1,10 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:attribute-set name="figure.graphics">
+ <xsl:attribute name="height">100%</xsl:attribute>
+ <xsl:attribute name="width">100%</xsl:attribute>
+ <xsl:attribute name="content-height">scale-down-to-fit</xsl:attribute>
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
+ </xsl:attribute-set>
+
+</xsl:stylesheet>
diff --git a/continuum-docs/src/site/site.xml b/continuum-docs/src/site/site.xml
index b4a6ba7..6b11577 100644
--- a/continuum-docs/src/site/site.xml
+++ b/continuum-docs/src/site/site.xml
@@ -21,30 +21,29 @@
<project name="Apache Continuum">
<body>
<breadcrumbs>
- <item name="1.3.2" href="/" />
+ <item name="${project.version}" href="/" />
</breadcrumbs>
+
<menu name="Documentation">
<item name="Index (category)" href="index.html"/>
<item name="Getting Started" href="getting-started.html"/>
+
<item name="Installation/Upgrade Guides" href="installation/index.html" collapse="true">
<item name="System Requirements" href="installation/requirements.html"/>
<item name="Installation" href="installation/installation.html" collapse="true">
<item name="Standalone" href="installation/standalone.html"/>
<item name="Tomcat" href="installation/tomcat.html"/>
- <item name="JBoss" href="installation/jboss.html"/>
- <item name="Jetty" href="installation/jetty.html"/>
- <item name="Geronimo" href="installation/geronimo.html"/>
- <item name="Glassfish" href="installation/glassfish.html"/>
</item>
- <item name="Release Notes" href="installation/release-notes.html"/>
+ <item name="Release Notes" href="release-notes.html"/>
<item name="Upgrade" href="installation/upgrade.html"/>
</item>
+
<item name="User's Guides" collapse="true" href="user_guides/index.html">
- <item name="Getting Started" href="getting-started.html"/>
<item name="Managing Projects" href="user_guides/managing_project/index.html" collapse="true">
<item name="Add a Project" href="user_guides/managing_project/addProject.html"/>
<item name="Edit a Project" href="user_guides/managing_project/editProject.html"/>
<item name="Remove a Project" href="user_guides/managing_project/removeProject.html"/>
+ <item name="Working Copy" href="user_guides/managing_project/workingCopy.html"/>
<!-- item name="SCM security hints"/ -->
</item>
<item name="Managing Build Definitions" href="user_guides/managing_builddef/index.html" collapse="true">
@@ -71,35 +70,47 @@
<item name="Release Results Management" href="user_guides/release/release_results.html"/>
</item>
</item>
+
<item name="Administrator's Guides" href="administrator_guides/index.html" collapse="true">
<item name="Managing Users and Security" href="administrator_guides/security/index.html" collapse="true">
<item name="Security Configuration" href="administrator_guides/security/customising-security.html"/>
<item name="LDAP Configuration" href="administrator_guides/security/ldap.html"/>
</item>
- <item name="Adding Project Group" href="administrator_guides/projectgroup.html"/>
+ <item name="Managing Project Groups" href="administrator_guides/projectgroup.html"/>
<item name="Managing Builders" href="administrator_guides/builder.html"/>
<item name="Managing JDKs" href="administrator_guides/jdk.html"/>
- <item name="Managing Build Environments" href="administrator_guides/profiles.html"/>
+ <item name="Managing Build Environments" href="administrator_guides/buildEnvironment.html"/>
<item name="Managing Schedules" href="administrator_guides/schedules.html"/>
<item name="Managing General Configuration" href="administrator_guides/configuration.html"/> <!-- (configuration and appearance) -->
<item name="Managing Local Repositories" href="administrator_guides/localRepository.html"/>
<item name="Managing Purge Configuration" href="administrator_guides/purgeConfiguration.html"/>
- <item name="Managing Parallel Builds" href="administrator_guides/parallelBuilds.html"/>
+ <item name="Managing Parallel Builds" href="administrator_guides/parallelBuilds.html">
+ </item>
+ <item name="Managing Build Queues" href="administrator_guides/buildQueue.html"/>
<item name="Managing Build Agents" href="administrator_guides/build-agents.html"/>
<item name="Managing Build Agent Groups" href="administrator_guides/build-agent-groups.html"/>
+ <item name="Managing Project Queues" href="administrator_guides/queues.html"/>
<item name="External databases" href="administrator_guides/external-db.html"/>
<item name="Monitoring Continuum" href="administrator_guides/monitoring.html"/>
+ <item name="Log Files" href="administrator_guides/logging.html" collapse="true">
+ <item name="Audit Logs" href="administrator_guides/audit-logs.html" />
+ <item name="Continuum Logs" href="administrator_guides/continuum-logs.html" />
+ <item name="Security Logs" href="administrator_guides/security-logs.html" />
+ </item>
<item name="Appearance Configuration" href="administrator_guides/appearance.html"/>
- <item name="Build Definition Template" href="administrator_guides/builddefTemplate.html"/>
+ <item name="Build Definition Template" href="administrator_guides/builddefTemplate.html"/>
<item name="Shutdown Continuum" href="administrator_guides/shutdown.html"/>
<item name="Understanding Distributed Builds" href="administrator_guides/distributed-builds.html"/>
</item>
+
<item name="Developer's Guides" href="developer_guides/index.html" collapse="true">
<!-- item name="SVN repository structure" href="developer_guides/svn.html"/ -->
<item name="Building Continuum" href="developer_guides/building.html"/>
<!-- item name="Design" href="developer_guides/design.html"/ -->
<item name="XML-RPC" href="developer_guides/xmlrpc.html"/>
</item>
+
+ <item name="PDF" href="apache-continuum.pdf"/>
</menu>
</body>
</project>
diff --git a/continuum-docs/src/site/xdoc/release-notes.xml b/continuum-docs/src/site/xdoc/release-notes.xml
index 6ab499f..7dc1a55 100644
--- a/continuum-docs/src/site/xdoc/release-notes.xml
+++ b/continuum-docs/src/site/xdoc/release-notes.xml
@@ -4,168 +4,117 @@
</properties>
<body>
- <h2>Apache Continuum 1.3.2 Release Notes</h2>
+ <h2>Apache Continuum 1.4.0 Release Notes</h2>
- <p>The Apache Continuum team is pleased to announce Apache Continuum 1.3.2.</p>
+ <p>The Apache Continuum team is pleased to announce Apache Continuum 1.4.0.</p>
- <p>Apache Continuum 1.3.2 includes the following new features:</p>
+ <p>This release includes the following new features:</p>
- <p><b>Scm Comment Prefix for Release Prepare</b> -- Ability to configure the scm comment prefix through the web UI for release prepare.</p>
-
- <p><b>Build Agent Group</b> -- Build agents can now be assigned to a specific project build.</p>
+ <p><b>Improved user recognition</b> - information on who executed releases and forced builds, and better handling of sending notifications to developers who made a change</p>
<p>To learn more about how the Continuum dev team versions releases, see our
<a href="http://continuum.apache.org/development/release.html">release guidelines</a>.</p>
- <h2>Release Notes - Continuum - Version 1.3.2</h2>
-
- <h2> Sub-task
- </h2>
- <ul>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1499'>CONTINUUM-1499</a>] - Translate to Brazilian Portuguese
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2057'>CONTINUUM-2057</a>] - Update Project From Working Copy
- </li>
- </ul>
+<h2> Bug
+</h2>
+<ul>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1578'>CONTINUUM-1578</a>] - No output after a successful perform release
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2114'>CONTINUUM-2114</a>] - cannot login with perforce scm until new version of scm is included
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2170'>CONTINUUM-2170</a>] - No such object error when forcing a build from the group-level Build Definitions tab
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2267'>CONTINUUM-2267</a>] - Error with backslash in Windows path for inatallation tests
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2270'>CONTINUUM-2270</a>] - Selenium tests fail when run with JDK 1.6
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2285'>CONTINUUM-2285</a>] - Queues page turns to blank if build queues are not empty
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2349'>CONTINUUM-2349</a>] - Project should only build in agents that are in the Build agent group assigned to it
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2371'>CONTINUUM-2371</a>] - Unable to view queues after loss of build agent
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2381'>CONTINUUM-2381</a>] - Project is not building even when there is an enabled build agent configured
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2386'>CONTINUUM-2386</a>] - Build environment selection is ignored when releasing with distributed build enabled
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2391'>CONTINUUM-2391</a>] - Master should not pass full path to local repository to the agent
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2395'>CONTINUUM-2395</a>] - Build Environment accepts duplicate name during edit
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2397'>CONTINUUM-2397</a>] - Unable to edit the added local repository
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2440'>CONTINUUM-2440</a>] - Unable to download html file from working copy
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2450'>CONTINUUM-2450</a>] - Intermittent error when releasing in a distributed build
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2451'>CONTINUUM-2451</a>] - Unable to release a project using the "provide parameters" option with distributed builds
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2466'>CONTINUUM-2466</a>] - authorization failed when building ant / shell projects
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2474'>CONTINUUM-2474</a>] - Fix selenium failing test in windows
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2476'>CONTINUUM-2476</a>] - Projects are not built in the correct build agent when the project is already in the build queue and then triggered to be built again
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2479'>CONTINUUM-2479</a>] - Link to cron-help is wrong
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2487'>CONTINUUM-2487</a>] - Selenium tests fail if run at certain times crossing the 'on the hour' default schedule trigger
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2490'>CONTINUUM-2490</a>] - Getting permission denied when running selenium tests in IE
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2493'>CONTINUUM-2493</a>] - "Users Wiki" link on home page points at old wiki
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2494'>CONTINUUM-2494</a>] - Unable to build a project even though the build agent is there.
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2504'>CONTINUUM-2504</a>] - Queues page shows distributedBuild.table.agentUrl for the Agent URL field instead of the actual value
+</li>
+</ul>
- <h2> Bug
- </h2>
- <ul>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1503'>CONTINUUM-1503</a>] - scm release tag default should match what the release plugin uses
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1504'>CONTINUUM-1504</a>] - when autoVersionSubmodules=true is defined in the pom for the release plugin, the release prepare screen should not show or allow changing of child project versions
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1505'>CONTINUUM-1505</a>] - release perform page does not use defaults specified in pom for release plugin for goals and useReleaseProfile
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1887'>CONTINUUM-1887</a>] - Release rollback hangs when the release failed at the scm-check-modifications phase
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1909'>CONTINUUM-1909</a>] - login and password ignored in checkout operation
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1918'>CONTINUUM-1918</a>] - Username and Password should be optional on project release form (Subversion projects)
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1972'>CONTINUUM-1972</a>] - Error attempting to delete project group
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2015'>CONTINUUM-2015</a>] - Deleting Purge Configuration doesn't ask for confirmation upon deletion
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2038'>CONTINUUM-2038</a>] - Some dojo js files are missing
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2047'>CONTINUUM-2047</a>] - Can't edit or delete PROJECT build Definition
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2048'>CONTINUUM-2048</a>] - Parallel Build Queue Name accepts null value
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2050'>CONTINUUM-2050</a>] - Available Templates has "false" on top of delete icon
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2053'>CONTINUUM-2053</a>] - Problem with french characters
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2055'>CONTINUUM-2055</a>] - link to data management cli broken in migration doc
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2058'>CONTINUUM-2058</a>] - Editing an Installation , page dont change
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2059'>CONTINUUM-2059</a>] - Dont validate envirotment name when create installation with 'Create a Build Environment Installation with the name'
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2064'>CONTINUUM-2064</a>] - Default Build Enviroment List don't show installations
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2065'>CONTINUUM-2065</a>] - Wrong content in Other Changes Since Last Success section of build results
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2067'>CONTINUUM-2067</a>] - Error while deleting project caused by SCM RESULT dependency foreign key constraint violation
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2072'>CONTINUUM-2072</a>] - Take care of the platform's default encoding when building continuum
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2077'>CONTINUUM-2077</a>] - Project Scm Root is not deleted even when you delete the projects.
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2090'>CONTINUUM-2090</a>] - Stack Overflow error when preparing project for release
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2102'>CONTINUUM-2102</a>] - Unable to configure subject line for email notifications
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2107'>CONTINUUM-2107</a>] - Send on SCM Failure is duplicated on the Add/Edit Mail Notifier page
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2112'>CONTINUUM-2112</a>] - Incorrect title page of Add/Edit Parallel Build Queue
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2118'>CONTINUUM-2118</a>] - update code that checks isLocked() to also check isPasswordChangeRequired() as well
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2120'>CONTINUUM-2120</a>] - Unable to build project after scm error
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2124'>CONTINUUM-2124</a>] - NPE when building Shell or Ant project
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2126'>CONTINUUM-2126</a>] - Edit Project Group moving a project to other project group fail
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2129'>CONTINUUM-2129</a>] - ClassNotFoundException when using the XML-RPC client
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2130'>CONTINUUM-2130</a>] - Unable to notify latest committers only
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2134'>CONTINUUM-2134</a>] - Deleting a project group-level notifier with recipient latest committers prompts Are you sure you want to delete the mail notifier with recipient ""?
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2135'>CONTINUUM-2135</a>] - Missing confirmation when deleting a project-level notifier from the group-level Notifiers tab
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2139'>CONTINUUM-2139</a>] - Creating a Mail notifier incorrectly allows only spaces in the email address
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2140'>CONTINUUM-2140</a>] - Some continuum objects are missing during backup/restore
- </li>
- </ul>
+<h2> Improvement
+</h2>
+<ul>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-493'>CONTINUUM-493</a>] - Allow to add all developpers address in a notifier without duplicate developpers addresses
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-565'>CONTINUUM-565</a>] - Forced builds should say who (which continuum user) forced the build
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2160'>CONTINUUM-2160</a>] - Upgrade to last scm version (1.2) and last release-manager version
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2373'>CONTINUUM-2373</a>] - Distributed Master needs more detailed logging
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2458'>CONTINUUM-2458</a>] - Continuum Release should do a checkout if there is no working copy
+</li>
+</ul>
- <h2> Improvement
- </h2>
- <ul>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1321'>CONTINUUM-1321</a>] - Improve error message when perform release fails due to missing distributionManagement
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1726'>CONTINUUM-1726</a>] - Project description (as given in POM) should be visible
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-1823'>CONTINUUM-1823</a>] - Fewer notifications when Subversion server is unreachable
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2005'>CONTINUUM-2005</a>] - Go the "Project Build tab" from the "Build Queue" page
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2020'>CONTINUUM-2020</a>] - Remove the local repository column from the project groups page
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2027'>CONTINUUM-2027</a>] - The i18n patch for zh_CN
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2028'>CONTINUUM-2028</a>] - Continuum release prepare should use maven-release-plugin scmCommentPrefix configuration in pom
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2042'>CONTINUUM-2042</a>] - Ability to control which projects build on which agents
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2043'>CONTINUUM-2043</a>] - Release should happen on a build agent rather than on the master
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2051'>CONTINUUM-2051</a>] - Add confirmation upon deletion in Parallel Build Queue
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2052'>CONTINUUM-2052</a>] - Delete Confirmation Pages for Installation, Build Definition Templates
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2061'>CONTINUUM-2061</a>] - Typo on Project Groups's message prompts
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2070'>CONTINUUM-2070</a>] - add a check if project should build or not
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2087'>CONTINUUM-2087</a>] - Viewing of working copy from build agent
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2109'>CONTINUUM-2109</a>] - [Roles] Change continuum-manage-purging and continuum-manage-repositories user role names to Continuum Manage Purging and Continuum Manage Local Repositories
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2125'>CONTINUUM-2125</a>] - add security audit log
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2127'>CONTINUUM-2127</a>] - Configuration for Distributed Build should be visible only if Distributed Build is enabled
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2136'>CONTINUUM-2136</a>] - Show error message when build agent is removed or disabled
- </li>
- </ul>
+<h2> New Feature
+</h2>
+<ul>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2265'>CONTINUUM-2265</a>] - Need information on who executed a release
+</li>
+</ul>
- <h2> New Feature
- </h2>
- <ul>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2054'>CONTINUUM-2054</a>] - Ability to configure the scm comment prefix through the web UI for release prepare
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2068'>CONTINUUM-2068</a>] - Build Agent group functionality
- </li>
- </ul>
+<h2> Task
+</h2>
+<ul>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2252'>CONTINUUM-2252</a>] - Add documentation for Selenium tests
+</li>
+</ul>
- <h2> Task
- </h2>
- <ul>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2116'>CONTINUUM-2116</a>] - Upgrade to Redback 1.2 release
- </li>
- <li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2137'>CONTINUUM-2137</a>] - Update documentation for new Build Agent Group functionality
- </li>
- </ul>
-
-Have Fun !
-<br/><br/>
---<br/>
-The Apache Continuum Team
+<h2> Test
+</h2>
+<ul>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2073'>CONTINUUM-2073</a>] - Revive the automated Selenium integration tests
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2268'>CONTINUUM-2268</a>] - Continuum Webapp Tests Capture Screenshot for AbstractSeleniumTest.java
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2271'>CONTINUUM-2271</a>] - Continuum Build Agent Tests and Improvement on Build Queue Test
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2378'>CONTINUUM-2378</a>] - Selenium Test for deleting projects and project groups
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2467'>CONTINUUM-2467</a>] - Selenium test: check for project group SCM update when building projects
+</li>
+<li>[<a href='http://jira.codehaus.org/browse/CONTINUUM-2482'>CONTINUUM-2482</a>] - Replace the use of Thread.sleep to Selenium waitForCondition
+</li>
+</ul>
</body>
-</document>
\ No newline at end of file
+</document>
diff --git a/continuum-jetty/pom.xml b/continuum-jetty/pom.xml
index 02644b5..3f43b3f 100755
--- a/continuum-jetty/pom.xml
+++ b/continuum-jetty/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-jetty</artifactId>
<packaging>pom</packaging>
@@ -49,12 +49,7 @@
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-api-2.0</artifactId>
+ <artifactId>jsp-2.1-jetty</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -72,43 +67,6 @@
<artifactId>mail</artifactId>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>commons-el</groupId>
- <artifactId>commons-el</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler-jdt</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -122,7 +80,6 @@
<mainClass>org.mortbay.start.Main</mainClass>
<commandLineArguments>
<commandLineArgument>conf/jetty.xml</commandLineArgument>
- <commandLineArgument>conf/jetty-logging.xml</commandLineArgument>
</commandLineArguments>
<platforms>
<platform>jsw</platform>
@@ -145,17 +102,17 @@
</property>
<property>
<name>wrapper.logfile</name>
- <value>%CONTINUUM_BASE%/logs/wrapper.log</value>
+ <value>%CONTINUUM_BASE%/logs/wrapper.YYYYMMDD.log</value>
+ </property>
+ <property>
+ <name>wrapper.logfile.rollmode</name>
+ <value>DATE</value>
</property>
<property>
<name>wrapper.app.parameter.2</name>
<value>%CONTINUUM_BASE%/conf/jetty.xml</value>
</property>
<property>
- <name>wrapper.app.parameter.3</name>
- <value>%CONTINUUM_BASE%/conf/jetty-logging.xml</value>
- </property>
- <property>
<name>app.base.envvar</name>
<value>CONTINUUM_BASE</value>
</property>
diff --git a/continuum-jetty/src/main/conf/jetty-logging.xml b/continuum-jetty/src/main/conf/jetty-logging.xml
deleted file mode 100755
index 379bd13..0000000
--- a/continuum-jetty/src/main/conf/jetty-logging.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-<!--
- ~ 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.
- -->
-
-<!-- =============================================================== -->
-<!-- Configure stderr and stdout to a Jetty rollover log file -->
-<!-- this configuration file should be used in combination with -->
-<!-- other configuration files. e.g. -->
-<!-- java -jar start.jar etc/jetty-logging.xml etc/jetty.xml -->
-<!-- =============================================================== -->
-<Configure id="Server" class="org.mortbay.jetty.Server">
-
- <New id="ServerLog" class="java.io.PrintStream">
- <Arg>
- <New class="org.mortbay.util.RolloverFileOutputStream">
- <Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.stderrout.log</Arg>
- <Arg type="boolean">false</Arg>
- <Arg type="int">90</Arg>
- <Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
- <Get id="ServerLogName" name="datedFilename"/>
- </New>
- </Arg>
- </New>
-
- <Call class="org.mortbay.log.Log" name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
- <Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call>
- <Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call>
-
-</Configure>
-
-
-
diff --git a/continuum-model/pom.xml b/continuum-model/pom.xml
index 1734ad9..aaed688 100644
--- a/continuum-model/pom.xml
+++ b/continuum-model/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-model</artifactId>
@@ -39,33 +39,16 @@
<goal>java</goal>
<goal>stax-reader</goal>
<goal>stax-writer</goal>
- <goal>jpox-metadata-class</goal>
</goals>
</execution>
- <execution>
- <id>jpox-jdo-mapping</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>jpox-jdo-mapping-replication</id>
- <goals>
- <goal>jpox-jdo-mapping</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
- <replicationParameters>true</replicationParameters>
- </configuration>
- </execution>
</executions>
<configuration>
<version>1.4.0</version>
<packageWithVersion>false</packageWithVersion>
- <model>src/main/mdo/continuum.xml</model>
+ <models>
+ <model>src/main/mdo/continuum.xml</model>
+ </models>
+ <useJava5>true</useJava5>
</configuration>
</plugin>
<plugin>
@@ -79,6 +62,24 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <copy file="target/classes/META-INF/package.jdorepl" todir="target/classes" />
+ <copy file="target/classes/META-INF/package.jdo" todir="target/classes" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
diff --git a/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectGroupSummary.java b/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectGroupSummary.java
new file mode 100644
index 0000000..ae6f929
--- /dev/null
+++ b/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectGroupSummary.java
@@ -0,0 +1,112 @@
+package org.apache.continuum.model.project;
+
+/*
+ * 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.
+ */
+
+public class ProjectGroupSummary
+{
+ private int projectGroupId;
+
+ private int numberOfSuccesses;
+
+ private int numberOfFailures;
+
+ private int numberOfErrors;
+
+ private int numberOfProjects;
+
+ public ProjectGroupSummary()
+ {
+ }
+
+ public ProjectGroupSummary( int projectGroupId )
+ {
+ this.projectGroupId = projectGroupId;
+ }
+
+ public int getProjectGroupId()
+ {
+ return projectGroupId;
+ }
+
+ public void setProjectGroupId( int projectGroupId )
+ {
+ this.projectGroupId = projectGroupId;
+ }
+
+ public void setNumberOfSuccesses( int numberOfSuccesses )
+ {
+ this.numberOfSuccesses = numberOfSuccesses;
+ }
+
+ public int getNumberOfSuccesses()
+ {
+ return numberOfSuccesses;
+ }
+
+ public void setNumberOfFailures( int numberOfFailures )
+ {
+ this.numberOfFailures = numberOfFailures;
+ }
+
+ public int getNumberOfFailures()
+ {
+ return numberOfFailures;
+ }
+
+ public void setNumberOfErrors( int numberOfErrors )
+ {
+ this.numberOfErrors = numberOfErrors;
+ }
+
+ public int getNumberOfErrors()
+ {
+ return numberOfErrors;
+ }
+
+ public void setNumberOfProjects( int numberOfProjects )
+ {
+ this.numberOfProjects = numberOfProjects;
+ }
+
+ public int getNumberOfProjects()
+ {
+ return numberOfProjects;
+ }
+
+ public void addProjects( int projects )
+ {
+ this.numberOfProjects += projects;
+ }
+
+ public void addNumberOfSuccesses( int numberOfSuccesses )
+ {
+ this.numberOfSuccesses += numberOfSuccesses;
+ }
+
+ public void addNumberOfErrors( int numberOfErrors )
+ {
+ this.numberOfErrors += numberOfErrors;
+ }
+
+ public void addNumberOfFailures( int numberOfFailures )
+ {
+ this.numberOfFailures += numberOfFailures;
+ }
+}
diff --git a/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectSummaryResult.java b/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectSummaryResult.java
new file mode 100644
index 0000000..6858313
--- /dev/null
+++ b/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectSummaryResult.java
@@ -0,0 +1,68 @@
+package org.apache.continuum.model.project;
+
+/*
+ * 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.
+ */
+
+public class ProjectSummaryResult
+{
+ private int projectGroupId;
+
+ private int projectState;
+
+ private long size;
+
+ public ProjectSummaryResult( int projectGroupId, int projectState, long size )
+ {
+ this.projectGroupId = projectGroupId;
+
+ this.projectState = projectState;
+
+ this.size = size;
+ }
+
+ public int getProjectGroupId()
+ {
+ return projectGroupId;
+ }
+
+ public void setProjectGroupId( int projectGroupId )
+ {
+ this.projectGroupId = projectGroupId;
+ }
+
+ public int getProjectState()
+ {
+ return projectState;
+ }
+
+ public void setProjectState( int projectState )
+ {
+ this.projectState = projectState;
+ }
+
+ public long getSize()
+ {
+ return size;
+ }
+
+ public void setSize( long size )
+ {
+ this.size = size;
+ }
+}
diff --git a/continuum-model/src/main/java/org/apache/maven/continuum/model/project/ContinuumModelloMetadata.java b/continuum-model/src/main/java/org/apache/maven/continuum/model/project/ContinuumModelloMetadata.java
new file mode 100644
index 0000000..991eea2
--- /dev/null
+++ b/continuum-model/src/main/java/org/apache/maven/continuum/model/project/ContinuumModelloMetadata.java
@@ -0,0 +1,17 @@
+package org.apache.maven.continuum.model.project;
+
+public class ContinuumModelloMetadata
+{
+ private String modelVersion;
+
+ public String getModelVersion()
+ {
+ return modelVersion;
+ }
+
+ public void setModelVersion( String modelVersion )
+ {
+ this.modelVersion = modelVersion;
+ }
+}
+
diff --git a/continuum-model/src/main/mdo/continuum.xml b/continuum-model/src/main/mdo/continuum.xml
index be76d31..20ad914 100644
--- a/continuum-model/src/main/mdo/continuum.xml
+++ b/continuum-model/src/main/mdo/continuum.xml
@@ -317,12 +317,6 @@
<version>1.1.0+</version>
<type>String</type>
</field>
- <field>
- <name>checkedOutInSingleDirectory</name>
- <version>1.4.0+</version>
- <type>boolean</type>
- <defaultValue>false</defaultValue>
- </field>
<field jpox.mapped-by="project" jpox.fetch-groups="project-with-builds">
<name>buildResults</name>
<version>1.0.9+</version>
@@ -591,6 +585,11 @@
<version>1.0.9</version>
<type>int</type>
</field>
+ <field>
+ <name>username</name>
+ <version>1.4.0+</version>
+ <type>String</type>
+ </field>
<field jpox.column="resultstate">
<name>state</name>
<version>1.1.0+</version>
@@ -1031,7 +1030,13 @@
<description>
true if this buildDefinition is a template
</description>
- </field>
+ </field>
+ <field jpox.null-value="default">
+ <name>updatePolicy</name>
+ <version>1.4.0+</version>
+ <type>int</type>
+ <defaultValue>0</defaultValue>
+ </field>
</fields>
</class>
<class>
@@ -1646,6 +1651,11 @@
<version>1.1.2+</version>
<type>String</type>
</field>
+ <field>
+ <name>username</name>
+ <version>1.4.0+</version>
+ <type>String</type>
+ </field>
</fields>
</class>
diff --git a/continuum-model/src/main/resources/META-INF/package.jdo b/continuum-model/src/main/resources/META-INF/package.jdo
new file mode 100644
index 0000000..3444e72
--- /dev/null
+++ b/continuum-model/src/main/resources/META-INF/package.jdo
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.apache.continuum.model.project">
+ <class name="ProjectScmRoot" detachable="true" table="ProjectScmRoot" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="scmRootAddress" null-value="exception"/>
+ <field name="oldState"/>
+ <field name="state">
+ <column name="scmRootState"/>
+ </field>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.project">
+ <class name="ProjectGroup" detachable="true" table="ProjectGroup" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="groupId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="projects" mapped-by="projectGroup">
+ <collection element-type="Project" dependent-element="true"/>
+ </field>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="localRepository" default-fetch-group="true"/>
+ <fetch-group name="ProjectGroup_detail">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="projectgroup-projects">
+ <field name="projects"/>
+ </fetch-group>
+ <fetch-group name="project-with-scm-result">
+ <field name="projects"/>
+ </fetch-group>
+ </class>
+ <class name="Project" detachable="true" table="Project" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="executorId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="url">
+ <column length="256"/>
+ </field>
+ <field name="scmUrl">
+ <column length="256"/>
+ </field>
+ <field name="scmTag"/>
+ <field name="scmUsername"/>
+ <field name="scmPassword"/>
+ <field name="scmUseCache"/>
+ <field name="version"/>
+ <field name="state">
+ <column name="projectstate"/>
+ </field>
+ <field name="oldState"/>
+ <field name="latestBuildId"/>
+ <field name="buildNumber"/>
+ <field name="workingDirectory">
+ <column length="256"/>
+ </field>
+ <field name="relativePath"/>
+ <field name="buildResults" mapped-by="project">
+ <collection element-type="BuildResult" dependent-element="true"/>
+ </field>
+ <field name="checkoutResult" dependent="true"/>
+ <field name="developers">
+ <collection element-type="ProjectDeveloper" dependent-element="true"/>
+ </field>
+ <field name="parent" dependent="true"/>
+ <field name="dependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="Project_detail">
+ <field name="buildResults"/>
+ <field name="checkoutResult"/>
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-all-details">
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-with-builds">
+ <field name="buildResults"/>
+ </fetch-group>
+ <fetch-group name="project-dependencies">
+ <field name="parent"/>
+ <field name="dependencies"/>
+ </fetch-group>
+ <fetch-group name="project-with-checkout-result">
+ <field name="checkoutResult"/>
+ </fetch-group>
+ </class>
+ <class name="ProjectNotifier" detachable="true" table="ProjectNotifier" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="type">
+ <column name="notifiertype"/>
+ </field>
+ <field name="from">
+ <column name="notifierorigin"/>
+ </field>
+ <field name="enabled"/>
+ <field name="recipientType"/>
+ <field name="sendOnSuccess"/>
+ <field name="sendOnFailure"/>
+ <field name="sendOnError"/>
+ <field name="sendOnWarning"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ <field name="sendOnScmFailure"/>
+ </class>
+ <class name="ProjectDeveloper" detachable="true" table="ProjectDeveloper">
+ <field name="scmId"/>
+ <field name="name"/>
+ <field name="email"/>
+ <field name="continuumId"/>
+ </class>
+ <class name="ProjectDependency" detachable="true" table="ProjectDependency">
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="version"/>
+ </class>
+ <class name="BuildResult" detachable="true" table="BuildResult" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="project" default-fetch-group="true"/>
+ <field name="buildDefinition" default-fetch-group="true"/>
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="buildNumber"/>
+ <field name="state">
+ <column name="resultstate"/>
+ </field>
+ <field name="trigger">
+ <column name="resulttrigger"/>
+ </field>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="success"/>
+ <field name="exitCode"/>
+ <field name="scmResult" dependent="true"/>
+ <field name="modifiedDependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="lastChangedDate" null-value="default">
+ <column default-value="0"/>
+ </field>
+ <field name="buildUrl" null-value="default">
+ <column default-value=""/>
+ </field>
+ <fetch-group name="BuildResult_detail">
+ <field name="scmResult"/>
+ <field name="modifiedDependencies"/>
+ </fetch-group>
+ <fetch-group name="build-result-with-details">
+ <field name="scmResult"/>
+ <field name="modifiedDependencies"/>
+ </fetch-group>
+ </class>
+ <class name="BuildDefinition" detachable="true" table="BuildDefinition" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+ <field name="defaultForProject"/>
+ <field name="goals"/>
+ <field name="arguments"/>
+ <field name="buildFile"/>
+ <field name="buildFresh"/>
+ <field name="description"/>
+ <field name="type">
+ <column name="builddefinition_type"/>
+ </field>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="profile" default-fetch-group="true"/>
+ <field name="alwaysBuild"/>
+ <field name="template">
+ <column name="is_template"/>
+ </field>
+ </class>
+ <class name="BuildDefinitionTemplate" detachable="true" table="BuildDefinitionTemplate" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="name" null-value="exception"/>
+ <field name="continuumDefault"/>
+ <field name="type">
+ <column name="builddefinition_template_type"/>
+ </field>
+ <field name="buildDefinitions" default-fetch-group="true">
+ <collection element-type="BuildDefinition" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="build-template-build-definitions">
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ </class>
+ <class name="BuildQueue" detachable="true" table="BuildQueue" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="name" null-value="exception">
+ <column default-value=""/>
+ </field>
+ </class>
+ <class name="Schedule" detachable="true" table="Schedule" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="delay">
+ <column name="scheduledelay"/>
+ </field>
+ <field name="maxJobExecutionTime"/>
+ <field name="cronExpression"/>
+ <field name="buildQueues" default-fetch-group="true">
+ <collection element-type="BuildQueue" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="schedule-build-queues">
+ <field name="buildQueues"/>
+ </fetch-group>
+ </class>
+ <class name="ContinuumModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="1.3.3"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.system">
+ <class name="Profile" detachable="true" table="profiles" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="scmMode"/>
+ <field name="buildWithoutChanges"/>
+ <field name="buildAgentGroup" null-value="default">
+ <column default-value=""/>
+ </field>
+ <field name="jdk" default-fetch-group="true"/>
+ <field name="builder" default-fetch-group="true"/>
+ <field name="environmentVariables" default-fetch-group="true">
+ <collection element-type="Installation" dependent-element="false"/>
+ <join/>
+ </field>
+ </class>
+ <class name="Installation" detachable="true" table="Installation" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="type">
+ <column name="installationtype"/>
+ </field>
+ <field name="varValue"/>
+ <field name="varName"/>
+ <field name="name"/>
+ <field name="installationId" primary-key="true" value-strategy="native"/>
+ </class>
+ <class name="SystemConfiguration" detachable="true" table="SystemConfiguration">
+ <field name="guestAccountEnabled"/>
+ <field name="defaultScheduleDescription"/>
+ <field name="defaultScheduleCronExpression"/>
+ <field name="workingDirectory"/>
+ <field name="buildOutputDirectory"/>
+ <field name="deploymentRepositoryDirectory"/>
+ <field name="baseUrl"/>
+ <field name="initialized"/>
+ <field name="releaseOutputDirectory"/>
+ <field name="numberOfBuildsInParallel" null-value="default">
+ <column default-value="1"/>
+ </field>
+ <field name="distributedBuildEnabled"/>
+ </class>
+ <class name="NotificationAddress" detachable="true" table="NotificationAddress">
+ <field name="type">
+ <column name="notifiertype"/>
+ </field>
+ <field name="address"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.continuum.model.release">
+ <class name="ContinuumReleaseResult" detachable="true" table="ContinuumReleaseResult" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="resultCode"/>
+ <field name="projectGroup" default-fetch-group="true"/>
+ <field name="project" default-fetch-group="true"/>
+ <field name="releaseGoal"/>
+ </class>
+ </package>
+ <package name="org.apache.continuum.model.repository">
+ <class name="LocalRepository" detachable="true" table="LocalRepository" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="name" null-value="exception"/>
+ <field name="location" null-value="exception">
+ <column name="repoLocation"/>
+ </field>
+ <field name="layout"/>
+ </class>
+ <class name="AbstractPurgeConfiguration" detachable="true" table="AbstractPurgeConfiguration" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+ <field name="id" primary-key="true" value-strategy="native"/>
+ <field name="description"/>
+ <field name="deleteAll"/>
+ <field name="retentionCount"/>
+ <field name="daysOlder"/>
+ <field name="enabled"/>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="defaultPurge"/>
+ </class>
+ <class name="RepositoryPurgeConfiguration" persistence-capable-superclass="org.apache.continuum.model.repository.AbstractPurgeConfiguration" detachable="true" table="RepositoryPurgeConfiguration">
+ <inheritance strategy="new-table"/>
+ <field name="repository" null-value="exception" default-fetch-group="true"/>
+ <field name="deleteReleasedSnapshots"/>
+ </class>
+ <class name="DirectoryPurgeConfiguration" persistence-capable-superclass="org.apache.continuum.model.repository.AbstractPurgeConfiguration" detachable="true" table="DirectoryPurgeConfiguration">
+ <inheritance strategy="new-table"/>
+ <field name="location" null-value="exception">
+ <column name="directoryLocation"/>
+ </field>
+ <field name="directoryType"/>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.scm">
+ <class name="ScmResult" detachable="true" table="ScmResult">
+ <field name="success"/>
+ <field name="commandLine">
+ <column length="1024"/>
+ </field>
+ <field name="providerMessage">
+ <column length="1024"/>
+ </field>
+ <field name="commandOutput">
+ <column length="1024"/>
+ </field>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ <field name="changes" default-fetch-group="true">
+ <collection element-type="ChangeSet" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeSet" detachable="true" table="ChangeSet">
+ <field name="id"/>
+ <field name="author"/>
+ <field name="comment">
+ <column name="changecomment" length="8192"/>
+ </field>
+ <field name="date">
+ <column name="changedate"/>
+ </field>
+ <field name="files" default-fetch-group="true">
+ <collection element-type="ChangeFile" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeFile" detachable="true" table="ChangeFile">
+ <field name="name">
+ <column length="1024"/>
+ </field>
+ <field name="revision"/>
+ <field name="status"/>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-model/src/main/resources/META-INF/package.jdorepl b/continuum-model/src/main/resources/META-INF/package.jdorepl
new file mode 100644
index 0000000..50b02b1
--- /dev/null
+++ b/continuum-model/src/main/resources/META-INF/package.jdorepl
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+ "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+ <package name="org.apache.continuum.model.project">
+ <class name="ProjectScmRoot" detachable="true" table="ProjectScmRoot" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="scmRootAddress" null-value="exception"/>
+ <field name="oldState"/>
+ <field name="state">
+ <column name="scmRootState"/>
+ </field>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.project">
+ <class name="ProjectGroup" detachable="true" table="ProjectGroup" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="groupId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="projects" mapped-by="projectGroup">
+ <collection element-type="Project" dependent-element="true"/>
+ </field>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="localRepository" default-fetch-group="true"/>
+ <fetch-group name="ProjectGroup_detail">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="projects"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="projectgroup-projects">
+ <field name="projects"/>
+ </fetch-group>
+ <fetch-group name="project-with-scm-result">
+ <field name="projects"/>
+ </fetch-group>
+ </class>
+ <class name="Project" detachable="true" table="Project" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="executorId"/>
+ <field name="name"/>
+ <field name="description">
+ <column length="8192"/>
+ </field>
+ <field name="url">
+ <column length="256"/>
+ </field>
+ <field name="scmUrl">
+ <column length="256"/>
+ </field>
+ <field name="scmTag"/>
+ <field name="scmUsername"/>
+ <field name="scmPassword"/>
+ <field name="scmUseCache"/>
+ <field name="version"/>
+ <field name="state">
+ <column name="projectstate"/>
+ </field>
+ <field name="oldState"/>
+ <field name="latestBuildId"/>
+ <field name="buildNumber"/>
+ <field name="workingDirectory">
+ <column length="256"/>
+ </field>
+ <field name="relativePath"/>
+ <field name="buildResults" mapped-by="project">
+ <collection element-type="BuildResult" dependent-element="true"/>
+ </field>
+ <field name="checkoutResult" dependent="true"/>
+ <field name="developers">
+ <collection element-type="ProjectDeveloper" dependent-element="true"/>
+ </field>
+ <field name="parent" dependent="true"/>
+ <field name="dependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+ <field name="notifiers">
+ <collection element-type="ProjectNotifier" dependent-element="true"/>
+ <join/>
+ </field>
+ <field name="buildDefinitions">
+ <collection element-type="BuildDefinition" dependent-element="true"/>
+ <join/>
+ </field>
+ <fetch-group name="Project_detail">
+ <field name="buildResults"/>
+ <field name="checkoutResult"/>
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-all-details">
+ <field name="developers"/>
+ <field name="parent"/>
+ <field name="dependencies"/>
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-build-details">
+ <field name="notifiers"/>
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ <fetch-group name="project-with-builds">
+ <field name="buildResults"/>
+ </fetch-group>
+ <fetch-group name="project-dependencies">
+ <field name="parent"/>
+ <field name="dependencies"/>
+ </fetch-group>
+ <fetch-group name="project-with-checkout-result">
+ <field name="checkoutResult"/>
+ </fetch-group>
+ </class>
+ <class name="ProjectNotifier" detachable="true" table="ProjectNotifier" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="type">
+ <column name="notifiertype"/>
+ </field>
+ <field name="from">
+ <column name="notifierorigin"/>
+ </field>
+ <field name="enabled"/>
+ <field name="recipientType"/>
+ <field name="sendOnSuccess"/>
+ <field name="sendOnFailure"/>
+ <field name="sendOnError"/>
+ <field name="sendOnWarning"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ <field name="sendOnScmFailure"/>
+ </class>
+ <class name="ProjectDeveloper" detachable="true" table="ProjectDeveloper">
+ <field name="scmId"/>
+ <field name="name"/>
+ <field name="email"/>
+ <field name="continuumId"/>
+ </class>
+ <class name="ProjectDependency" detachable="true" table="ProjectDependency">
+ <field name="groupId"/>
+ <field name="artifactId"/>
+ <field name="version"/>
+ </class>
+ <class name="BuildResult" detachable="true" table="BuildResult" identity-type="application">
+ <field name="project" default-fetch-group="true"/>
+ <field name="buildDefinition" default-fetch-group="true"/>
+ <field name="id" primary-key="true"/>
+ <field name="buildNumber"/>
+ <field name="state">
+ <column name="resultstate"/>
+ </field>
+ <field name="trigger">
+ <column name="resulttrigger"/>
+ </field>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="error">
+ <column length="8192"/>
+ </field>
+ <field name="success"/>
+ <field name="exitCode"/>
+ <field name="scmResult" dependent="true"/>
+ <field name="modifiedDependencies">
+ <collection element-type="ProjectDependency" dependent-element="true"/>
+ </field>
+ <field name="lastChangedDate" null-value="default">
+ <column default-value="0"/>
+ </field>
+ <field name="buildUrl" null-value="default">
+ <column default-value=""/>
+ </field>
+ <fetch-group name="BuildResult_detail">
+ <field name="scmResult"/>
+ <field name="modifiedDependencies"/>
+ </fetch-group>
+ <fetch-group name="build-result-with-details">
+ <field name="scmResult"/>
+ <field name="modifiedDependencies"/>
+ </fetch-group>
+ </class>
+ <class name="BuildDefinition" detachable="true" table="BuildDefinition" identity-type="application">
+ <field name="id" null-value="exception" primary-key="true"/>
+ <field name="defaultForProject"/>
+ <field name="goals"/>
+ <field name="arguments"/>
+ <field name="buildFile"/>
+ <field name="buildFresh"/>
+ <field name="description"/>
+ <field name="type">
+ <column name="builddefinition_type"/>
+ </field>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="profile" default-fetch-group="true"/>
+ <field name="alwaysBuild"/>
+ <field name="template">
+ <column name="is_template"/>
+ </field>
+ </class>
+ <class name="BuildDefinitionTemplate" detachable="true" table="BuildDefinitionTemplate" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="name" null-value="exception"/>
+ <field name="continuumDefault"/>
+ <field name="type">
+ <column name="builddefinition_template_type"/>
+ </field>
+ <field name="buildDefinitions" default-fetch-group="true">
+ <collection element-type="BuildDefinition" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="build-template-build-definitions">
+ <field name="buildDefinitions"/>
+ </fetch-group>
+ </class>
+ <class name="BuildQueue" detachable="true" table="BuildQueue" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="name" null-value="exception">
+ <column default-value=""/>
+ </field>
+ </class>
+ <class name="Schedule" detachable="true" table="Schedule" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="delay">
+ <column name="scheduledelay"/>
+ </field>
+ <field name="maxJobExecutionTime"/>
+ <field name="cronExpression"/>
+ <field name="buildQueues" default-fetch-group="true">
+ <collection element-type="BuildQueue" dependent-element="false"/>
+ <join/>
+ </field>
+ <fetch-group name="schedule-build-queues">
+ <field name="buildQueues"/>
+ </fetch-group>
+ </class>
+ <class name="ContinuumModelloMetadata" detachable="true">
+ <field name="modelVersion" null-value="default">
+ <column default-value="1.3.3"/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.system">
+ <class name="Profile" detachable="true" table="profiles" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="active"/>
+ <field name="name"/>
+ <field name="description"/>
+ <field name="scmMode"/>
+ <field name="buildWithoutChanges"/>
+ <field name="buildAgentGroup" null-value="default">
+ <column default-value=""/>
+ </field>
+ <field name="jdk" default-fetch-group="true"/>
+ <field name="builder" default-fetch-group="true"/>
+ <field name="environmentVariables" default-fetch-group="true">
+ <collection element-type="Installation" dependent-element="false"/>
+ <join/>
+ </field>
+ </class>
+ <class name="Installation" detachable="true" table="Installation" identity-type="application">
+ <field name="type">
+ <column name="installationtype"/>
+ </field>
+ <field name="varValue"/>
+ <field name="varName"/>
+ <field name="name"/>
+ <field name="installationId" primary-key="true"/>
+ </class>
+ <class name="SystemConfiguration" detachable="true" table="SystemConfiguration">
+ <field name="guestAccountEnabled"/>
+ <field name="defaultScheduleDescription"/>
+ <field name="defaultScheduleCronExpression"/>
+ <field name="workingDirectory"/>
+ <field name="buildOutputDirectory"/>
+ <field name="deploymentRepositoryDirectory"/>
+ <field name="baseUrl"/>
+ <field name="initialized"/>
+ <field name="releaseOutputDirectory"/>
+ <field name="numberOfBuildsInParallel" null-value="default">
+ <column default-value="1"/>
+ </field>
+ <field name="distributedBuildEnabled"/>
+ </class>
+ <class name="NotificationAddress" detachable="true" table="NotificationAddress">
+ <field name="type">
+ <column name="notifiertype"/>
+ </field>
+ <field name="address"/>
+ <field name="configuration" default-fetch-group="true">
+ <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+ <join/>
+ </field>
+ </class>
+ </package>
+ <package name="org.apache.continuum.model.release">
+ <class name="ContinuumReleaseResult" detachable="true" table="ContinuumReleaseResult" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="startTime"/>
+ <field name="endTime"/>
+ <field name="resultCode"/>
+ <field name="projectGroup" default-fetch-group="true"/>
+ <field name="project" default-fetch-group="true"/>
+ <field name="releaseGoal"/>
+ </class>
+ </package>
+ <package name="org.apache.continuum.model.repository">
+ <class name="LocalRepository" detachable="true" table="LocalRepository" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="name" null-value="exception"/>
+ <field name="location" null-value="exception">
+ <column name="repoLocation"/>
+ </field>
+ <field name="layout"/>
+ </class>
+ <class name="AbstractPurgeConfiguration" detachable="true" table="AbstractPurgeConfiguration" identity-type="application">
+ <field name="id" primary-key="true"/>
+ <field name="description"/>
+ <field name="deleteAll"/>
+ <field name="retentionCount"/>
+ <field name="daysOlder"/>
+ <field name="enabled"/>
+ <field name="schedule" default-fetch-group="true"/>
+ <field name="defaultPurge"/>
+ </class>
+ <class name="RepositoryPurgeConfiguration" persistence-capable-superclass="org.apache.continuum.model.repository.AbstractPurgeConfiguration" detachable="true" table="RepositoryPurgeConfiguration">
+ <inheritance strategy="new-table"/>
+ <field name="repository" null-value="exception" default-fetch-group="true"/>
+ <field name="deleteReleasedSnapshots"/>
+ </class>
+ <class name="DirectoryPurgeConfiguration" persistence-capable-superclass="org.apache.continuum.model.repository.AbstractPurgeConfiguration" detachable="true" table="DirectoryPurgeConfiguration">
+ <inheritance strategy="new-table"/>
+ <field name="location" null-value="exception">
+ <column name="directoryLocation"/>
+ </field>
+ <field name="directoryType"/>
+ </class>
+ </package>
+ <package name="org.apache.maven.continuum.model.scm">
+ <class name="ScmResult" detachable="true" table="ScmResult">
+ <field name="success"/>
+ <field name="commandLine">
+ <column length="1024"/>
+ </field>
+ <field name="providerMessage">
+ <column length="1024"/>
+ </field>
+ <field name="commandOutput">
+ <column length="1024"/>
+ </field>
+ <field name="exception">
+ <column name="exceptionstring" length="8192"/>
+ </field>
+ <field name="changes" default-fetch-group="true">
+ <collection element-type="ChangeSet" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeSet" detachable="true" table="ChangeSet">
+ <field name="id"/>
+ <field name="author"/>
+ <field name="comment">
+ <column name="changecomment" length="8192"/>
+ </field>
+ <field name="date">
+ <column name="changedate"/>
+ </field>
+ <field name="files" default-fetch-group="true">
+ <collection element-type="ChangeFile" dependent-element="true"/>
+ </field>
+ </class>
+ <class name="ChangeFile" detachable="true" table="ChangeFile">
+ <field name="name">
+ <column length="1024"/>
+ </field>
+ <field name="revision"/>
+ <field name="status"/>
+ </class>
+ </package>
+</jdo>
diff --git a/continuum-model/src/main/resources/package-default.orm b/continuum-model/src/main/resources/package-default.orm
index 5e9064b..6b00547 100644
--- a/continuum-model/src/main/resources/package-default.orm
+++ b/continuum-model/src/main/resources/package-default.orm
@@ -17,11 +17,4 @@
</field>
</class>
</package>
- <package name="org.apache.maven.continuum.model.project">
- <class name="Project">
- <field name="checkedOutInSingleDirectory" null-value="default">
- <column jdbc-type="CHAR" default-value="N" />
- </field>
- </class>
- </package>
</orm>
diff --git a/continuum-notifiers/continuum-notifier-api/pom.xml b/continuum-notifiers/continuum-notifier-api/pom.xml
index 42c82e5..8ba45c6 100644
--- a/continuum-notifiers/continuum-notifier-api/pom.xml
+++ b/continuum-notifiers/continuum-notifier-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-notifiers</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifier-api</artifactId>
diff --git a/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java b/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
index 43d5fd0..2889923 100644
--- a/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
+++ b/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
@@ -49,6 +49,8 @@
public static final String COMMITTER_FIELD = "committers";
+ public static final String DEVELOPER_FIELD = "developers";
+
private static final Logger log = LoggerFactory.getLogger( AbstractContinuumNotifier.class );
@Resource
diff --git a/continuum-notifiers/continuum-notifier-irc/pom.xml b/continuum-notifiers/continuum-notifier-irc/pom.xml
index 3c9594f..ce334ff 100644
--- a/continuum-notifiers/continuum-notifier-irc/pom.xml
+++ b/continuum-notifiers/continuum-notifier-irc/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-notifiers</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifier-irc</artifactId>
diff --git a/continuum-notifiers/continuum-notifier-jabber/pom.xml b/continuum-notifiers/continuum-notifier-jabber/pom.xml
index 81bb715..5b30092 100644
--- a/continuum-notifiers/continuum-notifier-jabber/pom.xml
+++ b/continuum-notifiers/continuum-notifier-jabber/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-notifiers</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifier-jabber</artifactId>
diff --git a/continuum-notifiers/continuum-notifier-msn/pom.xml b/continuum-notifiers/continuum-notifier-msn/pom.xml
index 1fb058b..987323f 100644
--- a/continuum-notifiers/continuum-notifier-msn/pom.xml
+++ b/continuum-notifiers/continuum-notifier-msn/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-notifiers</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifier-msn</artifactId>
diff --git a/continuum-notifiers/continuum-notifier-wagon/pom.xml b/continuum-notifiers/continuum-notifier-wagon/pom.xml
index 0922a61..43aeeb9 100644
--- a/continuum-notifiers/continuum-notifier-wagon/pom.xml
+++ b/continuum-notifiers/continuum-notifier-wagon/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum-notifiers</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifier-wagon</artifactId>
diff --git a/continuum-notifiers/pom.xml b/continuum-notifiers/pom.xml
index 57a4454..4b751b8 100644
--- a/continuum-notifiers/pom.xml
+++ b/continuum-notifiers/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-notifiers</artifactId>
diff --git a/continuum-purge/pom.xml b/continuum-purge/pom.xml
index a7fc26a..0a80f25 100644
--- a/continuum-purge/pom.xml
+++ b/continuum-purge/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-purge</artifactId>
<name>Continuum :: Purge System</name>
@@ -134,12 +134,21 @@
<executions>
<execution>
<id>generate</id>
+ <phase>generate-resources</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>merge</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <descriptors>
+ <descriptor>${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml</descriptor>
+ <descriptor>${project.build.outputDirectory}/META-INF/plexus/components.xml</descriptor>
+ </descriptors>
+ <output>${project.build.outputDirectory}/META-INF/plexus/components.xml</output>
+ </configuration>
<goals>
<goal>merge-descriptors</goal>
</goals>
diff --git a/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java b/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
index 765b0a3..8c8da38 100644
--- a/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
+++ b/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
@@ -209,6 +209,11 @@
{
return directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsBySchedule( scheduleId );
}
+
+ public List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId )
+ {
+ return directoryPurgeConfigurationDao.getEnableDirectoryPurgeConfigurationsBySchedule( scheduleId );
+ }
public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository( int repositoryId )
{
@@ -219,6 +224,11 @@
{
return repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsBySchedule( scheduleId );
}
+
+ public List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId )
+ {
+ return repositoryPurgeConfigurationDao.getEnableRepositoryPurgeConfigurationsBySchedule( scheduleId );
+ }
public void removeDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfig )
throws PurgeConfigurationServiceException
diff --git a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
index bc4f543..1d53abc 100644
--- a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
+++ b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
@@ -38,8 +38,8 @@
public abstract class AbstractContinuumPurgeExecutor
implements ContinuumPurgeExecutor
{
- private Logger log = LoggerFactory.getLogger( AbstractContinuumPurgeExecutor.class );
-
+ private static final Logger log = LoggerFactory.getLogger( AbstractContinuumPurgeExecutor.class );
+
public void purge( Set<ArtifactReference> references, RepositoryManagedContent repository )
{
if ( references != null && !references.isEmpty() )
diff --git a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
index fa11267..aa2cdeb 100644
--- a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
+++ b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
@@ -151,8 +151,8 @@
{
try
{
- FileUtils.deleteDirectory( buildDir );
log.info( ContinuumPurgeConstants.PURGE_DIR_CONTENTS + " - " + buildDir.getName() );
+ FileUtils.deleteDirectory( buildDir );
File logFile = new File( buildDir.getAbsoluteFile() + ".log.txt" );
if ( logFile.exists() )
diff --git a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
index 74c86ae..c2e094c 100644
--- a/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
+++ b/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
@@ -25,6 +25,11 @@
import java.util.List;
import org.apache.continuum.purge.ContinuumPurgeConstants;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
import org.apache.maven.archiva.common.utils.VersionComparator;
import org.apache.maven.archiva.common.utils.VersionUtil;
diff --git a/continuum-purge/src/main/resources/META-INF/plexus/components.xml b/continuum-purge/src/main/resources/META-INF/plexus/components-fragment.xml
similarity index 100%
rename from continuum-purge/src/main/resources/META-INF/plexus/components.xml
rename to continuum-purge/src/main/resources/META-INF/plexus/components-fragment.xml
diff --git a/continuum-release/pom.xml b/continuum-release/pom.xml
index e7a8e4f..62e9e4f 100644
--- a/continuum-release/pom.xml
+++ b/continuum-release/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-release</artifactId>
<name>Continuum :: Release System</name>
@@ -121,7 +121,8 @@
<models>
<model>src/main/mdo/prepared-releases.mdo</model>
</models>
- <version>1.0.0</version>
+ <version>1.4.0</version>
+ <useJava5>true</useJava5>
</configuration>
<executions>
<execution>
diff --git a/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java b/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
index 650753a..72f93b5 100644
--- a/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
+++ b/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
@@ -82,6 +82,7 @@
releaseDescriptor.setAdditionalArguments( properties.getProperty( "exec.additionalArguments" ) );
releaseDescriptor.setPomFileName( properties.getProperty( "exec.pomFileName" ) );
releaseDescriptor.setPreparationGoals( properties.getProperty( "preparationGoals" ) );
+ releaseDescriptor.setExecutable( properties.getProperty( "build.executable" ) );
loadResolvedDependencies( properties, releaseDescriptor );
@@ -247,6 +248,12 @@
processResolvedDependencies( properties, config.getResolvedSnapshotDependencies() );
}
+ // executables
+ if ( config.getExecutable() != null )
+ {
+ properties.setProperty( "build.executable", config.getExecutable() );
+ }
+
OutputStream outStream = null;
//noinspection OverlyBroadCatchBlock
try
diff --git a/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java b/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
index 6f555bd..908bf7a 100644
--- a/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
+++ b/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
@@ -75,7 +75,7 @@
executable = ( (ContinuumReleaseDescriptor) releaseDescriptor).getExecutable();
}
shellCommandHelper.executeGoals( determineWorkingDirectory( workingDirectory,
- releaseDescriptor.getScmRelativePathProjectDirectory(), releaseDescriptor.getRootProjectPath() ),
+ releaseDescriptor.getScmRelativePathProjectDirectory() ),
executable, goals, releaseDescriptor.isInteractive(), additionalArguments, result,
environments );
}
diff --git a/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java b/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
index b0d94b6..bf37784 100644
--- a/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
+++ b/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
@@ -41,6 +41,7 @@
import org.codehaus.plexus.taskqueue.Task;
import org.codehaus.plexus.taskqueue.TaskQueue;
import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.util.StringUtils;
/**
* @author Jason van Zyl
@@ -252,8 +253,17 @@
if ( repository != null )
{
- descriptor.setAdditionalArguments( descriptor.getAdditionalArguments() + " \"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
- //descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
+ String args = descriptor.getAdditionalArguments();
+
+ if ( StringUtils.isNotEmpty( args ) )
+ {
+ descriptor.setAdditionalArguments( args +
+ " \"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
+ }
+ else
+ {
+ descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
+ }
}
//other properties
diff --git a/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java b/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
index c742dd1..27395dd 100644
--- a/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
+++ b/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
@@ -43,6 +43,8 @@
private String error;
private int state;
+
+ private String username;
public void goalStart( String name, List phases )
{
@@ -110,4 +112,14 @@
{
return state;
}
+
+ public void setUsername( String username )
+ {
+ this.username = username;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
}
diff --git a/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java b/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
index ab98720..8166c40 100644
--- a/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
+++ b/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
@@ -41,7 +41,6 @@
import org.apache.maven.shared.release.ReleaseManagerListener;
import org.apache.maven.shared.release.ReleaseResult;
import org.apache.maven.shared.release.config.ReleaseDescriptor;
-import org.apache.maven.shared.release.util.ReleaseUtil;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.context.Context;
@@ -84,30 +83,7 @@
repository = performTask.getLocalRepository();
- List reactorProjects = null;
- MavenProject mavenProject = null;
-
- try
- {
- mavenProject = getMavenProject( performTask );
- if( mavenProject != null )
- {
- descriptor.setRootProjectPath( ReleaseUtil.getRootProjectPath( mavenProject ) );
- reactorProjects = getReactorProjects( descriptor, mavenProject );
- }
- }
- catch ( ContinuumReleaseException e )
- {
- ReleaseResult result = createReleaseResult();
-
- result.appendError( e );
-
- continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result );
-
- performTask.getListener().error( e.getMessage() );
-
- throw new TaskExecutionException( "Failed to build reactor projects.", e );
- }
+ List<MavenProject> reactorProjects = getReactorProjects( performTask );
ReleaseResult result = releaseManager.performWithResult( descriptor, settings, reactorProjects, listener );
@@ -122,17 +98,61 @@
continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result );
}
+ protected List<MavenProject> getReactorProjects( PerformReleaseProjectTask releaseTask )
+ throws TaskExecutionException
+ {
+ List<MavenProject> reactorProjects;
+ ReleaseDescriptor descriptor = releaseTask.getDescriptor();
+
+ if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
+ {
+ //Perform with provided release parameters (CONTINUUM-1541)
+ descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath() );
+ return null;
+ }
+
+ try
+ {
+ reactorProjects = getReactorProjects( descriptor );
+ }
+ catch ( ContinuumReleaseException e )
+ {
+ ReleaseResult result = createReleaseResult();
+
+ result.appendError( e );
+
+ continuumReleaseManager.getReleaseResults().put( releaseTask.getReleaseId(), result );
+
+ releaseTask.getListener().error( e.getMessage() );
+
+ throw new TaskExecutionException( "Failed to build reactor projects.", e );
+ }
+
+ return reactorProjects;
+ }
+
/**
* @todo remove and use generate-reactor-projects phase
*/
- protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor, MavenProject project )
+ protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor )
throws ContinuumReleaseException
{
List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
-
- reactorProjects.add( project );
- addModules( reactorProjects, project );
+ MavenProject project;
+ try
+ {
+ project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
+ getProfileManager( settings ) );
+
+ reactorProjects.add( project );
+
+ addModules( reactorProjects, project );
+ }
+ catch ( ProjectBuildingException e )
+ {
+ throw new ContinuumReleaseException( "Failed to build project.", e );
+ }
try
{
@@ -218,30 +238,4 @@
{
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
-
- protected MavenProject getMavenProject( PerformReleaseProjectTask releaseTask )
- throws ContinuumReleaseException
- {
- ReleaseDescriptor descriptor = releaseTask.getDescriptor();
-
- if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
- {
- //Perform with provided release parameters (CONTINUUM-1541)
- descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath() );
- return null;
- }
-
- MavenProject project;
- try
- {
- project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
- getProfileManager( settings ) );
- }
- catch ( ProjectBuildingException e )
- {
- throw new ContinuumReleaseException( "Failed to build project.", e );
- }
-
- return project;
- }
}
diff --git a/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java b/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
index 588e618..cf6f77f 100644
--- a/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
+++ b/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
@@ -27,8 +27,6 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.continuum.release.ContinuumReleaseException;
import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.profiles.ProfileManager;
@@ -119,7 +117,7 @@
{
ArtifactRepository repository = getLocalRepository( descriptor.getAdditionalArguments() );
- project = projectBuilder.buildWithDependencies( getProjectDescriptorFile( descriptor ), repository,
+ project = projectBuilder.build( getProjectDescriptorFile( descriptor ), repository,
getProfileManager( getSettings() ) );
reactorProjects.add( project );
@@ -130,14 +128,6 @@
{
throw new ContinuumReleaseException( "Failed to build project.", e );
}
- catch ( ArtifactNotFoundException e )
- {
- throw new ContinuumReleaseException( "Failed to build project.", e );
- }
- catch ( ArtifactResolutionException e )
- {
- throw new ContinuumReleaseException( "Failed to build project.", e );
- }
try
{
@@ -167,7 +157,7 @@
try
{
MavenProject reactorProject =
- projectBuilder.buildWithDependencies( pomFile, repository, getProfileManager( getSettings() ) );
+ projectBuilder.build( pomFile, repository, getProfileManager( getSettings() ) );
reactorProjects.add( reactorProject );
@@ -177,14 +167,6 @@
{
throw new ContinuumReleaseException( "Failed to build project.", e );
}
- catch ( ArtifactNotFoundException e )
- {
- throw new ContinuumReleaseException( "Failed to build project.", e );
- }
- catch ( ArtifactResolutionException e )
- {
- throw new ContinuumReleaseException( "Failed to build project.", e );
- }
}
}
@@ -205,49 +187,45 @@
throws ContinuumReleaseException
{
String localRepository = null;
+ boolean found = false;
if ( arguments != null )
{
String[] args = arguments.split( " " );
-
- boolean shouldContinue = false;
-
+
for ( String arg : args )
{
if ( arg.contains( "-Dmaven.repo.local=" ) )
{
localRepository = arg.substring( arg.indexOf( "=" ) + 1 );
- if ( !localRepository.endsWith( "\"" ) )
+ if ( localRepository.endsWith( "\"" ) )
{
- shouldContinue = true;
- continue;
- }
- else
- {
+ localRepository = localRepository.substring( 0, localRepository.indexOf( "\"" ) );
break;
}
+
+ found = true;
+ continue;
}
- else if ( shouldContinue )
+
+ if ( found )
{
localRepository += " " + arg;
- if ( arg.endsWith( "\"" ) )
+ if ( localRepository.endsWith( "\"" ) )
{
+ localRepository = localRepository.substring( 0, localRepository.indexOf( "\"" ) );
break;
}
}
}
}
-
+
if ( localRepository == null )
{
localRepository = getSettings().getLocalRepository();
}
- else if ( localRepository.endsWith( "\"" ) )
- {
- localRepository = localRepository.substring( 0, localRepository.indexOf( "\"" ) );
- }
return new DefaultArtifactRepository( "local-repository", "file://" + localRepository,
new DefaultRepositoryLayout() );
diff --git a/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java b/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
index b614f65..06726d3 100644
--- a/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
+++ b/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
@@ -22,6 +22,7 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.manager.NoSuchScmProviderException;
import org.apache.maven.scm.provider.ScmProvider;
@@ -82,11 +83,26 @@
throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
}
- UpdateScmResult result;
+ UpdateScmResult updateScmResult = null;
+ CheckOutScmResult checkOutScmResult = null;
+
+ File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
+
try
{
- result = provider.update( repository, new ScmFileSet( new File( releaseDescriptor.getWorkingDirectory() ) ),
- (ScmVersion) null );
+ if ( !workingDirectory.exists() )
+ {
+ workingDirectory.mkdirs();
+ }
+
+ if( workingDirectory.listFiles().length > 1 )
+ {
+ updateScmResult = provider.update( repository, new ScmFileSet( workingDirectory ), (ScmVersion) null );
+ }
+ else
+ {
+ checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory ) );
+ }
}
catch ( ScmException e )
{
@@ -94,12 +110,24 @@
e );
}
- if ( !result.isSuccess() )
+ if ( updateScmResult != null )
{
- throw new ReleaseScmCommandException( "Unable to update current working copy", result );
+ if( !updateScmResult.isSuccess() )
+ {
+ throw new ReleaseScmCommandException( "Unable to update current working copy", updateScmResult );
+ }
+
+ copyUpdated = updateScmResult.getUpdatedFiles().size() > 0;
}
-
- copyUpdated = ( result.getUpdatedFiles().size() > 0 );
+ else
+ {
+ if( !checkOutScmResult.isSuccess() )
+ {
+ throw new ReleaseScmCommandException( "Unable to checkout project", checkOutScmResult );
+ }
+
+ copyUpdated = checkOutScmResult.getCheckedOutFiles().size() > 0;
+ }
relResult.setResultCode( ReleaseResult.SUCCESS );
diff --git a/continuum-release/src/main/mdo/prepared-releases.mdo b/continuum-release/src/main/mdo/prepared-releases.mdo
index b65a8b4..f5e8694 100644
--- a/continuum-release/src/main/mdo/prepared-releases.mdo
+++ b/continuum-release/src/main/mdo/prepared-releases.mdo
@@ -29,11 +29,11 @@
<classes>
<class rootElement="true" xml.tagName="prepared-releases">
<name>PreparedReleaseModel</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<fields>
<field>
<name>preparedReleases</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description></description>
<required>true</required>
<association>
@@ -45,29 +45,36 @@
</class>
<class>
<name>PreparedRelease</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<fields>
<field>
<name>releaseId</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<required>true</required>
<description>release id</description>
<type>String</type>
</field>
<field>
<name>releaseName</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<required>true</required>
<description>prepared release name</description>
<type>String</type>
</field>
<field>
<name>buildAgentUrl</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<required>true</required>
<description>build agent url</description>
<type>String</type>
</field>
+ <field>
+ <name>releaseType</name>
+ <version>1.4.0+</version>
+ <required>true</required>
+ <description>type of release. possible values are "prepare" or "perform"</description>
+ <type>String</type>
+ </field>
</fields>
</class>
</classes>
diff --git a/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java b/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
index e21b089..bc065bd 100644
--- a/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
+++ b/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
@@ -32,13 +32,22 @@
import org.apache.maven.scm.repository.ScmRepositoryException;
import org.apache.maven.shared.release.ReleaseResult;
import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.apache.maven.shared.release.config.ReleaseDescriptorStoreException;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
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;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Properties;
/**
* @author Edwin Punzalan
@@ -89,7 +98,7 @@
File scmTargetPath = new File( getBasedir(), "target/scm-test" ).getAbsoluteFile();
FileUtils.copyDirectoryStructure( scmPath, scmTargetPath );
}
-
+
public void releaseSimpleProject()
throws Exception
{
@@ -130,6 +139,8 @@
releaseSimpleProject();
releaseAndRollbackProject();
releaseSimpleProjectWithNextVersion();
+ releasePerformWithExecutableInDescriptor();
+ releaseProjectWithDependencyOfCustomPackagingType();
}
public void releaseSimpleProjectWithNextVersion()
@@ -222,6 +233,119 @@
//@todo when implemented already, check if tag was also removed
}
+ public void releasePerformWithExecutableInDescriptor()
+ throws Exception
+ {
+ String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace( '\\', '/' );
+ File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
+ FileUtils.deleteDirectory( workDir );
+ File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
+ FileUtils.deleteDirectory( testDir );
+
+ ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
+ descriptor.setInteractive( false );
+ descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
+ descriptor.setWorkingDirectory( workDir.getAbsolutePath() );
+
+ ScmRepository repository = getScmRepositorty( descriptor.getScmSourceUrl() );
+ ScmFileSet fileSet = new ScmFileSet( workDir );
+ scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion) null );
+
+ String pom = FileUtils.fileRead( 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" ) );
+ 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" ) );
+ assertTrue( "Test released version", pom.indexOf( "<version>2.1</version>" ) > 0 );
+
+ File file = new File( descriptor.getWorkingDirectory(), "release.properties" );
+ assertTrue( "release.properties file does not exist", file.exists() );
+
+ Properties properties = new Properties();
+
+ InputStream inStream = null;
+ OutputStream outStream = null;
+
+ try
+ {
+ inStream = new FileInputStream( file );
+
+ properties.load( inStream );
+
+ properties.setProperty( "build.executable", "test/executable/mvn" );
+
+ outStream = new FileOutputStream( file );
+
+ properties.store( outStream, "release configuration" );
+ }
+ finally
+ {
+ IOUtil.close( inStream );
+ }
+
+ performExec.executeTask(
+ getPerformTask( "testRelease", descriptor, new File( getBasedir(), "target/test-classes/build-dir" ) ) );
+
+ ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease" );
+
+ if ( !result.getOutput().replace( "\\", "/" ).contains( "test/executable/mvn" ) )
+ {
+ fail( "Error in release:perform. Missing executable" );
+ }
+ }
+
+ // CONTINUUM-1814
+ public void releaseProjectWithDependencyOfCustomPackagingType()
+ throws Exception
+ {
+ 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 );
+ File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
+ FileUtils.deleteDirectory( testDir );
+
+ ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
+ descriptor.setInteractive( false );
+ descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
+ descriptor.setWorkingDirectory( workDir.getAbsolutePath() );
+
+ ScmRepository repository = getScmRepositorty( descriptor.getScmSourceUrl() );
+ ScmFileSet fileSet = new ScmFileSet( workDir );
+ scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion) null );
+
+ String pom = FileUtils.fileRead( 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" ) );
+ 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" ) );
+ assertTrue( "Test released version", pom.indexOf( "<version>1.6</version>" ) > 0 );
+
+ performExec.executeTask(
+ getPerformTask( "testRelease", descriptor, new File( getBasedir(), "target/test-classes/build-dir" ) ) );
+
+ ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease" );
+ if ( result.getResultCode() != ReleaseResult.SUCCESS )
+ {
+ fail( "Error in release:perform. Release output follows:\n" + result.getOutput() );
+ }
+ }
+
private void doPrepareWithNoError( ReleaseDescriptor descriptor )
throws TaskExecutionException
{
diff --git a/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java b/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
new file mode 100644
index 0000000..20dc321
--- /dev/null
+++ b/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
@@ -0,0 +1,119 @@
+package org.apache.maven.continuum.release.phase;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.maven.scm.ScmFileSet;
+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;
+
+public class UpdateWorkingCopyPhaseTest
+ extends PlexusInSpringTestCase
+{
+ private UpdateWorkingCopyPhase phase;
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ phase = (UpdateWorkingCopyPhase) lookup( ReleasePhase.ROLE, "update-working-copy" );
+
+ // 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 );
+ }
+
+ public void testWorkingDirDoesNotExist()
+ throws Exception
+ {
+ assertNotNull( phase );
+
+ ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();
+
+ File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
+
+ // assert no working directory yet
+ assertFalse( workingDirectory.exists() );
+
+ phase.execute( releaseDescriptor, new Settings(), null );
+
+ assertTrue( workingDirectory.exists() );
+ }
+
+ public void testWorkingDirAlreadyExistsWithProjectCheckout()
+ throws Exception
+ {
+ assertNotNull( phase );
+
+ ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();
+
+ File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
+
+ // assert working directory already exists with project checkout
+ assertTrue( workingDirectory.exists() );
+ assertTrue( workingDirectory.listFiles().length > 0 );
+
+ phase.execute( releaseDescriptor, new Settings(), null );
+
+ assertTrue( workingDirectory.exists() );
+ }
+
+ public void testWorkingDirAlreadyExistsNoProjectCheckout()
+ throws Exception
+ {
+ assertNotNull( phase );
+
+ ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();
+
+ File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
+ FileUtils.deleteDirectory( workingDirectory );
+ workingDirectory.mkdirs();
+
+ // assert empty working directory
+ assertTrue( workingDirectory.exists() );
+ assertTrue( workingDirectory.listFiles().length == 0 );
+
+ phase.execute( releaseDescriptor, new Settings(), null );
+
+ assertTrue( workingDirectory.exists() );
+ }
+
+ private ContinuumReleaseDescriptor createReleaseDescriptor()
+ {
+ // project source and working directory paths
+ String projectUrl = getBasedir() + "/target/scm-test/trunk";
+ String workingDirPath = getBasedir() + "/target/test-classes/updateWorkingCopy_working-directory";
+
+ // create release descriptor
+ ContinuumReleaseDescriptor releaseDescriptor = new ContinuumReleaseDescriptor();
+ releaseDescriptor.setScmSourceUrl( "scm:svn:file://" + projectUrl );
+ releaseDescriptor.setWorkingDirectory( workingDirPath );
+
+ return releaseDescriptor;
+ }
+}
diff --git a/continuum-release/src/test/scm/db/current b/continuum-release/src/test/scm/db/current
index 64b1838..d9ba3dd 100644
--- a/continuum-release/src/test/scm/db/current
+++ b/continuum-release/src/test/scm/db/current
@@ -1 +1 @@
-2 5 1
+5 i 1
diff --git a/continuum-release/src/test/scm/db/revprops/3 b/continuum-release/src/test/scm/db/revprops/3
new file mode 100644
index 0000000..0fa2fb3
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revprops/3
@@ -0,0 +1,14 @@
+K 10
+svn:author
+V 4
+deng
+K 8
+svn:date
+V 27
+2010-03-01T10:12:34.122774Z
+K 7
+svn:log
+V 39
+import test project for continuum-1814
+
+END
diff --git a/continuum-release/src/test/scm/db/revprops/4 b/continuum-release/src/test/scm/db/revprops/4
new file mode 100644
index 0000000..067bf22
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revprops/4
@@ -0,0 +1,14 @@
+K 10
+svn:author
+V 4
+deng
+K 8
+svn:date
+V 27
+2010-03-01T10:13:02.056710Z
+K 7
+svn:log
+V 48
+create tags dir for continuum-1814 test project
+
+END
diff --git a/continuum-release/src/test/scm/db/revprops/5 b/continuum-release/src/test/scm/db/revprops/5
new file mode 100644
index 0000000..5a187ea
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revprops/5
@@ -0,0 +1,14 @@
+K 10
+svn:author
+V 4
+deng
+K 8
+svn:date
+V 27
+2010-03-01T10:43:19.644938Z
+K 7
+svn:log
+V 20
+set <name> elements
+
+END
diff --git a/continuum-release/src/test/scm/db/revs/3 b/continuum-release/src/test/scm/db/revs/3
new file mode 100644
index 0000000..d2e29df
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revs/3
Binary files differ
diff --git a/continuum-release/src/test/scm/db/revs/4 b/continuum-release/src/test/scm/db/revs/4
new file mode 100644
index 0000000..37f5847
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revs/4
@@ -0,0 +1,52 @@
+id: h.0.r4/0
+type: dir
+count: 0
+cpath: /continuum-1814/tags
+copyroot: 0 /
+
+PLAIN
+K 4
+tags
+V 12
+dir h.0.r4/0
+K 5
+trunk
+V 15
+dir 6.0.r3/3840
+END
+ENDREP
+id: 5.0.r4/150
+type: dir
+pred: 5.0.r3/4021
+count: 1
+text: 4 75 62 62 0f542496a7d441a9d7a22151515328c8
+cpath: /continuum-1814
+copyroot: 0 /
+
+PLAIN
+K 14
+continuum-1814
+V 14
+dir 5.0.r4/150
+K 4
+tags
+V 14
+dir 2.0.r2/712
+K 5
+trunk
+V 14
+dir 3.0.r2/598
+END
+ENDREP
+id: 0.0.r4/406
+type: dir
+pred: 0.0.r3/4263
+count: 4
+text: 4 290 103 103 6b3929e554925dc771dfde26a278dda6
+cpath: /
+copyroot: 0 /
+
+_0.0.t3-1 add false false /continuum-1814/tags
+
+
+406 535
diff --git a/continuum-release/src/test/scm/db/revs/5 b/continuum-release/src/test/scm/db/revs/5
new file mode 100644
index 0000000..e962319
--- /dev/null
+++ b/continuum-release/src/test/scm/db/revs/5
Binary files differ
diff --git a/continuum-reports/pom.xml b/continuum-reports/pom.xml
index 088b7e5..5e99d0e 100644
--- a/continuum-reports/pom.xml
+++ b/continuum-reports/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>continuum-reports</artifactId>
<name>Continuum :: Reports</name>
@@ -46,10 +46,6 @@
<artifactId>continuum-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
diff --git a/continuum-security/pom.xml b/continuum-security/pom.xml
index aaeaed8..67fe65f 100644
--- a/continuum-security/pom.xml
+++ b/continuum-security/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-security</artifactId>
diff --git a/continuum-store/pom.xml b/continuum-store/pom.xml
index 7978903..80d5177 100644
--- a/continuum-store/pom.xml
+++ b/continuum-store/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-store</artifactId>
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
index 3dfe3c2..821553f 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
@@ -19,21 +19,21 @@
* under the License.
*/
-import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.springframework.stereotype.Repository;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.jdo.Extent;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -71,6 +71,7 @@
project.setState( build.getState() );
+ //TODO: Use projectDao
pm.makePersistent( project );
tx.commit();
@@ -142,7 +143,45 @@
if ( result != null && !result.isEmpty() )
{
- return (BuildResult) result.get( 0 );
+ return result.get( 0 );
+ }
+ }
+ finally
+ {
+ rollback( tx );
+ }
+ return null;
+ }
+
+ public BuildResult getLatestBuildResultForProjectWithDetails( int projectId )
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+ Extent extent = pm.getExtent( BuildResult.class, true );
+
+ Query query = pm.newQuery( extent );
+
+ query.declareParameters( "int projectId" );
+
+ query.setFilter( "this.project.id == projectId && this.project.latestBuildId == this.id" );
+
+ List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
+
+ result = (List<BuildResult>) pm.detachCopyAll( result );
+
+ tx.commit();
+
+ if ( result != null && !result.isEmpty() )
+ {
+ return result.get( 0 );
}
}
finally
@@ -183,7 +222,7 @@
if ( result != null && !result.isEmpty() )
{
- return (BuildResult) result.get( 0 );
+ return result.get( 0 );
}
}
finally
@@ -251,11 +290,6 @@
return null;
}
- public Map<Integer, BuildResult> getLatestBuildResults()
- {
- return getLatestBuildResultsByProjectGroupId( -1 );
- }
-
public void removeBuildResult( BuildResult buildResult )
{
removeObject( buildResult );
@@ -278,9 +312,9 @@
query.declareParameters( "Integer projectId" );
- List result = (List) query.execute( projectId );
+ List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
- result = (List) pm.detachCopyAll( result );
+ result = (List<BuildResult>) pm.detachCopyAll( result );
tx.commit();
@@ -316,9 +350,9 @@
query.setFilter( "this.project.id == projectId && this.buildNumber == buildNumber" );
- List result = (List) query.execute( projectId, buildNumber );
+ List<BuildResult> result = (List<BuildResult>) query.execute( projectId, buildNumber );
- result = (List) pm.detachCopyAll( result );
+ result = (List<BuildResult>) pm.detachCopyAll( result );
tx.commit();
@@ -403,9 +437,93 @@
}
}
+ public long getNbBuildResultsInSuccessForProject( int projectId, long fromDate )
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ Extent extent = pm.getExtent( BuildResult.class, true );
+
+ Query query = pm.newQuery( extent );
+
+ query.declareParameters( "int projectId, long fromDate, int state" );
+
+ query.setFilter( "this.project.id == projectId && this.startTime > fromDate && this.state == state" );
+
+ query.setResult( "count(this)" );
+
+ long result = (Long) query.execute( projectId, fromDate, ContinuumProjectState.OK );
+
+ tx.commit();
+
+ return result;
+ }
+ finally
+ {
+ rollback( tx );
+ }
+ }
+
+ public List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId )
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ Extent extent = pm.getExtent( BuildResult.class, true );
+ pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+ Query query = pm.newQuery( extent );
+
+ String parameters = "int projectId, long fromDate";
+ String filter = "this.project.id == projectId && this.startTime > fromDate";
+
+ if ( tobuildResultId > 0 )
+ {
+ parameters += ", int buildResultId";
+ filter += " && this.id < buildResultId";
+ }
+ query.declareParameters( parameters );
+
+ query.setFilter( filter );
+
+ query.setOrdering( "this.id descending" );
+
+ List<BuildResult> result;
+
+ if ( tobuildResultId > 0 )
+ {
+ result = (List<BuildResult>) query.execute( projectId, fromDate, tobuildResultId );
+ }
+ else
+ {
+ result = (List<BuildResult>) query.execute( projectId, fromDate );
+ }
+
+ result = (List<BuildResult>) pm.detachCopyAll( result );
+
+ tx.commit();
+
+ return result;
+ }
+ finally
+ {
+ rollback( tx );
+ }
+ }
+
public List<BuildResult> getBuildResultsForProject( int projectId )
{
- return getBuildResultsForProject( projectId, -1, -1 );
+ return getBuildResultsForProjectWithDetails( projectId, -1, -1 );
}
public List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex )
@@ -413,7 +531,7 @@
PersistenceManager pm = getPersistenceManager();
Transaction tx = pm.currentTransaction();
-
+
try
{
tx.begin();
@@ -433,9 +551,9 @@
query.setRange( startIndex, endIndex );
}
- List result = (List) query.execute( projectId );
+ List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
- result = (List) pm.detachCopyAll( result );
+ result = (List<BuildResult>) pm.detachCopyAll( result );
tx.commit();
@@ -446,7 +564,7 @@
rollback( tx );
}
}
-
+
public List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
throws ContinuumStoreException
{
@@ -455,7 +573,7 @@
Transaction tx = pm.currentTransaction();
pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-
+
try
{
tx.begin();
@@ -465,14 +583,14 @@
Query query = pm.newQuery( extent );
query.declareParameters( "int projectId, int buildNumber" );
-
+
query.setFilter( "this.project.id == projectId && this.buildNumber >= buildNumber" );
-
+
query.setOrdering( "this.startTime descending" );
- List result = (List) query.execute( projectId, startId );
+ List<BuildResult> result = (List<BuildResult>) query.execute( projectId, startId );
- result = (List) pm.detachCopyAll( result );
+ result = (List<BuildResult>) pm.detachCopyAll( result );
tx.commit();
@@ -488,14 +606,12 @@
}
}
- public List<BuildResult> getBuildResultsForProject( int projectId, long fromDate )
+ public BuildResult getLatestBuildResultInSuccess( int projectId )
{
PersistenceManager pm = getPersistenceManager();
Transaction tx = pm.currentTransaction();
- pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-
try
{
tx.begin();
@@ -504,13 +620,17 @@
Query query = pm.newQuery( extent );
- query.declareParameters( "int projectId, long fromDate" );
+ query.declareParameters( "int projectId" );
- query.setFilter( "this.project.id == projectId && this.startTime > fromDate" );
+ String filter = "this.project.buildNumber == this.buildNumber && this.project.id == projectId";
- List result = (List) query.execute( projectId, fromDate );
+ query.setFilter( filter );
- result = (List) pm.detachCopyAll( result );
+ query.setUnique( true );
+
+ BuildResult result = (BuildResult) query.execute( projectId );
+
+ result = (BuildResult) pm.detachCopy( result );
tx.commit();
@@ -522,23 +642,52 @@
}
}
- public List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate )
+ private int getPreviousBuildResultIdInSuccess( int projectId, int buildResultId )
{
- List<BuildResult> buildResults = getBuildResultsForProject( projectId, fromDate );
+ PersistenceManager pm = getPersistenceManager();
- List<BuildResult> results = new ArrayList<BuildResult>();
+ Transaction tx = pm.currentTransaction();
- if ( buildResults != null )
+ try
{
- for ( BuildResult res : buildResults )
- {
- if ( res.getState() == ContinuumProjectState.OK )
- {
- results.add( res );
- }
- }
+ tx.begin();
+
+ Extent extent = pm.getExtent( BuildResult.class, true );
+
+ Query query = pm.newQuery( extent );
+
+ query.declareParameters( "int projectId, int buildResultId" );
+
+ String filter = "this.id < buildResultId && this.state == " + ContinuumProjectState.OK +
+ " && this.project.id == projectId";
+
+ query.setFilter( filter );
+
+ query.setResult( "max(this.id)" );
+
+ int result = (Integer) query.execute( projectId, buildResultId );
+
+ tx.commit();
+
+ return result;
}
- return results;
+ finally
+ {
+ rollback( tx );
+ }
+ }
+
+ public BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+ throws ContinuumStoreException
+ {
+ try
+ {
+ return getBuildResult( getPreviousBuildResultIdInSuccess( projectId, buildResultId ) );
+ }
+ catch ( NullPointerException e )
+ {
+ return null;
+ }
}
public Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId )
@@ -599,10 +748,4 @@
return null;
}
-
- public Map<Integer, BuildResult> getBuildResultsInSuccess()
- {
- return getBuildResultsInSuccessByProjectGroupId( -1 );
- }
-
}
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
index c2e1e5b..3652e0a 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
@@ -119,10 +119,6 @@
{
pmf.close();
}
- catch ( SecurityException e )
- {
- throw e;
- }
catch ( JDOUserException e )
{
if ( numTry < 5 )
@@ -176,9 +172,8 @@
// might define their own build definitions
if ( projectGroupSource != null )
{
- for ( Iterator i = projectGroupSource.keySet().iterator(); i.hasNext(); )
+ for ( Integer projectGroupId : projectGroupSource.keySet() )
{
- Integer projectGroupId = (Integer) i.next();
List<Project> projectsInGroup = projectDao.getProjectsInGroup( projectGroupId );
for ( Project p : projectsInGroup )
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
index d00eef6..cf5f90e 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
@@ -74,6 +74,36 @@
rollback( tx );
}
}
+
+ public List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId )
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ Extent extent = pm.getExtent( DirectoryPurgeConfiguration.class, true );
+
+ Query query = pm.newQuery( extent );
+
+ query.declareParameters( "int scheduleId" );
+
+ query.setFilter( "this.schedule.id == scheduleId && this.enabled == true" );
+
+ List result = (List) query.execute( scheduleId );
+
+ return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
+ }
+ finally
+ {
+ tx.commit();
+
+ rollback( tx );
+ }
+ }
public List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location )
{
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
index ca591ee..6328b89 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
@@ -19,20 +19,20 @@
* under the License.
*/
-import org.apache.maven.continuum.model.system.Installation;
-import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.util.StringUtils;
-import org.springframework.stereotype.Repository;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import javax.jdo.Extent;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
+
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.util.StringUtils;
+import org.springframework.stereotype.Repository;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -85,9 +85,8 @@
if ( result.size() != 0 )
{
- for ( Iterator<Profile> iterator = result.iterator(); iterator.hasNext(); )
+ for ( Profile profile : result )
{
- Profile profile = iterator.next();
profile.setJdk( null );
pm.makePersistent( profile );
}
@@ -106,9 +105,8 @@
if ( result.size() != 0 )
{
- for ( Iterator<Profile> iterator = result.iterator(); iterator.hasNext(); )
+ for ( Profile profile : result )
{
- Profile profile = iterator.next();
profile.setBuilder( null );
pm.makePersistent( profile );
}
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/ProjectDaoImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/ProjectDaoImpl.java
index 58d1005..acd01dc 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/ProjectDaoImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/ProjectDaoImpl.java
@@ -19,19 +19,23 @@
* under the License.
*/
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.springframework.stereotype.Repository;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.jdo.Extent;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+
+import org.apache.continuum.model.project.ProjectGroupSummary;
+import org.apache.continuum.model.project.ProjectSummaryResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -149,22 +153,33 @@
}
}
- // todo get this natively supported in the store
public List<Project> getProjectsWithDependenciesByGroupId( int projectGroupId )
{
- List<Project> allProjects =
- getAllObjectsDetached( Project.class, "name ascending", PROJECT_DEPENDENCIES_FETCH_GROUP );
+ PersistenceManager pm = getPersistenceManager();
- List<Project> groupProjects = new ArrayList<Project>();
+ Transaction tx = pm.currentTransaction();
- for ( Project project : allProjects )
+ try
{
- if ( project.getProjectGroup().getId() == projectGroupId )
- {
- groupProjects.add( project );
- }
+ tx.begin();
+
+ Extent extent = pm.getExtent( Project.class, true );
+
+ Query query = pm.newQuery( extent, "projectGroup.id == " + projectGroupId );
+
+ pm.getFetchPlan().addGroup( PROJECT_DEPENDENCIES_FETCH_GROUP );
+ List<Project> result = (List<Project>) query.execute();
+
+ result = (List<Project>) pm.detachCopyAll( result );
+
+ tx.commit();
+
+ return result;
}
- return groupProjects;
+ finally
+ {
+ rollback( tx );
+ }
}
public Project getProjectWithBuilds( int projectId )
@@ -202,9 +217,9 @@
query.setOrdering( "name ascending" );
- List result = (List) query.execute();
+ List<Project> result = (List<Project>) query.execute();
- result = (List) pm.detachCopyAll( result );
+ result = (List<Project>) pm.detachCopyAll( result );
tx.commit();
@@ -237,9 +252,9 @@
pm.getFetchPlan().addGroup( PROJECTGROUP_PROJECTS_FETCH_GROUP );
- List result = (List) query.execute();
+ List<Project> result = (List<Project>) query.execute();
- result = (List) pm.detachCopyAll( result );
+ result = (List<Project>) pm.detachCopyAll( result );
tx.commit();
@@ -251,12 +266,6 @@
}
}
-
- public List<Project> getAllProjectsWithAllDetails()
- {
- return getAllObjectsDetached( Project.class, "name ascending", PROJECT_ALL_DETAILS_FETCH_GROUP );
- }
-
public Project getProjectWithAllDetails( int projectId )
throws ContinuumStoreException
{
@@ -299,4 +308,78 @@
{
return (Project) getObjectById( Project.class, projectId, PROJECT_DEPENDENCIES_FETCH_GROUP );
}
+
+ public Map<Integer, ProjectGroupSummary> getProjectsSummary()
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ Extent extent = pm.getExtent( Project.class );
+
+ Query query = pm.newQuery( extent );
+
+ query.setResult( "projectGroup.id as projectGroupId, state as projectState, count(state) as size" );
+
+ query.setResultClass( ProjectSummaryResult.class );
+
+ query.setGrouping( "projectGroup.id, state" );
+
+ List<ProjectSummaryResult> results = (List<ProjectSummaryResult>) query.execute();
+
+ Map<Integer, ProjectGroupSummary> summaries = processProjectGroupSummary( results );
+
+ tx.commit();
+
+ return summaries;
+ }
+ finally
+ {
+ rollback( tx );
+ }
+ }
+
+ private Map<Integer, ProjectGroupSummary> processProjectGroupSummary( List<ProjectSummaryResult> results )
+ {
+ Map<Integer, ProjectGroupSummary> map = new HashMap<Integer, ProjectGroupSummary>();
+
+ for ( ProjectSummaryResult result : results )
+ {
+ ProjectGroupSummary summary;
+ int projectGroupId = result.getProjectGroupId();
+ int size = new Long( result.getSize() ).intValue();
+ int state = result.getProjectState();
+
+ if ( map.containsKey( projectGroupId ) )
+ {
+ summary = map.get( projectGroupId );
+ }
+ else
+ {
+ summary = new ProjectGroupSummary( projectGroupId );
+ }
+
+ summary.addProjects( size );
+
+ if ( state == 2 )
+ {
+ summary.addNumberOfSuccesses( size );
+ }
+ else if ( state == 3 )
+ {
+ summary.addNumberOfFailures( size );
+ }
+ else if ( state == 4 )
+ {
+ summary.addNumberOfErrors( size );
+ }
+
+ map.put( projectGroupId, summary );
+ }
+ return map;
+ }
}
diff --git a/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java b/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
index f389505..18ddea1 100644
--- a/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
+++ b/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
@@ -75,6 +75,36 @@
rollback( tx );
}
}
+
+ public List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId )
+ {
+ PersistenceManager pm = getPersistenceManager();
+
+ Transaction tx = pm.currentTransaction();
+
+ try
+ {
+ tx.begin();
+
+ Extent extent = pm.getExtent( RepositoryPurgeConfiguration.class, true );
+
+ Query query = pm.newQuery( extent );
+
+ query.declareParameters( "int scheduleId" );
+
+ query.setFilter( "this.schedule.id == scheduleId && this.enabled == true" );
+
+ List result = (List) query.execute( scheduleId );
+
+ return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
+ }
+ finally
+ {
+ tx.commit();
+
+ rollback( tx );
+ }
+ }
public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByLocalRepository( int repositoryId )
{
diff --git a/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java b/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
index 99a46c0..3163bff 100644
--- a/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
+++ b/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
@@ -1204,9 +1204,9 @@
.getVersion(), project.getWorkingDirectory() );
}
- private static Project createTestProject( String artifactId, int buildNumber, String description, String groupId,
- String name, String scmUrl, int state, String url, String version,
- String workingDirectory )
+ protected static Project createTestProject( String artifactId, int buildNumber, String description, String groupId,
+ String name, String scmUrl, int state, String url, String version,
+ String workingDirectory )
{
Project project = new Project();
project.setArtifactId( artifactId );
diff --git a/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java b/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
index 033dcb8..f38af64 100644
--- a/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
+++ b/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
@@ -22,6 +22,7 @@
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.dao.BuildDefinitionTemplateDao;
import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.model.project.ProjectGroupSummary;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.model.release.ContinuumReleaseResult;
import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
@@ -42,12 +43,13 @@
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
-import javax.jdo.JDODetachedFieldAccessException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import javax.jdo.JDODetachedFieldAccessException;
/**
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
@@ -97,20 +99,20 @@
assertProjectGroupEquals( defaultProjectGroup, retrievedGroup );
assertLocalRepositoryEquals( testLocalRepository1, retrievedGroup.getLocalRepository() );
- List projects = retrievedGroup.getProjects();
+ List<Project> projects = retrievedGroup.getProjects();
assertEquals( "Check number of projects", 2, projects.size() );
assertTrue( "Check existence of project 1", projects.contains( testProject1 ) );
assertTrue( "Check existence of project 2", projects.contains( testProject2 ) );
checkProjectGroupDefaultFetchGroup( retrievedGroup );
- Project project = (Project) projects.get( 0 );
+ Project project = projects.get( 0 );
checkProjectDefaultFetchGroup( project );
//assertSame( "Check project group reference matches", project.getProjectGroup(), retrievedGroup );
assertEquals( project.getProjectGroup().getId(), retrievedGroup.getId() );
assertProjectEquals( testProject1, project );
- project = (Project) projects.get( 1 );
+ project = projects.get( 1 );
checkProjectDefaultFetchGroup( project );
//assertSame( "Check project group reference matches", project.getProjectGroup(), retrievedGroup );
assertEquals( project.getProjectGroup().getId(), retrievedGroup.getId() );
@@ -171,16 +173,15 @@
public void testGetAllProjectGroups()
{
- Collection groups = projectGroupDao.getAllProjectGroupsWithProjects();
+ Collection<ProjectGroup> groups = projectGroupDao.getAllProjectGroupsWithProjects();
assertEquals( "check size", 2, groups.size() );
assertTrue( groups.contains( defaultProjectGroup ) );
assertTrue( groups.contains( testProjectGroup2 ) );
- for ( Iterator i = groups.iterator(); i.hasNext(); )
+ for ( ProjectGroup group : groups )
{
- ProjectGroup group = (ProjectGroup) i.next();
- List projects = group.getProjects();
+ List<Project> projects = group.getProjects();
if ( group.getId() == testProjectGroup2.getId() )
{
assertProjectGroupEquals( testProjectGroup2, group );
@@ -197,7 +198,7 @@
checkProjectGroupDefaultFetchGroup( group );
- Project p = (Project) projects.get( 0 );
+ Project p = projects.get( 0 );
checkProjectDefaultFetchGroup( p );
assertSame( "Check project group reference matches", p.getProjectGroup(), group );
}
@@ -288,10 +289,10 @@
public void testGetAllProjects()
{
- List projects = projectDao.getAllProjectsByName();
- assertEquals( "check items", Arrays.asList( new Project[]{testProject1, testProject2} ), projects );
+ List<Project> projects = projectDao.getAllProjectsByName();
+ assertEquals( "check items", Arrays.asList( testProject1, testProject2 ), projects );
- Project project = (Project) projects.get( 1 );
+ Project project = projects.get( 1 );
assertProjectEquals( testProject2, project );
checkProjectDefaultFetchGroup( project );
assertNotNull( "Check project group reference matches", project.getProjectGroup() );
@@ -309,43 +310,43 @@
scheduleDao.addSchedule( newSchedule );
copy.setId( newSchedule.getId() );
- List schedules = scheduleDao.getAllSchedulesByName();
- Schedule retrievedSchedule = (Schedule) schedules.get( schedules.size() - 1 );
+ List<Schedule> schedules = scheduleDao.getAllSchedulesByName();
+ Schedule retrievedSchedule = schedules.get( schedules.size() - 1 );
assertScheduleEquals( copy, retrievedSchedule );
assertEquals( "check size of build queues", 1, retrievedSchedule.getBuildQueues().size() );
- assertBuildQueueEquals( buildQueue, (BuildQueue) retrievedSchedule.getBuildQueues().get( 0 ) );
+ assertBuildQueueEquals( buildQueue, retrievedSchedule.getBuildQueues().get( 0 ) );
}
public void testEditSchedule()
throws ContinuumStoreException
{
- Schedule newSchedule = (Schedule) scheduleDao.getAllSchedulesByName().get( 0 );
+ Schedule newSchedule = scheduleDao.getAllSchedulesByName().get( 0 );
newSchedule.setName( "name1.1" );
newSchedule.setDescription( "testEditSchedule updated description" );
assertEquals( "check size of build queues", 2, newSchedule.getBuildQueues().size() );
- BuildQueue buildQueue1 = (BuildQueue)newSchedule.getBuildQueues().get( 0 );
- BuildQueue buildQueue2 = (BuildQueue)newSchedule.getBuildQueues().get( 1 );
+ BuildQueue buildQueue1 = newSchedule.getBuildQueues().get( 0 );
+ BuildQueue buildQueue2 = newSchedule.getBuildQueues().get( 1 );
Schedule copy = createTestSchedule( newSchedule );
copy.setId( newSchedule.getId() );
scheduleDao.updateSchedule( newSchedule );
- Schedule retrievedSchedule = (Schedule) scheduleDao.getAllSchedulesByName().get( 0 );
+ Schedule retrievedSchedule = scheduleDao.getAllSchedulesByName().get( 0 );
assertScheduleEquals( copy, retrievedSchedule );
- assertBuildQueueEquals( buildQueue1, (BuildQueue) retrievedSchedule.getBuildQueues().get( 0 ) );
- assertBuildQueueEquals( buildQueue2, (BuildQueue) retrievedSchedule.getBuildQueues().get( 1 ) );
+ assertBuildQueueEquals( buildQueue1, retrievedSchedule.getBuildQueues().get( 0 ) );
+ assertBuildQueueEquals( buildQueue2, retrievedSchedule.getBuildQueues().get( 1 ) );
}
public void testRemoveSchedule()
{
- Schedule schedule = (Schedule) scheduleDao.getAllSchedulesByName().get( 2 );
+ Schedule schedule = scheduleDao.getAllSchedulesByName().get( 2 );
// TODO: test if it has any attachments
assertEquals( "check size of build queues", 0, schedule.getBuildQueues().size() );
scheduleDao.removeSchedule( schedule );
- List schedules = scheduleDao.getAllSchedulesByName();
+ List<Schedule> schedules = scheduleDao.getAllSchedulesByName();
assertEquals( "check size", 2, schedules.size() );
assertFalse( "check not there", schedules.contains( schedule ) );
}
@@ -353,7 +354,7 @@
public void testGetAllSchedules()
throws ContinuumStoreException
{
- List schedules = scheduleDao.getAllSchedulesByName();
+ List<Schedule> schedules = scheduleDao.getAllSchedulesByName();
List<BuildQueue> buildQueues = buildQueueDao.getAllBuildQueues();
assertEquals( "check item count", 3, schedules.size() );
@@ -364,19 +365,19 @@
BuildQueue buildQueue3 = buildQueues.get( 2 );
// check equality and order
- Schedule schedule = (Schedule) schedules.get( 0 );
+ Schedule schedule = schedules.get( 0 );
assertScheduleEquals( testSchedule1, schedule );
assertEquals( "check size of buildQueues", 2, schedule.getBuildQueues().size() );
- assertBuildQueueEquals( buildQueue1, (BuildQueue) schedule.getBuildQueues().get( 0 ) );
- assertBuildQueueEquals( buildQueue2, (BuildQueue) schedule.getBuildQueues().get( 1 ) );
+ assertBuildQueueEquals( buildQueue1, schedule.getBuildQueues().get( 0 ) );
+ assertBuildQueueEquals( buildQueue2, schedule.getBuildQueues().get( 1 ) );
- schedule = (Schedule) schedules.get( 1 );
+ schedule = schedules.get( 1 );
assertScheduleEquals( testSchedule2, schedule );
assertEquals( "check size of buildQueues", 2, schedule.getBuildQueues().size() );
- assertBuildQueueEquals( buildQueue2, (BuildQueue) schedule.getBuildQueues().get( 0 ) );
- assertBuildQueueEquals( buildQueue3, (BuildQueue) schedule.getBuildQueues().get( 1 ) );
+ assertBuildQueueEquals( buildQueue2, schedule.getBuildQueues().get( 0 ) );
+ assertBuildQueueEquals( buildQueue3, schedule.getBuildQueues().get( 1 ) );
- schedule = (Schedule) schedules.get( 2 );
+ schedule = schedules.get( 2 );
assertScheduleEquals( testSchedule3, schedule );
assertEquals( "check size of buildQueues", 0, schedule.getBuildQueues().size() );
}
@@ -384,16 +385,15 @@
public void testAddProfile()
throws Exception
{
- List installations = installationDao.getAllInstallations();
+ List<Installation> installations = installationDao.getAllInstallations();
Profile newProfile = createTestProfile( "testAddProfile", "testAddProfile desc", 5, false, false,
- (Installation) installations.get( 1 ), (Installation) installations
- .get( 2 ) );
+ installations.get( 1 ), installations.get( 2 ) );
Profile copy = createTestProfile( newProfile );
profileDao.addProfile( newProfile );
copy.setId( newProfile.getId() );
- List profiles = profileDao.getAllProfilesByName();
- Profile retrievedProfile = (Profile) profiles.get( profiles.size() - 1 );
+ List<Profile> profiles = profileDao.getAllProfilesByName();
+ Profile retrievedProfile = profiles.get( profiles.size() - 1 );
assertProfileEquals( copy, retrievedProfile );
assertInstallationEquals( testInstallationMaven20a3, retrievedProfile.getBuilder() );
assertInstallationEquals( testInstallationJava14, retrievedProfile.getJdk() );
@@ -402,7 +402,7 @@
public void testEditProfile()
throws ContinuumStoreException
{
- Profile newProfile = (Profile) profileDao.getAllProfilesByName().get( 0 );
+ Profile newProfile = profileDao.getAllProfilesByName().get( 0 );
newProfile.setName( "name1.1" );
newProfile.setDescription( "testEditProfile updated description" );
@@ -410,7 +410,7 @@
copy.setId( newProfile.getId() );
profileDao.updateProfile( newProfile );
- Profile retrievedProfile = (Profile) profileDao.getAllProfilesByName().get( 0 );
+ Profile retrievedProfile = profileDao.getAllProfilesByName().get( 0 );
assertProfileEquals( copy, retrievedProfile );
assertInstallationEquals( copy.getBuilder(), retrievedProfile.getBuilder() );
assertInstallationEquals( copy.getJdk(), retrievedProfile.getJdk() );
@@ -419,43 +419,43 @@
public void testRemoveProfile()
{
- Profile profile = (Profile) profileDao.getAllProfilesByName().get( 2 );
+ Profile profile = profileDao.getAllProfilesByName().get( 2 );
// TODO: test if it has any attachments
profileDao.removeProfile( profile );
- List profiles = profileDao.getAllProfilesByName();
+ List<Profile> profiles = profileDao.getAllProfilesByName();
assertEquals( "check size", 3, profiles.size() );
assertFalse( "check not there", profiles.contains( profile ) );
}
public void testGetAllProfiles()
{
- List profiles = profileDao.getAllProfilesByName();
+ List<Profile> profiles = profileDao.getAllProfilesByName();
assertEquals( "check item count", 4, profiles.size() );
// check equality and order
- Profile profile = (Profile) profiles.get( 0 );
+ Profile profile = profiles.get( 0 );
assertProfileEquals( testProfile1, profile );
assertInstallationEquals( testProfile1.getBuilder(), profile.getBuilder() );
assertInstallationEquals( testProfile1.getJdk(), profile.getJdk() );
- profile = (Profile) profiles.get( 1 );
+ profile = profiles.get( 1 );
assertProfileEquals( testProfile2, profile );
assertInstallationEquals( testProfile2.getBuilder(), profile.getBuilder() );
assertInstallationEquals( testProfile2.getJdk(), profile.getJdk() );
- profile = (Profile) profiles.get( 2 );
+ profile = profiles.get( 2 );
assertProfileEquals( testProfile3, profile );
assertInstallationEquals( testProfile3.getBuilder(), profile.getBuilder() );
assertInstallationEquals( testProfile3.getJdk(), profile.getJdk() );
- profile = (Profile) profiles.get( 3 );
+ profile = profiles.get( 3 );
assertProfileEquals( testProfile4, profile );
assertInstallationEquals( testProfile4.getBuilder(), profile.getBuilder() );
assertInstallationEquals( testProfile4.getJdk(), profile.getJdk() );
assertEquals( "check env var count", 1, profile.getEnvironmentVariables().size() );
- assertInstallationEquals( (Installation) testProfile4.getEnvironmentVariables().get( 0 ),
- (Installation) profile.getEnvironmentVariables().get( 0 ) );
+ assertInstallationEquals( testProfile4.getEnvironmentVariables().get( 0 ),
+ profile.getEnvironmentVariables().get( 0 ) );
}
/*
@@ -469,18 +469,18 @@
public void testGetAllInstallations()
throws Exception
{
- List installations = installationDao.getAllInstallations();
+ List<Installation> installations = installationDao.getAllInstallations();
assertEquals( "check item count", 4, installations.size() );
// check equality and order
- Installation installation = (Installation) installations.get( 0 );
+ Installation installation = installations.get( 0 );
assertInstallationEquals( testInstallationJava13, installation );
- installation = (Installation) installations.get( 1 );
+ installation = installations.get( 1 );
assertInstallationEquals( testInstallationJava14, installation );
- installation = (Installation) installations.get( 2 );
+ installation = installations.get( 2 );
assertInstallationEquals( testInstallationMaven20a3, installation );
- installation = (Installation) installations.get( 3 );
+ installation = installations.get( 3 );
assertInstallationEquals( testInstallationEnvVar, installation );
}
@@ -610,14 +610,14 @@
assertNull( firstGetted.getJdk() );
assertNull( firstGetted.getBuilder() );
assertEquals( 1, firstGetted.getEnvironmentVariables().size() );
- Installation env = (Installation) firstGetted.getEnvironmentVariables().get( 0 );
+ Installation env = firstGetted.getEnvironmentVariables().get( 0 );
assertEquals( nameSecondEnvVar, env.getName() );
assertNotNull( secondGetted );
assertNull( secondGetted.getJdk() );
assertNull( secondGetted.getBuilder() );
assertEquals( 1, secondGetted.getEnvironmentVariables().size() );
- env = (Installation) secondGetted.getEnvironmentVariables().get( 0 );
+ env = secondGetted.getEnvironmentVariables().get( 0 );
assertEquals( nameSecondEnvVar, env.getName() );
// removing secondEnvVar
@@ -644,7 +644,7 @@
ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithProjects( defaultProjectGroup.getId() );
assertEquals( "check size is now 1", 1, projectGroup.getProjects().size() );
- assertProjectEquals( testProject2, (Project) projectGroup.getProjects().get( 0 ) );
+ assertProjectEquals( testProject2, projectGroup.getProjects().get( 0 ) );
confirmProjectDeletion( testProject1 );
}
@@ -675,9 +675,9 @@
{
Project project = projectDao.getProjectWithBuilds( testProject1.getId() );
- for ( Iterator i = project.getBuildResults().iterator(); i.hasNext(); )
+ for ( Iterator<BuildResult> i = project.getBuildResults().iterator(); i.hasNext(); )
{
- BuildResult result = (BuildResult) i.next();
+ BuildResult result = i.next();
if ( result.getId() == testBuildResult1.getId() )
{
i.remove();
@@ -687,11 +687,11 @@
project = projectDao.getProjectWithBuilds( testProject1.getId() );
assertEquals( "check size is now 1", 1, project.getBuildResults().size() );
- assertBuildResultEquals( testBuildResult2, (BuildResult) project.getBuildResults().get( 0 ) );
+ assertBuildResultEquals( testBuildResult2, project.getBuildResults().get( 0 ) );
- List results = buildResultDao.getAllBuildsForAProjectByDate( testProject1.getId() );
+ List<BuildResult> results = buildResultDao.getAllBuildsForAProjectByDate( testProject1.getId() );
assertEquals( "check item count", 1, results.size() );
- assertBuildResultEquals( testBuildResult2, (BuildResult) results.get( 0 ) );
+ assertBuildResultEquals( testBuildResult2, results.get( 0 ) );
// !! These actually aren't happening !!
// TODO: test the build result was physically deleted
@@ -715,16 +715,16 @@
public void testGetAllBuildsForAProject()
{
- List results = buildResultDao.getAllBuildsForAProjectByDate( testProject1.getId() );
+ List<BuildResult> results = buildResultDao.getAllBuildsForAProjectByDate( testProject1.getId() );
assertEquals( "check item count", 2, results.size() );
// check equality and order
- BuildResult buildResult = (BuildResult) results.get( 0 );
+ BuildResult buildResult = results.get( 0 );
assertBuildResultEquals( testBuildResult2, buildResult );
assertProjectEquals( testProject1, buildResult.getProject() );
//checkBuildResultDefaultFetchGroup( buildResult );
- buildResult = (BuildResult) results.get( 1 );
+ buildResult = results.get( 1 );
assertBuildResultEquals( testBuildResult1, buildResult );
assertProjectEquals( testProject1, buildResult.getProject() );
//checkBuildResultDefaultFetchGroup( buildResult );
@@ -750,10 +750,10 @@
assertNotifiersEqual( defaultProjectGroup.getNotifiers(), retrievedGroup.getNotifiers() );
assertBuildDefinitionsEqual( retrievedGroup.getBuildDefinitions(), defaultProjectGroup.getBuildDefinitions() );
- List projects = retrievedGroup.getProjects();
+ List<Project> projects = retrievedGroup.getProjects();
assertEquals( "Check number of projects", 2, projects.size() );
- Project project = (Project) projects.get( 0 );
+ Project project = projects.get( 0 );
checkProjectFetchGroup( project, false, false, true, false );
//assertSame( "Check project group reference matches", project.getProjectGroup(), retrievedGroup );
assertEquals( project.getProjectGroup().getId(), retrievedGroup.getId() );
@@ -761,7 +761,7 @@
assertNotifiersEqual( testProject1.getNotifiers(), project.getNotifiers() );
assertBuildDefinitionsEqual( project.getBuildDefinitions(), testProject1.getBuildDefinitions() );
- project = (Project) projects.get( 1 );
+ project = projects.get( 1 );
checkProjectFetchGroup( project, false, false, true, false );
//assertSame( "Check project group reference matches", project.getProjectGroup(), retrievedGroup );
assertEquals( project.getProjectGroup().getId(), retrievedGroup.getId() );
@@ -772,27 +772,27 @@
public void testGetAllProjectsGroupWithDetails()
{
- List projectGroups = projectGroupDao.getAllProjectGroupsWithBuildDetails();
- ProjectGroup group1 = (ProjectGroup) projectGroups.get( 0 );
+ List<ProjectGroup> projectGroups = projectGroupDao.getAllProjectGroupsWithBuildDetails();
+ ProjectGroup group1 = projectGroups.get( 0 );
assertProjectGroupEquals( defaultProjectGroup, group1 );
assertNotifiersEqual( defaultProjectGroup.getNotifiers(), group1.getNotifiers() );
assertBuildDefinitionsEqual( group1.getBuildDefinitions(), defaultProjectGroup.getBuildDefinitions() );
- ProjectGroup group2 = (ProjectGroup) projectGroups.get( 1 );
+ ProjectGroup group2 = projectGroups.get( 1 );
assertProjectGroupEquals( testProjectGroup2, group2 );
assertNotifiersEqual( testProjectGroup2.getNotifiers(), group2.getNotifiers() );
assertBuildDefinitionsEqual( group2.getBuildDefinitions(), testProjectGroup2.getBuildDefinitions() );
- List projects = group1.getProjects();
+ List<Project> projects = group1.getProjects();
assertEquals( "Check number of projects", 2, projects.size() );
- Project project = (Project) projects.get( 0 );
+ Project project = projects.get( 0 );
checkProjectFetchGroup( project, false, false, true, false );
assertSame( "Check project group reference matches", project.getProjectGroup(), group1 );
assertProjectEquals( testProject1, project );
assertNotifiersEqual( testProject1.getNotifiers(), project.getNotifiers() );
assertBuildDefinitionsEqual( project.getBuildDefinitions(), testProject1.getBuildDefinitions() );
- project = (Project) projects.get( 1 );
+ project = projects.get( 1 );
checkProjectFetchGroup( project, false, false, true, false );
assertSame( "Check project group reference matches", project.getProjectGroup(), group1 );
assertProjectEquals( testProject2, project );
@@ -815,7 +815,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # devs", 2, project.getDevelopers().size() );
- assertDeveloperEquals( copy, (ProjectDeveloper) project.getDevelopers().get( 1 ) );
+ assertDeveloperEquals( copy, project.getDevelopers().get( 1 ) );
}
public void testEditDeveloper()
@@ -823,7 +823,7 @@
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- ProjectDeveloper newDeveloper = (ProjectDeveloper) project.getDevelopers().get( 0 );
+ ProjectDeveloper newDeveloper = project.getDevelopers().get( 0 );
newDeveloper.setName( "name1.1" );
newDeveloper.setEmail( "email1.1" );
@@ -832,7 +832,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # devs", 1, project.getDevelopers().size() );
- assertDeveloperEquals( copy, (ProjectDeveloper) project.getDevelopers().get( 0 ) );
+ assertDeveloperEquals( copy, project.getDevelopers().get( 0 ) );
}
public void testDeleteDeveloper()
@@ -861,7 +861,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # deps", 3, project.getDependencies().size() );
- assertDependencyEquals( copy, (ProjectDependency) project.getDependencies().get( 2 ) );
+ assertDependencyEquals( copy, project.getDependencies().get( 2 ) );
}
public void testEditDependency()
@@ -869,7 +869,7 @@
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- ProjectDependency newDependency = (ProjectDependency) project.getDependencies().get( 0 );
+ ProjectDependency newDependency = project.getDependencies().get( 0 );
newDependency.setGroupId( "groupId1.1" );
newDependency.setArtifactId( "artifactId1.1" );
@@ -878,20 +878,20 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # deps", 2, project.getDependencies().size() );
- assertDependencyEquals( copy, (ProjectDependency) project.getDependencies().get( 0 ) );
+ assertDependencyEquals( copy, project.getDependencies().get( 0 ) );
}
public void testDeleteDependency()
throws ContinuumStoreException
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- ProjectDependency dependency = (ProjectDependency) project.getDependencies().get( 1 );
+ ProjectDependency dependency = project.getDependencies().get( 1 );
project.getDependencies().remove( 0 );
projectDao.updateProject( project );
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check size is now 1", 1, project.getDependencies().size() );
- assertDependencyEquals( dependency, (ProjectDependency) project.getDependencies().get( 0 ) );
+ assertDependencyEquals( dependency, project.getDependencies().get( 0 ) );
// !! These actually aren't happening !!
// TODO: test the dependency was physically deleted
@@ -909,7 +909,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # notifiers", 2, project.getNotifiers().size() );
- assertNotifierEquals( copy, (ProjectNotifier) project.getNotifiers().get( 1 ) );
+ assertNotifierEquals( copy, project.getNotifiers().get( 1 ) );
}
public void testEditNotifier()
@@ -917,7 +917,7 @@
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- ProjectNotifier newNotifier = (ProjectNotifier) project.getNotifiers().get( 0 );
+ ProjectNotifier newNotifier = project.getNotifiers().get( 0 );
// If we use "type1.1", jpox-rc2 store "type11", weird
String type = "type11";
newNotifier.setType( type );
@@ -927,7 +927,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # notifiers", 1, project.getNotifiers().size() );
- assertNotifierEquals( copy, (ProjectNotifier) project.getNotifiers().get( 0 ) );
+ assertNotifierEquals( copy, project.getNotifiers().get( 0 ) );
}
public void testDeleteNotifier()
@@ -959,7 +959,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # build defs", 3, project.getBuildDefinitions().size() );
- BuildDefinition retrievedBuildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 2 );
+ BuildDefinition retrievedBuildDefinition = project.getBuildDefinitions().get( 2 );
assertBuildDefinitionEquals( copy, retrievedBuildDefinition );
assertScheduleEquals( testSchedule1, retrievedBuildDefinition.getSchedule() );
assertProfileEquals( testProfile1, retrievedBuildDefinition.getProfile() );
@@ -970,7 +970,7 @@
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- BuildDefinition newBuildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 0 );
+ BuildDefinition newBuildDefinition = project.getBuildDefinitions().get( 0 );
newBuildDefinition.setBuildFresh( true );
new BuildDefinition().setDefaultForProject( true );
String arguments = "arguments1.1";
@@ -980,7 +980,7 @@
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check # build defs", 2, project.getBuildDefinitions().size() );
- BuildDefinition retrievedBuildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 0 );
+ BuildDefinition retrievedBuildDefinition = project.getBuildDefinitions().get( 0 );
assertBuildDefinitionEquals( copy, retrievedBuildDefinition );
assertScheduleEquals( testSchedule1, retrievedBuildDefinition.getSchedule() );
@@ -991,13 +991,13 @@
throws ContinuumStoreException
{
Project project = projectDao.getProjectWithAllDetails( testProject1.getId() );
- BuildDefinition buildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 1 );
+ BuildDefinition buildDefinition = project.getBuildDefinitions().get( 1 );
project.getBuildDefinitions().remove( 0 );
projectDao.updateProject( project );
project = projectDao.getProjectWithAllDetails( testProject1.getId() );
assertEquals( "check size is now 1", 1, project.getBuildDefinitions().size() );
- BuildDefinition retrievedBuildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 0 );
+ BuildDefinition retrievedBuildDefinition = project.getBuildDefinitions().get( 0 );
assertBuildDefinitionEquals( buildDefinition, retrievedBuildDefinition );
assertScheduleEquals( testSchedule2, retrievedBuildDefinition.getSchedule() );
assertProfileEquals( testProfile2, retrievedBuildDefinition.getProfile() );
@@ -1020,7 +1020,7 @@
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
assertEquals( "check # notifiers", 3, projectGroup.getNotifiers().size() );
- assertNotifierEquals( copy, (ProjectNotifier) projectGroup.getNotifiers().get( 2 ) );
+ assertNotifierEquals( copy, projectGroup.getNotifiers().get( 2 ) );
}
public void testEditGroupNotifier()
@@ -1029,7 +1029,7 @@
ProjectGroup projectGroup =
projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
- ProjectNotifier newNotifier = (ProjectNotifier) projectGroup.getNotifiers().get( 0 );
+ ProjectNotifier newNotifier = projectGroup.getNotifiers().get( 0 );
// If we use "type1.1", jpox-rc2 store "type1", weird
String type = "type1";
newNotifier.setType( type );
@@ -1039,7 +1039,7 @@
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
assertEquals( "check # notifiers", 2, projectGroup.getNotifiers().size() );
- assertNotifierEquals( copy, (ProjectNotifier) projectGroup.getNotifiers().get( 0 ) );
+ assertNotifierEquals( copy, projectGroup.getNotifiers().get( 0 ) );
}
public void testDeleteGroupNotifier()
@@ -1047,13 +1047,13 @@
{
ProjectGroup projectGroup =
projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
- ProjectNotifier notifier = (ProjectNotifier) projectGroup.getNotifiers().get( 1 );
+ ProjectNotifier notifier = projectGroup.getNotifiers().get( 1 );
projectGroup.getNotifiers().remove( 0 );
projectGroupDao.updateProjectGroup( projectGroup );
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
assertEquals( "check size is now 1", 1, projectGroup.getNotifiers().size() );
- assertNotifierEquals( notifier, (ProjectNotifier) projectGroup.getNotifiers().get( 0 ) );
+ assertNotifierEquals( notifier, projectGroup.getNotifiers().get( 0 ) );
// !! These actually aren't happening !!
// TODO: test the notifier was physically deleted
@@ -1075,7 +1075,7 @@
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
assertEquals( "check # build defs", 2, projectGroup.getBuildDefinitions().size() );
- BuildDefinition retrievedBuildDefinition = (BuildDefinition) projectGroup.getBuildDefinitions().get( 1 );
+ BuildDefinition retrievedBuildDefinition = projectGroup.getBuildDefinitions().get( 1 );
assertBuildDefinitionEquals( copy, retrievedBuildDefinition );
assertScheduleEquals( testSchedule1, retrievedBuildDefinition.getSchedule() );
assertProfileEquals( testProfile1, retrievedBuildDefinition.getProfile() );
@@ -1087,7 +1087,7 @@
ProjectGroup projectGroup =
projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
- BuildDefinition newBuildDefinition = (BuildDefinition) projectGroup.getBuildDefinitions().get( 0 );
+ BuildDefinition newBuildDefinition = projectGroup.getBuildDefinitions().get( 0 );
// If we use "arguments1.1", jpox-rc2 store "arguments11", weird
String arguments = "arguments1";
@@ -1098,7 +1098,7 @@
projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( defaultProjectGroup.getId() );
assertEquals( "check # build defs", 1, projectGroup.getBuildDefinitions().size() );
- BuildDefinition retrievedBuildDefinition = (BuildDefinition) projectGroup.getBuildDefinitions().get( 0 );
+ BuildDefinition retrievedBuildDefinition = projectGroup.getBuildDefinitions().get( 0 );
assertBuildDefinitionEquals( copy, retrievedBuildDefinition );
assertScheduleEquals( testSchedule2, retrievedBuildDefinition.getSchedule() );
assertProfileEquals( testProfile1, retrievedBuildDefinition.getProfile() );
@@ -1181,7 +1181,6 @@
assertLocalRepositoryEquals( testLocalRepository2, projectGroup.getLocalRepository() );
projectGroup.setLocalRepository( null );
- ProjectGroup copy = createTestProjectGroup( projectGroup );
projectGroupDao.updateProjectGroup( projectGroup );
projectGroup = projectGroupDao.getProjectGroup( testProjectGroup2.getId() );
@@ -1354,6 +1353,52 @@
releaseResults = releaseResultDao.getAllContinuumReleaseResults();
assertEquals( "check size of continuum release results", 1, releaseResults.size() );
}
+
+ public void testGetProjectSummaryByProjectGroup()
+ throws Exception
+ {
+ List<Project> projects = projectDao.getProjectsInGroup( defaultProjectGroup.getId() );
+ assertEquals( 2, projects.size() );
+
+ Project project = projects.get( 0 );
+ project.setState( 2 );
+ projectDao.updateProject( project );
+
+ project = projects.get( 1 );
+ project.setState( 2 );
+ projectDao.updateProject( project );
+
+ ProjectGroup newGroup = projectGroupDao.getProjectGroupWithProjects( testProjectGroup2.getId() );
+ Project project1 = createTestProject( testProject1 );
+ project1.setState( 4 );
+ newGroup.addProject( project1 );
+
+ Project project2 = createTestProject( testProject2 );
+ project2.setState( 1 );
+ newGroup.addProject( project2 );
+ projectGroupDao.updateProjectGroup( newGroup );
+
+ Map<Integer, ProjectGroupSummary> summaries = projectDao.getProjectsSummary();
+
+ assertNotNull( summaries );
+ assertEquals( "check size of project summaries", 2, summaries.size() );
+
+ ProjectGroupSummary summary = summaries.get( testProjectGroup2.getId() );
+ assertEquals( "check id of project group", testProjectGroup2.getId(), summary.getProjectGroupId() );
+ assertEquals( "check number of errors", 1, summary.getNumberOfErrors() );
+ assertEquals( "check number of successes", 0, summary.getNumberOfSuccesses() );
+ assertEquals( "check number of failures", 0, summary.getNumberOfFailures() );
+ assertEquals( "check number of projects", 2, summary.getNumberOfProjects() );
+
+ summary = summaries.get( defaultProjectGroup.getId() );
+ assertEquals( "check id of project group", defaultProjectGroup.getId(), summary.getProjectGroupId() );
+ assertEquals( "check number of errors", 0, summary.getNumberOfErrors() );
+ assertEquals( "check number of successes", 2, summary.getNumberOfSuccesses() );
+ assertEquals( "check number of failures", 0, summary.getNumberOfFailures() );
+ assertEquals( "check number of projects", 2, summary.getNumberOfProjects() );
+
+ }
+
// ----------------------------------------------------------------------
// HELPER METHODS
// ----------------------------------------------------------------------
@@ -1507,21 +1552,21 @@
}
}
- private static void checkBuildResultDefaultFetchGroup( BuildResult buildResult )
- {
- try
- {
- buildResult.getScmResult();
-
- fail( "scmResult should not be in the default fetch group" );
- }
- catch ( JDODetachedFieldAccessException expected )
- {
- assertTrue( true );
- }
- // TODO: artifacts
- // TODO: report
- // TODO: long error data
- }
+// private static void checkBuildResultDefaultFetchGroup( BuildResult buildResult )
+// {
+// try
+// {
+// buildResult.getScmResult();
+//
+// fail( "scmResult should not be in the default fetch group" );
+// }
+// catch ( JDODetachedFieldAccessException expected )
+// {
+// assertTrue( true );
+// }
+// // TODO: artifacts
+// // TODO: report
+// // TODO: long error data
+// }
}
diff --git a/continuum-test/pom.xml b/continuum-test/pom.xml
index 9df6c9c..98f45ba 100644
--- a/continuum-test/pom.xml
+++ b/continuum-test/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-test</artifactId>
diff --git a/continuum-webapp-test/Readme.txt b/continuum-webapp-test/Readme.txt
index 916534e..5d17428 100644
--- a/continuum-webapp-test/Readme.txt
+++ b/continuum-webapp-test/Readme.txt
@@ -6,21 +6,34 @@
* in Selenium IDE, modify the Base URL if necessary (for example, http://localhost:8080/continuum)
* in Selenium IDE, click the 'Play entire test suite' icon
-Run Selenium tests in src/test/it with Maven and Cargo using support for multiple data sources
- * modify src/test/resources/it.properties as needed
+Run Selenium tests in src/test/testNG with Maven, TestNG and Cargo
+ * Start Continuum
+ * modify src/test/resources/testng.properties as needed
* mvn clean install
-Run Selenium tests in src/test/java with Maven and Cargo with alternate configuration
+Run Selenium tests against an existing Continuum instance
+ * mvn clean install -DbaseUrl=http://localhost:9595/continuum
+
+ (This skips the Cargo plugin configuration that starts a container with the Continuum webapp deployed)
+
+Run Selenium tests in an alternate browser
+ * mvn clean install -Dbrowser=iexplore (or -Dbrowser=safari or -Dbrowser=other -DbrowserPath=/path/to/browser)
+
+Change the port the embedded selenium runs on
+ * mvn clean install -DseleniumPort=4444
+
+Run Selenium tests in an running Selenium server or hub
+ * mvn clean install -DseleniumHost=localhost -DseleniumPort=4444
+
+Run Selenium tests in src/test/it with Maven, JUnit and Cargo
+ * modify src/test/resources/it.properties as needed
+ * mvn clean install -f junit-pom.xml
+
+Run Selenium tests in src/test/java with Maven and JUnit
* modify src/test/resources/it.properties as needed
* edit pom.xml and remove <testSourceDirectory>
* for snapshot version of selenium(1.0-beta-SNAPSHOT), modify settings.xml/pom.xml to point to this repository http://nexus.openqa.org/content/repositories/snapshots
- * mvn clean install
-
-Run Selenium tests in src/test/testNG with Maven and testNG
- * Start Continuum
- * Config admin user for continuum application
- * modify src/test/resources/testng.properties as needed
- * mvn clean install -f testng-pom.xml
+ * mvn clean install -f junit-pom.xml
Note that this does not install anything, it simply runs through the lifecycle including the integration test phases.
More properly it would be 'mvn clean post-integration-test', but install is much shorter to type. :)
diff --git a/continuum-webapp-test/pom.xml b/continuum-webapp-test/pom.xml
index 8908766..e301179 100644
--- a/continuum-webapp-test/pom.xml
+++ b/continuum-webapp-test/pom.xml
@@ -28,16 +28,17 @@
<name>Continuum :: Webapp Tests</name>
<packaging>pom</packaging>
- <repositories>
- <repository>
- <id>openqa-snapshots</id>
- <url>http://nexus.openqa.org/content/repositories/snapshots</url>
- <releases><enabled>false</enabled></releases>
- </repository>
- </repositories>
-
<build>
- <testSourceDirectory>src/test/it</testSourceDirectory>
+ <testSourceDirectory>src/test/testng</testSourceDirectory>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -66,113 +67,15 @@
</executions>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <version>1.0-rc-1</version>
- <executions>
- <execution>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start-server</goal>
- </goals>
- <configuration>
- <background>true</background>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <wait>false</wait>
- </configuration>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <container>
- <containerId>${container.name}</containerId>
- <zipUrlInstaller>
- <url>${container.url}</url>
- <installDir>${project.build.directory}/installs/${container.name}</installDir>
- </zipUrlInstaller>
- <log>${project.build.directory}/logs/${container.name}.log</log>
- <output>${project.build.directory}/logs/${container.name}.out</output>
- <timeout>600000</timeout>
- <systemProperties>
- <appserver.base>${project.build.directory}</appserver.base>
- <derby.system.home>${project.build.directory}</derby.system.home>
- </systemProperties>
- <dependencies>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </dependency>
- </dependencies>
- </container>
- <configuration>
- <home>${project.build.directory}/${container.name}</home>
- <type>standalone</type>
- <properties>
- <cargo.servlet.port>9595</cargo.servlet.port>
- <cargo.datasource.datasource.users>
- cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
- cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/users;create=true|
- cargo.datasource.jndi=jdbc/users|
- cargo.datasource.username=sa
- </cargo.datasource.datasource.users>
- <cargo.datasource.datasource.builds>
- cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
- cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/builds;create=true|
- cargo.datasource.jndi=jdbc/continuum|
- cargo.datasource.username=sa
- </cargo.datasource.datasource.builds>
- <cargo.resource.resource.mail>
- cargo.resource.name=mail/Session|
- cargo.resource.type=javax.mail.Session|
- cargo.resource.factory=org.apache.naming.factory.MailSessionFactory|
- cargo.resource.parameters=mail.smtp.host=localhost
- </cargo.resource.resource.mail>
- </properties>
- <deployables>
- <deployable>
- <groupId>${project.goupId}</groupId>
- <artifactId>continuum-webapp</artifactId>
- <type>war</type>
- <properties>
- <context>continuum</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Better to be able to see the results output from the listener as we go -->
+ <redirectTestOutputToFile>false</redirectTestOutputToFile>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/testng/config/testng.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
<executions>
<execution>
<id>integration-tests</id>
@@ -180,34 +83,58 @@
<goals>
<goal>test</goal>
</goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>baseUrl</name>
+ <value>${baseUrl}</value>
+ </property>
+ <property>
+ <name>browser</name>
+ <value>${browser}</value>
+ </property>
+ <property>
+ <name>seleniumHost</name>
+ <value>${seleniumHost}</value>
+ </property>
+ <property>
+ <name>seleniumPort</name>
+ <value>${seleniumPort}</value>
+ </property>
+ </systemProperties>
+ </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
+
<dependencies>
<dependency>
- <groupId>org.openqa.selenium.client-drivers</groupId>
- <artifactId>selenium-java-client-driver</artifactId>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
<scope>test</scope>
+ <classifier>jdk15</classifier>
</dependency>
+
<dependency>
- <groupId>org.openqa.selenium.client-drivers</groupId>
- <artifactId>selenium-java-client-driver</artifactId>
- <version>1.0-beta-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
<version>1.4</version>
- <scope>test</scope>
- </dependency>
+ </dependency>
<!-- deployables -->
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-buildagent-webapp</artifactId>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
@@ -215,33 +142,284 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
+ <version>10.1.3.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
+ <version>1.4</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
+ <version>1.1</version>
</dependency>
+
+ <!-- dependencies below are for code in src/test/it -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.server</groupId>
+ <artifactId>selenium-server</artifactId>
+ <version>1.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
</dependencies>
<profiles>
<profile>
+ <id>create-container</id>
+ <activation>
+ <property>
+ <name>!container</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <container>
+ <containerId>${container.name}</containerId>
+ <zipUrlInstaller>
+ <url>${container.url}</url>
+ <installDir>${cargo.installs.directory}/${container.name}</installDir>
+ </zipUrlInstaller>
+ <log>${project.build.directory}/logs/${container.name}.log</log>
+ <output>${project.build.directory}/logs/${container.name}.out</output>
+ <timeout>600000</timeout>
+ <systemProperties>
+ <appserver.base>${project.build.directory}</appserver.base>
+ <derby.system.home>${project.build.directory}</derby.system.home>
+ <svn.base.url>${svn.base.url}</svn.base.url>
+ </systemProperties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </dependency>
+ </dependencies>
+ </container>
+ <configuration>
+ <home>${project.build.directory}/${container.name}</home>
+ <type>standalone</type>
+ <properties>
+ <cargo.servlet.port>9595</cargo.servlet.port>
+ <cargo.jvmargs>-Xmx512m -XX:MaxPermSize=128m</cargo.jvmargs>
+ <cargo.datasource.datasource.users>
+ cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
+ cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/users;create=true|
+ cargo.datasource.jndi=jdbc/users|
+ cargo.datasource.username=sa
+ </cargo.datasource.datasource.users>
+ <cargo.datasource.datasource.builds>
+ cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
+ cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/builds;create=true|
+ cargo.datasource.jndi=jdbc/continuum|
+ cargo.datasource.username=sa
+ </cargo.datasource.datasource.builds>
+ <cargo.resource.resource.mail>
+ cargo.resource.name=mail/Session|
+ cargo.resource.type=javax.mail.Session|
+ cargo.resource.factory=org.apache.naming.factory.MailSessionFactory|
+ cargo.resource.parameters=mail.smtp.host=localhost
+ </cargo.resource.resource.mail>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>continuum-webapp</artifactId>
+ <type>war</type>
+ <properties>
+ <context>continuum</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>continuum-buildagent-webapp</artifactId>
+ <type>war</type>
+ <properties>
+ <context>continuum-buildagent</context>
+ </properties>
+ </deployable>
+ <!-- Test resources -->
+ <deployable>
+ <location>${basedir}/src/test/example-projects</location>
+ <type>war</type>
+ <properties>
+ <context>example-projects</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}">
+ <fileset dir="src/appserver-base" />
+ </copy>
+ <delete dir="${project.build.directory}/example-svn" />
+ <copy todir="${project.build.directory}/example-svn">
+ <fileset dir="src/test/example-svn" />
+ </copy>
+ <!-- This doesn't work, SVN doesn't like the file:/ URL it gives
+ <makeurl file="${project.build.directory}/example-svn" property="svn.base.url"/>
+ -->
+ <path id="svn.repo.dir">
+ <pathelement location="${project.build.directory}/example-svn" />
+ </path>
+ <pathconvert refid="svn.repo.dir" targetos="unix" property="svn.base.url"/>
+ <echo file="${project.build.directory}/filter.properties">
+ svn.base.url=file://localhost/${svn.base.url}
+ </echo>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>read-project-properties</goal>
+ </goals>
+ <configuration>
+ <files>
+ <file>${project.build.directory}/filter.properties</file>
+ </files>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>start-selenium</id>
+ <activation>
+ <property>
+ <name>!seleniumHost</name>
+ </property>
+ </activation>
+ <properties>
+ <seleniumHost>localhost</seleniumHost>
+ <seleniumPort>4444</seleniumPort>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <background>true</background>
+ <port>${seleniumPort}</port>
+ <logOutput>true</logOutput>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>tomcat5x</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <property>
+ <name>!container</name>
+ </property>
</activation>
<properties>
<container.name>tomcat5x</container.name>
- <container.url>http://apache.mirrors.redwire.net/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip
- </container.url>
+ <container.url>http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip</container.url>
+ </properties>
+ </profile>
+ <profile>
+ <id>existing-container</id>
+ <activation>
+ <property>
+ <name>!baseUrl</name>
+ </property>
+ </activation>
+ <properties>
+ <baseUrl>http://localhost:9595/continuum/</baseUrl>
</properties>
</profile>
<profile>
<id>firefox</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <property>
+ <name>!browser</name>
+ </property>
</activation>
<properties>
<browser>*firefox</browser>
@@ -249,17 +427,88 @@
</profile>
<profile>
<id>iexplore</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>iexplore</value>
+ </property>
+ </activation>
<properties>
<browser>*iexplore</browser>
</properties>
</profile>
<profile>
+ <id>safari</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>safari</value>
+ </property>
+ </activation>
+ <properties>
+ <browser>*safari</browser>
+ </properties>
+ </profile>
+ <profile>
<id>otherbrowser</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>other</value>
+ </property>
+ </activation>
<properties>
<browser>*custom ${browserPath}</browser>
</properties>
</profile>
-
+ <profile>
+ <id>headless</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>xvfb</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>xvfb</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>reporting</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>report-only</id>
+ <goals>
+ <goal>report-only</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
-
+ <properties>
+ <cargo.installs.directory>${basedir}/cargo-installs</cargo.installs.directory>
+ </properties>
</project>
diff --git a/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml b/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml
new file mode 100644
index 0000000..f286340
--- /dev/null
+++ b/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+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.
+-->
+
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:9595/continuum/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>target/data/build-agent/build-output-directory</buildOutputDirectory>
+ <workingDirectory>target/data/build-agent/working-directory</workingDirectory>
+</continuum-buildagent-configuration>
diff --git a/continuum-webapp-test/src/site/apt/index.apt b/continuum-webapp-test/src/site/apt/index.apt
new file mode 100644
index 0000000..1ab45e1
--- /dev/null
+++ b/continuum-webapp-test/src/site/apt/index.apt
@@ -0,0 +1,503 @@
+ ----
+ Continuum Webapp Test
+ ----
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+
+Continuum Webapp Test
+
+* Contents
+
+ * {{{About_the_Continuum_Webapp_Tests}About the Continuum Webapp Tests}}
+
+ * {{Pre-requisites}}
+
+ * {{{Getting_the_Source_from_the_Repository} Getting the Source from the Repository}}
+
+ * {{{Running_the_Tests} Running the Tests}}
+
+ * {{{Viewing_the_Test_Results} Viewing the Test Results}}
+
+ * {{{Test_Coverage}Test Coverage}}
+
+ * {{{Adding_New_Tests} Adding New Tests}}
+
+ * {{{Improving_the_Existing_Tests} Improving the Existing Tests}}
+
+ * {{{Creating_Patches} Creating Patches}}
+
+ * {{{Submitting_Patches} Submitting Patches}}
+
+
+* {About the Continuum Webapp Tests}
+
+ {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test}Continuum web app tests}} depends on {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp} continuum-webapp}} module of Continuum. It depends on a successful build result in {{{https://svn.apache.org/repos/asf/continuum/trunk} continuum-trunk}}.
+
+** Automation Tool
+
+ The module makes use of the latest {{{http://seleniumhq.org/projects/remote-control/} Selenium Remote Control}} release (1.0.1)
+
+ * {{{http://release.seleniumhq.org/selenium-remote-control/1.0-beta-2/doc/java/} selenium-java-client-driver}}
+
+ * {{{http://release.seleniumhq.org/selenium-remote-control/1.0-beta-2/doc/server/} selenium-server}}
+
+ <Note: Documents for 1.0.1 are not yet available for both selenium java client driver and selenium server. The above links direct to 1.0-beta-2 docs.>
+
+** Maven Plugins
+
+ The module makes use of the following maven plugins:
+
+ * {{{http://cargo.codehaus.org/Maven2+plugin} cargo-maven2-plugin}} who is in-charge on the start-up of the container {{{http://apache.mirrors.redwire.net/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip]} tomcat5x}}, deployment of the application to the container and stopping the container.
+
+ * {{{http://mojo.codehaus.org/selenium-maven-plugin/} selenium-maven-plugin}} who is in-charge on starting/stopping the selenium server, running a suite of HTML Selenese tests and starting an Xvfb instance suitable for handling X11 displays for headless systems.
+
+ *{{{http://maven.apache.org/plugins/maven-surefire-plugin/} maven-surefire-plugin}} and {{{http://maven.apache.org/plugins/maven-surefire-report-plugin/} maven-surefire-report-plugin}} for reporting.
+
+** Testing Framework
+
+ Continuum web app tests module uses TestNG for the following reasons:
+
+ * flexibility (coding convention),
+
+ * dependency testing (skipping not failing),
+
+ * fail and rerun (handy in large test suite) and
+
+ * parametric testing ( reusing generic test) features.
+
+ More on TestNG {{{http://testng.org/doc/documentation-main.html}here}}.
+
+ View the module's pom.xml {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/pom.xml}here}}
+
+* {Pre-requisites}
+
+ * {{{http://java.sun.com/javase/downloads/index.jsp}JDK 1.5 or higher}}
+
+ * {{{http://maven.apache.org/download.html}Maven 2.0.9 or higher}}
+
+ * {{{http://subversion.tigris.org/}Subversion}}
+
+ Installation instructions for Windows and Unix-based systems can be found {{{http://maven.apache.org/download.html}here}}
+
+* {Getting the Source from the Repository}
+
+ Checkout continuum trunk {{{https://svn.apache.org/repos/asf/continuum/trunk}here}}.
+
++-----------------------------------------------------------------------------+
+svn co https://svn.apache.org/repos/asf/continuum/trunk continuum-trunk
+or
+svn co http://svn.apache.org/repos/asf/continuum/trunk continuum-trunk
++-----------------------------------------------------------------------------+
+
+* {Running the Tests}
+
+ Getting started with the tests:
+
+ After getting the source from the repository, execute the following:
+
++-----------------------------------------------------------------------------+
+cd /path/to/continuum-trunk/
+mvn clean install
++-----------------------------------------------------------------------------+
+
+
+ <<Reminder: Continuum-trunk must have a successful build or else there's no way to run continuum-webapp-test successfully.>>
+
+
++-----------------------------------------------------------------------------+
+cd /path/to/continuum-trunk/continuum-webapp-test/
++-----------------------------------------------------------------------------+
+
+ Default configuration (i.e. App's Base URL, Selenium Host, Selenium Port's values, etc.) are stored in a property file that can be found in <</path/to/continuum-trunk/continuum-webapp-test/src/test/resources/testng.properties>> (or {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties}here}}). You may change the values in it before executing the next command.
+
++-----------------------------------------------------------------------------+
+mvn clean install
++-----------------------------------------------------------------------------+
+
+ This command will:
+
+ * build the application from source
+
+ * deploy the packaged application to a container and start it
+
+ * start the selenium server
+
+ * start the selenium tests by launching the selenium test runner and the application under test (AUT)
+
+ For every test failure encountered, {{{http://testng.org/doc/documentation-main.html#logging-listeners}TestNG Listeners}} will call selenium's windowMaximize and captureEntirePageScreenshot commands. This will maximize the application-under-test (AUT) browser then do a screen capture of the page and saves it as an image file with .png extension.
+
+ View the code {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java}here}}
+
+ * kill the selenium server after the tests are done
+
+ * stop the app server (container)
+
+ * return the results of the build (summary, reports, screen shots)
+
+[]
+
+** {Running selected tests by editing testng.xml}
+
+ Continuum web app tests is invoked with a {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml}testng.xml}} file. The contents of that xml file is displayed below and/or this could be found in <</path/to/continuum-trunk/continuum-webapp-test/src/test/testng/config/>> directory.
+
++---------------------------------------------------------+
+<suite name="ContinuumTest" verbose="1">
+ <test name="BasicTest" enabled="true">
+ <groups>
+ <run>
+ <include name="about" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test" />
+ </packages>
+ </test>
+ <test name="AdminTest" enabled="true">
+ <groups>
+ <run>
+ <include name="login" />
+ <include name="mavenTwoProject"/>
+ <include name="projectGroup" />
+ <include name="mavenOneProject" />
+ <include name="antProject" />
+ <include name="shellProject" />
+ <include name="buildDefinition" />
+ <include name="notifier" />
+ <include name="schedule" />
+ <include name="myAccount" />
+ <include name="queue" />
+ <include name="purge" />
+ <include name="repository" />
+ <include name="configuration" />
+ <include name="installation" />
+ <include name="buildEnvironment" />
+ <include name="buildDefinitionTemplate" />
+ <include name="userroles"/>
+ <include name="agent"/>
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test" />
+ </packages>
+ </test>
+</suite>
++---------------------------------------------------------+
+
+ The order of the build when running the tests is defined in the annotations of each test. Groups are divided into unit tests. If want to run a specific test, you may edit the testng.xml file and exclude the undesired tests to be ran.
+
++---------------------------------------------------------+
+Example:
+
+<test name="AdminTest" enabled="true">
+ <groups>
+ <run>
+ <include name="login" />
+ <exclude name="mavenTwoProject"/>
+ <exclude name="projectGroup" />
+ <exclude name="mavenOneProject" />
+ <include name="antProject" />
+ <exclude name="shellProject" />
+ ...
+ ...
+ ...
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test" />
+ </packages>
+ </test>
++---------------------------------------------------------+
+
+ More information about testng.xml {{{http://testng.org/doc/documentation-main.html#testng-xml}here}}.
+
+
+** Running the tests with different container and/or browsers
+
+*** Running Selenium tests in an alternate browser
+
+ Modify src/test/resources/testng.properties as needed then execute:
+
++---------------------------------------------------------+
+mvn clean install -Dbrowser=iexplore (or -Dbrowser=safari or -Dbrowser=other -DbrowserPath=/path/to/browser)
++---------------------------------------------------------+
+
+*** Running Selenium tests against an existing Continuum instance
+
+ Modify src/test/resources/testng.properties as needed, then execute:
+
++---------------------------------------------------------+
+mvn clean install -Dexisting-container
++---------------------------------------------------------+
+
+ (This skips the Cargo plugin configuration that starts a container with the Continuum webapp deployed)
+
+*** Test with Firefox and Selenium IDE
+
+ continuum-webapp-test also has Selenium IDE scripts. Here's how you should run it:
+
+ * Start Continuum
+
+ * Open Firefox and navigate to Continuum (it should be on the "Create Admin User" page.)
+
+ * in Firefox, Tools -> Selenium IDE
+
+ * in Selenium IDE, File -> Open Test Suite and choose src/test/selenium-ide/continuum_test_suite.html
+
+ * in Selenium IDE, modify the Base URL if necessary (for example, http://localhost:8080/continuum)
+
+ * in Selenium IDE, click the 'Play entire test suite' icon
+
+* {Viewing the Test Results}
+
+** Surefire-reports
+
+ After running the continuum webapp tests, cd to <</path/to/continuum-trunk/continuum-webapp-test/target/surefire-reports/>> and open the index.html file.
+
+ Click the 'ContinuumTest' suite link
+
+ Click the 'Results' link to view the summary of the tests. (Passed/Failed/Skipped)
+
+** Screenshots
+
+ If there are test failures, cd to <</path/to/continuum-trunk/continuum-webapp-test/target/screenshots/>> to view the captured image files.
+
+ Screen shots are saved with the format "methodName(className.java_lineNumber)-time.png" in order to easily debug the error encountered.
+
+* {Test Coverage}
+
+ Test scripts available {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/}here}} automate the various {{{http://continuum.apache.org/features.html}features}} of Continuum. Listed below are the existing scripts with which you can help improve the testing process or you may contribute on any areas you see not covered.
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AboutTest.java}About}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java}Login}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MyAccountTest.java}My Account}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java}Project Groups}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java}Maven 1.0.X Projects}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java}Maven 2.0.X Projects}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java}Ant Projects}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java}Shell Projects}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LocalRepositoriesTest.java}Local Repository}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java}Installation}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/PurgeTest.java}Purge Configurations}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java}Schedules}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java}Configurations}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java}User Roles Management}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java}Build Environments}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java}Queues}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java}Build Definition}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java}Build Definition Templates}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java}Distributed Builds}}
+
+ * {{{https://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java}Build Notification}}
+
+ []
+
+** Continuum Feature/s for development:
+
+ * Release Projects
+
+[]
+
+ If you would like to be involved, start by reading the Continuum {{{http://continuum.apache.org/docs/}documentation}} to familiarize yourself with the features of the application.
+
+
+* {Adding New Tests}
+
+ This section will guide you on how to contribute new script/s to run with the existing ones.
+
+ You can find out what features already have tests by looking at the source code of the scripts on the {{{Test_Coverage} Test Coverage}} section. If you look at the scripts, you can see which features have lots of tests and which need more. But note that even if the coverage looks good, there may be more interesting tests to write.
+
+** Directory where to add new tests
+
+ Once you have written a good test scenario, the script must be placed in this directory:
+
++---------------------------------------------------------+
+/path/to/continuum-trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/
++---------------------------------------------------------+
+
+ Put your abstract classes in this directory:
+
++---------------------------------------------------------+
+/path/to/continuum-trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/
++---------------------------------------------------------+
+
+~~** Order where to put the new class
+** Editing the testng.xml file to include the new class / group
+
+ * Edit the testng.xml (refer to {{{Running_selected_tests_by_editing_testng.xml} Editing testng.xml}}) to include the newly created script.
+
+ * Run the test suite (refer to {{{Running_the_Tests} Running the Tests}}) to check if it will build successfully.
+
+ []
+ Once you have a successful build in continuum-webapp-test, you are now ready to create a patch and submit your work to the community. Just follow the guidelines on the {{{Creating_Patches} Creating Patches}} and {{{Submitting_Patches} Submitting Patches}} section.
+
+* {Improving the Existing Tests}
+
+ The listed items on continuum-webapp-test Test Coverage are not yet complete. Releasing Projects is one of the features listed for development but basically, the existing scripts still have missing scenarios that need to be completed, such as:
+
+ [[1]] Functions of Continuum Features to Projects
+
+ * Wide use of Continuum features to different projects (i.e. the use of different build definitions, schedules, queues, agent, etc. ) --ant, shell, maven1, maven2.
+
+
+ []
+
+ [[2]] User Roles Test
+
+ * User roles tests only have scripts for assertion of elements on the specific roles. Tests for user roles should include its specific function on Continuum.
+
+ []
+
+ [[3]]Logo / Headers / Footers
+
+ * Assertion of Logo / Headers / Footers on each page (or scenarios) are not yet implemented.
+
+ []
+
+ [[4]]Optimization of the Automation Tool and Test Framework
+
+ * Selenium and TestNG have lots of capabilities that will help improve the existing tests. Discussed below are the items that are not yet implemented on the existing tests:
+For reporting, the generated report of surefire for TestNG has a text and html file. Improving the html file that would link to the screenshots of the failed tests would help a lot.
+
+ * The wide use of TestNG, i.e. The use or @Parameters for values to be used on that specific test class. It will help developers not to be confused with regards to values that are placed in the property files (lots of values on that file) and those values will also be placed on the TestNG report.
+
+[]
+
+ As listed above, those are just examples on how to improve Continuum's existing tests. As you go along with the scripts, you may encounter scenarios that need to be modified so that it will be easily read by fellow developers. Tests contributions are welcome in this community. See {{{Adding_New_Tests} Adding New Tests}} section on how.
+
+
+
+* {Creating Patches}
+
+ After adding new tests or improving existing tests, the next step is to create a patch.
+
+ Below are the steps needed for creating patches:
+
+ * Update the version of the project's source.
+
++---------------------------------------------------------+
+svn up
++---------------------------------------------------------+
+
+ * Ensure that the project will build successfully (from trunk) and that your modification will not break anything
+
++---------------------------------------------------------+
+mvn clean install
++---------------------------------------------------------+
+
+ * Go to the directory where the modifications are done. Verify if the module's build is working. (i.e. /path/to/continuum-trunk/continuum-webapp-test/)
+
++---------------------------------------------------------+
+mvn clean install
++---------------------------------------------------------+
+
+ * After a successful build, add the new tests to version control.
+
+
+ Directory:
+
++---------------------------------------------------------+
+svn add /path/to/the/new_module/
++---------------------------------------------------------+
+
+
+ File:
+
++---------------------------------------------------------+
+svn add /path/to/the/new_module/file.extension
++---------------------------------------------------------+
+
+ Note: If the modifications are made to the existing files which are already under version control, there is no need to do "svn add".
+
+ * Create the patch from the trunk
+
++---------------------------------------------------------+
+cd /path/to/continuum-trunk/
++---------------------------------------------------------+
+
++---------------------------------------------------------+
+svn diff > PatchName.patch
++---------------------------------------------------------+
+
+ * Verify the content of the generated patch by viewing the file using any text editor. It should display all the intended changes.
+
+* {Submitting Patches}
+
+ After creating the patch, the next step is to contribute by sending the patch to the community!
+
+ * If you don't have a codehaus jira account yet, sign up {{{http://jira.codehaus.org/secure/Signup!default.jspa} here}}
+
+ * Login using your account
+
+ * Go to {{{http://jira.codehaus.org/browse/CONTINUUM}Continuum}} project
+
+ * Create a new issue with the appropriate issue type (bug, improvement, feature, test, etc)
+
+ * Provide a good summary
+
++---------------------------------------------------------+
+New Tests for X Feature
+or
+Improve Tests for an Existing X Feature
++---------------------------------------------------------+
+
+ * Provide the environment details
+
++---------------------------------------------------------+
+Windows/Linux/Mac
+Maven version
+Java version
++---------------------------------------------------------+
+
+ * Provide the description
+
++---------------------------------------------------------+
+Describe what the patch is for. (changes made to the existing version)
+Post the results of the build (test runs, failures, errors etc)
++---------------------------------------------------------+
+
+ * Don't forget to add your patch as an attachment. Tick the 'Patch Submitted' box then click the 'Create' button.
+
+
+ <<If nothing happens in a few days, write to the {{{mailto:dev@continuum.apache.org}dev list}} and nudge the developers to review your patch.>>
+
+
+
+
+
diff --git a/continuum-webapp-test/src/test/example-projects/ant/build.xml b/continuum-webapp-test/src/test/example-projects/ant/build.xml
new file mode 100644
index 0000000..9d19f47
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/ant/build.xml
@@ -0,0 +1,6 @@
+<project name="ant-project" default="build">
+ <target name="build">
+ <echo>Hello, Ant!</echo>
+ </target>
+</project>
+
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-2437-example/pom.xml b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/pom.xml
new file mode 100644
index 0000000..023a110
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/pom.xml
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum.examples</groupId>
+ <artifactId>continuum-2437-example</artifactId>
+ <packaging>jar</packaging>
+ <version>1.1-SNAPSHOT</version>
+ <name>Continuum 2437 Example Project</name>
+ <url>http://continuum.apache.org</url>
+
+ <scm>
+ <connection>scm:svn:${svn.base.url}/trunk/continuum-2437-example</connection>
+ <developerConnection>scm:svn:${svn.base.url}/trunk/continuum-2437-example</developerConnection>
+ <tag>${svn.base.url}/tags/continuum-2437-example-1.0</tag>
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/main/java/org/apache/continuum/examples/App.java b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/main/java/org/apache/continuum/examples/App.java
new file mode 100644
index 0000000..82e058d
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/main/java/org/apache/continuum/examples/App.java
@@ -0,0 +1,13 @@
+package org.apache.continuum.examples;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/test/java/org/apache/continuum/examples/AppTest.java b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/test/java/org/apache/continuum/examples/AppTest.java
new file mode 100644
index 0000000..e521181
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-2437-example/src/test/java/org/apache/continuum/examples/AppTest.java
@@ -0,0 +1,38 @@
+package org.apache.continuum.examples;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/pom.xml b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/pom.xml
new file mode 100644
index 0000000..5e6b59c
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/pom.xml
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-build-queue-test-data</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>ContinuumBuildQueueTestData</name>
+ <description>Project for testing continuum build queue</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:${svn.base.url}/trunk/continuum-build-queue-test-data</connection>
+ <developerConnection>scm:svn:${svn.base.url}/trunk/continuum-build-queue-test-data</developerConnection>
+ <url>${svn.base.url}/trunk/continuum-build-queue-test-data</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testResources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/java/config/testng.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+
+ <developers>
+ <developer>
+ <id>blago</id>
+ <name>Bernard Lago</name>
+ <roles>
+ <role>QA Engineer</role>
+ </roles>
+ <timezone>+8</timezone>
+ </developer>
+ </developers>
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/config/testng.xml b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/config/testng.xml
new file mode 100644
index 0000000..8ae8fba
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/config/testng.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<!--
+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.
+-->
+
+<suite name="MaestroProjectServerTest" verbose="1">
+ <test name="BasicTest" enabled="true">
+
+ <packages>
+ <package name="org.apache.continuum.examples" />
+ </packages>
+ </test>
+</suite>
diff --git a/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/org/apache/continuum/examples/BasicThreadTest.java b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/org/apache/continuum/examples/BasicThreadTest.java
new file mode 100644
index 0000000..b6ecf65
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/continuum-build-queue-test-data/src/test/java/org/apache/continuum/examples/BasicThreadTest.java
@@ -0,0 +1,16 @@
+package org.apache.continuum.examples;
+
+import org.testng.annotations.Test;
+
+public class BasicThreadTest {
+
+ @Test
+ public void testThread() {
+ try {
+ long numMillisecondsToSleep = 60000; // 1 * 60 seconds
+ Thread.sleep(numMillisecondsToSleep);
+ } catch (InterruptedException e) {
+ }
+ }
+
+}
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/pom.xml b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/pom.xml
new file mode 100644
index 0000000..eefc524
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/pom.xml
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.example.flat</groupId>
+ <artifactId>flat-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>flat-core</artifactId>
+ <packaging>jar</packaging>
+ <name>flat-core</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/main/java/com/example/flat/App.java b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/main/java/com/example/flat/App.java
new file mode 100644
index 0000000..bdcf5a4
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/main/java/com/example/flat/App.java
@@ -0,0 +1,13 @@
+package com.example.flat;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/test/java/com/example/flat/AppTest.java b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/test/java/com/example/flat/AppTest.java
new file mode 100644
index 0000000..d35ea33
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-core/src/test/java/com/example/flat/AppTest.java
@@ -0,0 +1,38 @@
+package com.example.flat;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-parent/pom.xml b/continuum-webapp-test/src/test/example-projects/flat-example/flat-parent/pom.xml
new file mode 100644
index 0000000..64c6855
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-parent/pom.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example.flat</groupId>
+ <artifactId>flat-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Flat Example</name>
+
+ <scm>
+ <connection>scm:svn:${svn.base.url}/trunk/flat-example/flat-parent</connection>
+ <developerConnection>scm:svn:${svn.base.url}/trunk/flat-example/flat-parent</developerConnection>
+ </scm>
+
+ <modules>
+ <module>../flat-webapp</module>
+ <module>../flat-core</module>
+ </modules>
+
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/pom.xml b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/pom.xml
new file mode 100644
index 0000000..a08265f
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/pom.xml
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.example.flat</groupId>
+ <artifactId>flat-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>flat-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>flat-webapp Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.example.flat</groupId>
+ <artifactId>flat-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>flat-webapp</finalName>
+ </build>
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/WEB-INF/web.xml b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..9f88c1f
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>Archetype Created Web Application</display-name>
+</web-app>
diff --git a/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/index.jsp b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/index.jsp
new file mode 100644
index 0000000..c38169b
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/flat-example/flat-webapp/src/main/webapp/index.jsp
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml b/continuum-webapp-test/src/test/example-projects/maven-one-projects/extend-element-project.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml
rename to continuum-webapp-test/src/test/example-projects/maven-one-projects/extend-element-project.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml b/continuum-webapp-test/src/test/example-projects/maven-one-projects/missing-repository-element-project.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml
rename to continuum-webapp-test/src/test/example-projects/maven-one-projects/missing-repository-element-project.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-one-projects/unparseable-content-project.xml b/continuum-webapp-test/src/test/example-projects/maven-one-projects/unparseable-content-project.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-one-projects/unparseable-content-project.xml
rename to continuum-webapp-test/src/test/example-projects/maven-one-projects/unparseable-content-project.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-one-projects/valid-project.xml b/continuum-webapp-test/src/test/example-projects/maven-one-projects/valid-project.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-one-projects/valid-project.xml
rename to continuum-webapp-test/src/test/example-projects/maven-one-projects/valid-project.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-connection-element-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-connection-element-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-modules-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-modules-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-modules-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-modules-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-parent-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-parent-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-parent-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-parent-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-scm-element-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-scm-element-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-type-element-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-type-element-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-type-element-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/missing-type-element-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module1/pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module1/pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module1/pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module1/pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module2/pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module2/pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module2/pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/maven-two-multi-module-project-module2/pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/multi-module-maven-project/pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/multi-module-maven-project/pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/specified-notifiers-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/specified-notifiers-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/specified-notifiers-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/specified-notifiers-pom.xml
diff --git a/continuum-webapp-test/src/test/resources/unit/maven-two-projects/valid-pom.xml b/continuum-webapp-test/src/test/example-projects/maven-two-projects/valid-pom.xml
similarity index 100%
rename from continuum-webapp-test/src/test/resources/unit/maven-two-projects/valid-pom.xml
rename to continuum-webapp-test/src/test/example-projects/maven-two-projects/valid-pom.xml
diff --git a/continuum-webapp-test/src/test/example-projects/shell/bad-build.sh b/continuum-webapp-test/src/test/example-projects/shell/bad-build.sh
new file mode 100755
index 0000000..fb8d38c
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/shell/bad-build.sh
@@ -0,0 +1,5 @@
+
+
+echo "Build script..."
+echo "FAILURE!"
+exit 1
diff --git a/continuum-webapp-test/src/test/example-projects/shell/build.sh b/continuum-webapp-test/src/test/example-projects/shell/build.sh
new file mode 100755
index 0000000..f4cd72b
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/shell/build.sh
@@ -0,0 +1,5 @@
+
+
+echo "Build script..."
+
+exit 0
diff --git a/continuum-webapp-test/src/test/example-projects/simple-example/pom.xml b/continuum-webapp-test/src/test/example-projects/simple-example/pom.xml
new file mode 100644
index 0000000..a77fad5
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/simple-example/pom.xml
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.continuum.examples.simple</groupId>
+ <artifactId>simple-example</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>Continuum Simple Example Project</name>
+ <url>http://continuum.apache.org</url>
+
+ <scm>
+ <connection>scm:svn:${svn.base.url}/trunk/simple-example</connection>
+ <developerConnection>scm:svn:${svn.base.url}/trunk/simple-example</developerConnection>
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/continuum-webapp-test/src/test/example-projects/simple-example/src/main/java/org/apache/continuum/examples/App.java b/continuum-webapp-test/src/test/example-projects/simple-example/src/main/java/org/apache/continuum/examples/App.java
new file mode 100644
index 0000000..82e058d
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/simple-example/src/main/java/org/apache/continuum/examples/App.java
@@ -0,0 +1,13 @@
+package org.apache.continuum.examples;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-projects/simple-example/src/test/java/org/apache/continuum/examples/AppTest.java b/continuum-webapp-test/src/test/example-projects/simple-example/src/test/java/org/apache/continuum/examples/AppTest.java
new file mode 100644
index 0000000..e521181
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-projects/simple-example/src/test/java/org/apache/continuum/examples/AppTest.java
@@ -0,0 +1,38 @@
+package org.apache.continuum.examples;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/continuum-webapp-test/src/test/example-svn/README.txt b/continuum-webapp-test/src/test/example-svn/README.txt
new file mode 100644
index 0000000..3bf5a57
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/README.txt
@@ -0,0 +1,5 @@
+This is a Subversion repository; use the 'svnadmin' tool to examine
+it. Do not add, delete, or modify files here unless you know how
+to avoid corrupting the repository.
+
+Visit http://subversion.tigris.org/ for more information.
diff --git a/continuum-webapp-test/src/test/example-svn/conf/authz b/continuum-webapp-test/src/test/example-svn/conf/authz
new file mode 100644
index 0000000..0b9a410
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/conf/authz
@@ -0,0 +1,32 @@
+### This file is an example authorization file for svnserve.
+### Its format is identical to that of mod_authz_svn authorization
+### files.
+### As shown below each section defines authorizations for the path and
+### (optional) repository specified by the section name.
+### The authorizations follow. An authorization line can refer to:
+### - a single user,
+### - a group of users defined in a special [groups] section,
+### - an alias defined in a special [aliases] section,
+### - all authenticated users, using the '$authenticated' token,
+### - only anonymous users, using the '$anonymous' token,
+### - anyone, using the '*' wildcard.
+###
+### A match can be inverted by prefixing the rule with '~'. Rules can
+### grant read ('r') access, read-write ('rw') access, or no access
+### ('').
+
+[aliases]
+# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
+
+[groups]
+# harry_and_sally = harry,sally
+# harry_sally_and_joe = harry,sally,&joe
+
+# [/foo/bar]
+# harry = rw
+# &joe = r
+# * =
+
+# [repository:/baz/fuz]
+# @harry_and_sally = rw
+# * = r
diff --git a/continuum-webapp-test/src/test/example-svn/conf/passwd b/continuum-webapp-test/src/test/example-svn/conf/passwd
new file mode 100644
index 0000000..ecaa08d
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/conf/passwd
@@ -0,0 +1,8 @@
+### This file is an example password file for svnserve.
+### Its format is similar to that of svnserve.conf. As shown in the
+### example below it contains one section labelled [users].
+### The name and password for each user follow, one account per line.
+
+[users]
+# harry = harryssecret
+# sally = sallyssecret
diff --git a/continuum-webapp-test/src/test/example-svn/conf/svnserve.conf b/continuum-webapp-test/src/test/example-svn/conf/svnserve.conf
new file mode 100644
index 0000000..e62a01e
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/conf/svnserve.conf
@@ -0,0 +1,47 @@
+### This file controls the configuration of the svnserve daemon, if you
+### use it to allow access to this repository. (If you only allow
+### access through http: and/or file: URLs, then this file is
+### irrelevant.)
+
+### Visit http://subversion.tigris.org/ for more information.
+
+[general]
+### These options control access to the repository for unauthenticated
+### and authenticated users. Valid values are "write", "read",
+### and "none". The sample settings below are the defaults.
+# anon-access = read
+# auth-access = write
+### The password-db option controls the location of the password
+### database file. Unless you specify a path starting with a /,
+### the file's location is relative to the directory containing
+### this configuration file.
+### If SASL is enabled (see below), this file will NOT be used.
+### Uncomment the line below to use the default password file.
+# password-db = passwd
+### The authz-db option controls the location of the authorization
+### rules for path-based access control. Unless you specify a path
+### starting with a /, the file's location is relative to the the
+### directory containing this file. If you don't specify an
+### authz-db, no path-based access control is done.
+### Uncomment the line below to use the default authorization file.
+# authz-db = authz
+### This option specifies the authentication realm of the repository.
+### If two repositories have the same authentication realm, they should
+### have the same password database, and vice versa. The default realm
+### is repository's uuid.
+# realm = My First Repository
+
+[sasl]
+### This option specifies whether you want to use the Cyrus SASL
+### library for authentication. Default is false.
+### This section will be ignored if svnserve is not built with Cyrus
+### SASL support; to check, run 'svnserve --version' and look for a line
+### reading 'Cyrus SASL authentication is available.'
+# use-sasl = true
+### These options specify the desired strength of the security layer
+### that you want SASL to provide. 0 means no encryption, 1 means
+### integrity-checking only, values larger than 1 are correlated
+### to the effective key length for encryption (e.g. 128 means 128-bit
+### encryption). The values below are the defaults.
+# min-encryption = 0
+# max-encryption = 256
diff --git a/continuum-webapp-test/src/test/example-svn/db/current b/continuum-webapp-test/src/test/example-svn/db/current
new file mode 100644
index 0000000..0f7183a
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/current
@@ -0,0 +1 @@
+2 6i 1
diff --git a/continuum-webapp-test/src/test/example-svn/db/format b/continuum-webapp-test/src/test/example-svn/db/format
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/format
@@ -0,0 +1 @@
+1
diff --git a/continuum-webapp-test/src/test/example-svn/db/fs-type b/continuum-webapp-test/src/test/example-svn/db/fs-type
new file mode 100644
index 0000000..4fdd953
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/fs-type
@@ -0,0 +1 @@
+fsfs
diff --git a/continuum-webapp-test/src/test/example-svn/db/fsfs.conf b/continuum-webapp-test/src/test/example-svn/db/fsfs.conf
new file mode 100644
index 0000000..0a5f1fe
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/fsfs.conf
@@ -0,0 +1,37 @@
+### This file controls the configuration of the FSFS filesystem.
+
+[memcached-servers]
+### These options name memcached servers used to cache internal FSFS
+### data. See http://www.danga.com/memcached/ for more information on
+### memcached. To use memcached with FSFS, run one or more memcached
+### servers, and specify each of them as an option like so:
+# first-server = 127.0.0.1:11211
+# remote-memcached = mymemcached.corp.example.com:11212
+### The option name is ignored; the value is of the form HOST:PORT.
+### memcached servers can be shared between multiple repositories;
+### however, if you do this, you *must* ensure that repositories have
+### distinct UUIDs and paths, or else cached data from one repository
+### might be used by another accidentally. Note also that memcached has
+### no authentication for reads or writes, so you must ensure that your
+### memcached servers are only accessible by trusted users.
+
+[caches]
+### When a cache-related error occurs, normally Subversion ignores it
+### and continues, logging an error if the server is appropriately
+### configured (and ignoring it with file:// access). To make
+### Subversion never ignore cache errors, uncomment this line.
+# fail-stop = true
+
+[rep-sharing]
+### To conserve space, the filesystem can optionally avoid storing
+### duplicate representations. This comes at a slight cost in performace,
+### as maintaining a database of shared representations can increase
+### commit times. The space savings are dependent upon the size of the
+### repository, the number of objects it contains and the amount of
+### duplication between them, usually a function of the branching and
+### merging process.
+###
+### The following parameter enables rep-sharing in the repository. It can
+### be switched on and off at will, but for best space-saving results
+### should be enabled consistently over the life of the repository.
+# enable-rep-sharing = false
diff --git a/continuum-webapp-test/src/test/example-svn/db/revprops/0 b/continuum-webapp-test/src/test/example-svn/db/revprops/0
new file mode 100644
index 0000000..077f5b5
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revprops/0
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2010-03-16T11:03:29.911752Z
+END
diff --git a/continuum-webapp-test/src/test/example-svn/db/revprops/1 b/continuum-webapp-test/src/test/example-svn/db/revprops/1
new file mode 100644
index 0000000..8c9ce1f
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revprops/1
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 5
+brett
+K 8
+svn:date
+V 27
+2010-03-16T11:03:38.252804Z
+K 7
+svn:log
+V 13
+test projects
+END
diff --git a/continuum-webapp-test/src/test/example-svn/db/revprops/2 b/continuum-webapp-test/src/test/example-svn/db/revprops/2
new file mode 100644
index 0000000..dc4b881
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revprops/2
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 5
+brett
+K 8
+svn:date
+V 27
+2010-03-16T11:03:40.848036Z
+K 7
+svn:log
+V 13
+test projects
+END
diff --git a/continuum-webapp-test/src/test/example-svn/db/revs/0 b/continuum-webapp-test/src/test/example-svn/db/revs/0
new file mode 100644
index 0000000..10f5c45
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revs/0
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/continuum-webapp-test/src/test/example-svn/db/revs/1 b/continuum-webapp-test/src/test/example-svn/db/revs/1
new file mode 100644
index 0000000..1e036ce
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revs/1
Binary files differ
diff --git a/continuum-webapp-test/src/test/example-svn/db/revs/2 b/continuum-webapp-test/src/test/example-svn/db/revs/2
new file mode 100644
index 0000000..49d84a8
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/revs/2
Binary files differ
diff --git a/continuum-webapp-test/src/test/example-svn/db/uuid b/continuum-webapp-test/src/test/example-svn/db/uuid
new file mode 100644
index 0000000..709f8f8
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/uuid
@@ -0,0 +1 @@
+4e8e9111-6a64-48cb-a7ec-3c42aae7d8c6
diff --git a/continuum-webapp-test/src/test/example-svn/db/write-lock b/continuum-webapp-test/src/test/example-svn/db/write-lock
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/db/write-lock
diff --git a/continuum-webapp-test/src/test/example-svn/format b/continuum-webapp-test/src/test/example-svn/format
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/format
@@ -0,0 +1 @@
+3
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/post-commit.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/post-commit.tmpl
new file mode 100644
index 0000000..38ae6b7
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/post-commit.tmpl
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# POST-COMMIT HOOK
+#
+# The post-commit hook is invoked after a commit. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-commit' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the number of the revision just committed)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the commit has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-committed tree.
+#
+# On a Unix system, the normal procedure is to have 'post-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-commit.bat' or 'post-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+
+mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/post-lock.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/post-lock.tmpl
new file mode 100644
index 0000000..c779f11
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/post-lock.tmpl
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# POST-LOCK HOOK
+#
+# The post-lock hook is run after a path is locked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-lock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who created the lock)
+#
+# The paths that were just locked are passed to the hook via STDIN (as
+# of Subversion 1.2, only one path is passed per invocation, but the
+# plan is to pass all locked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been created and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-created lock.
+#
+# On a Unix system, the normal procedure is to have 'post-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-lock.bat' or 'post-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was created:
+mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/post-revprop-change.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/post-revprop-change.tmpl
new file mode 100644
index 0000000..ea3db33
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/post-revprop-change.tmpl
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# POST-REVPROP-CHANGE HOOK
+#
+# The post-revprop-change hook is invoked after a revision property
+# has been added, modified or deleted. Subversion runs this hook by
+# invoking a program (script, executable, binary, etc.) named
+# 'post-revprop-change' (for which this file is a template), with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the revision that was tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property that was changed)
+# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the old property value is passed via STDIN.
+#
+# Because the propchange has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# new property value.
+#
+# On a Unix system, the normal procedure is to have 'post-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-revprop-change.bat' or 'post-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+mailer.py propchange2 "$REPOS" "$REV" "$USER" "$PROPNAME" "$ACTION" /path/to/mailer.conf
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/post-unlock.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/post-unlock.tmpl
new file mode 100644
index 0000000..ae95c4b
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/post-unlock.tmpl
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# POST-UNLOCK HOOK
+#
+# The post-unlock hook runs after a path is unlocked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-unlock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who destroyed the lock)
+#
+# The paths that were just unlocked are passed to the hook via STDIN
+# (as of Subversion 1.2, only one path is passed per invocation, but
+# the plan is to pass all unlocked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been destroyed and cannot be undone,
+# the exit code of the hook program is ignored.
+#
+# On a Unix system, the normal procedure is to have 'post-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-unlock.bat' or 'post-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was removed:
+mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/pre-commit.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/pre-commit.tmpl
new file mode 100644
index 0000000..066d84f
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/pre-commit.tmpl
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# PRE-COMMIT HOOK
+#
+# The pre-commit hook is invoked before a Subversion txn is
+# committed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-commit' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] TXN-NAME (the name of the txn about to be committed)
+#
+# [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN.
+#
+# If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a
+# single newline), the lines following it are the lock tokens for
+# this commit. The end of the list is marked by a line containing
+# only a newline character.
+#
+# Each lock token line consists of a URI-escaped path, followed
+# by the separator character '|', followed by the lock token string,
+# followed by a newline.
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the txn is committed; but
+# if it exits with failure (non-zero), the txn is aborted, no commit
+# takes place, and STDERR is returned to the client. The hook
+# program can use the 'svnlook' utility to help it examine the txn.
+#
+# On a Unix system, the normal procedure is to have 'pre-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
+# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***
+#
+# This is why we recommend using the read-only 'svnlook' utility.
+# In the future, Subversion may enforce the rule that pre-commit
+# hooks should not modify the versioned data in txns, or else come
+# up with a mechanism to make it safe to do so (by informing the
+# committing client of the changes). However, right now neither
+# mechanism is implemented, so hook writers just have to be careful.
+#
+# Note that 'pre-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-commit.bat' or 'pre-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+TXN="$2"
+
+# Make sure that the log message contains some text.
+SVNLOOK=/usr/bin/svnlook
+$SVNLOOK log -t "$TXN" "$REPOS" | \
+ grep "[a-zA-Z0-9]" > /dev/null || exit 1
+
+# Check that the author of this commit has the rights to perform
+# the commit on the files and directories being modified.
+commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
+
+# All checks passed, so allow the commit.
+exit 0
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/pre-lock.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/pre-lock.tmpl
new file mode 100644
index 0000000..13827fb
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/pre-lock.tmpl
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# PRE-LOCK HOOK
+#
+# The pre-lock hook is invoked before an exclusive lock is
+# created. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-lock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be locked)
+# [3] USER (the user creating the lock)
+# [4] COMMENT (the comment of the lock)
+# [5] STEAL-LOCK (1 if the user is trying to steal the lock, else 0)
+#
+# If the hook program outputs anything on stdout, the output string will
+# be used as the lock token for this lock operation. If you choose to use
+# this feature, you must guarantee the tokens generated are unique across
+# the repository each time.
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is created; but
+# if it exits with failure (non-zero), the lock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-lock.bat' or 'pre-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock exists and is owned by a different person, don't allow it
+# to be stolen (e.g., with 'svn lock --force ...').
+
+# (Maybe this script could send email to the lock owner?)
+SVNLOOK=/usr/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person locking matches the lock's owner, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2
+exit 1
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/pre-revprop-change.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/pre-revprop-change.tmpl
new file mode 100644
index 0000000..2f2de98
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/pre-revprop-change.tmpl
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# PRE-REVPROP-CHANGE HOOK
+#
+# The pre-revprop-change hook is invoked before a revision property
+# is added, modified or deleted. Subversion runs this hook by invoking
+# a program (script, executable, binary, etc.) named 'pre-revprop-change'
+# (for which this file is a template), with the following ordered
+# arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REVISION (the revision being tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property being set on the revision)
+# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the new property value is passed via STDIN.
+#
+# If the hook program exits with success, the propchange happens; but
+# if it exits with failure (non-zero), the propchange doesn't happen.
+# The hook program can use the 'svnlook' utility to examine the
+# existing value of the revision property.
+#
+# WARNING: unlike other hooks, this hook MUST exist for revision
+# properties to be changed. If the hook does not exist, Subversion
+# will behave as if the hook were present, but failed. The reason
+# for this is that revision properties are UNVERSIONED, meaning that
+# a successful propchange is destructive; the old value is gone
+# forever. We recommend the hook back up the old value somewhere.
+#
+# On a Unix system, the normal procedure is to have 'pre-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
+
+echo "Changing revision properties other than svn:log is prohibited" >&2
+exit 1
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/pre-unlock.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/pre-unlock.tmpl
new file mode 100644
index 0000000..d1aa858
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/pre-unlock.tmpl
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# PRE-UNLOCK HOOK
+#
+# The pre-unlock hook is invoked before an exclusive lock is
+# destroyed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-unlock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be unlocked)
+# [3] USER (the user destroying the lock)
+# [4] TOKEN (the lock token to be destroyed)
+# [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is destroyed; but
+# if it exits with failure (non-zero), the unlock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-unlock.bat' or 'pre-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock is owned by a different person, don't allow it be broken.
+# (Maybe this script could send email to the lock owner?)
+
+SVNLOOK=/usr/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, return success:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person unlocking matches the lock's owner, return success:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2
+exit 1
diff --git a/continuum-webapp-test/src/test/example-svn/hooks/start-commit.tmpl b/continuum-webapp-test/src/test/example-svn/hooks/start-commit.tmpl
new file mode 100644
index 0000000..7597f58
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/hooks/start-commit.tmpl
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# START-COMMIT HOOK
+#
+# The start-commit hook is invoked before a Subversion txn is created
+# in the process of doing a commit. Subversion runs this hook
+# by invoking a program (script, executable, binary, etc.) named
+# 'start-commit' (for which this file is a template)
+# with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the authenticated user attempting to commit)
+# [3] CAPABILITIES (a colon-separated list of capabilities reported
+# by the client; see note below)
+#
+# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5
+# clients will typically report at least the "mergeinfo" capability.
+# If there are other capabilities, then the list is colon-separated,
+# e.g.: "mergeinfo:some-other-capability" (the order is undefined).
+#
+# The list is self-reported by the client. Therefore, you should not
+# make security assumptions based on the capabilities list, nor should
+# you assume that clients reliably report every capability they have.
+#
+# The working directory for this hook program's invocation is undefined,
+# so the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the commit continues; but
+# if it exits with failure (non-zero), the commit is stopped before
+# a Subversion txn is created, and STDERR is returned to the client.
+#
+# On a Unix system, the normal procedure is to have 'start-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'start-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'start-commit.bat' or 'start-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+USER="$2"
+
+commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1
+special-auth-check.py --user "$USER" --auth-level 3 || exit 1
+
+# All checks passed, so allow the commit.
+exit 0
diff --git a/continuum-webapp-test/src/test/example-svn/locks/db-logs.lock b/continuum-webapp-test/src/test/example-svn/locks/db-logs.lock
new file mode 100644
index 0000000..20dd636
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/locks/db-logs.lock
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
diff --git a/continuum-webapp-test/src/test/example-svn/locks/db.lock b/continuum-webapp-test/src/test/example-svn/locks/db.lock
new file mode 100644
index 0000000..20dd636
--- /dev/null
+++ b/continuum-webapp-test/src/test/example-svn/locks/db.lock
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAccessTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAccessTestCase.java
deleted file mode 100644
index e3e454a..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAccessTestCase.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractAuthenticatedAccessTestCase
- extends AbstractGuestAccessTestCase
-{
- public void setUp()
- throws Exception
- {
- super.setUp();
- login( getUsername(), getPassword() );
- }
-
- public abstract String getUsername();
-
- public abstract String getPassword();
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAdminAccessTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAdminAccessTestCase.java
deleted file mode 100644
index 79e83ce..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractAuthenticatedAdminAccessTestCase.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- *
- */
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- *
- */
-public abstract class AbstractAuthenticatedAdminAccessTestCase
- extends AbstractAuthenticatedAccessTestCase
-{
- /**
- * @see org.apache.continuum.web.test.AbstractAuthenticatedAccessTestCase#getPassword()
- */
- public String getPassword()
- {
- return adminPassword;
- }
-
- /**
- * @see org.apache.continuum.web.test.AbstractAuthenticatedAccessTestCase#getUsername()
- */
- public String getUsername()
- {
- return adminUsername;
- }
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
deleted file mode 100644
index 6b33261..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
+++ /dev/null
@@ -1,1532 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractContinuumTestCase
- extends AbstractSeleniumTestCase
-{
-
- public final static String DEFAULT_PROJ_GRP_NAME = "Default Project Group";
-
- public final static String DEFAULT_PROJ_GRP_ID = "default";
-
- public final static String DEFAULT_PROJ_GRP_DESCRIPTION =
- "Contains all projects that do not have a group of their own";
-
- public final static String TEST_PROJ_GRP_NAME = "Test Project Group Name";
-
- public final static String TEST_PROJ_GRP_ID = "Test Project Group Id";
-
- public final static String TEST_PROJ_GRP_DESCRIPTION = "Test Project Group Description";
-
- public final static String TEST_POM_URL = "http://svn.apache.org/repos/asf/maven/pom/trunk/maven/pom.xml";
-
- public final static String TEST_POM_USERNAME = "dummy";
-
- public final static String TEST_POM_PASSWORD = "dummy";
-
- public static final String TEST_PROJECT_GROUP_NAME = "Apache Maven";
-
- public static final String TEST_PROJECT_NAME = "Apache Maven";
-
-
- //////////////////////////////////////
- // Overriden AbstractSeleniumTestCase methods
- //////////////////////////////////////
- protected String getApplicationName()
- {
- return "Continuum";
- }
-
- protected String getInceptionYear()
- {
- return "2005";
- }
-
- public void assertHeader()
- {
- assertImgWithAlt( "Continuum" );
- assertLinkPresent( "Continuum" );
- assertLinkPresent( "Maven" );
- assertLinkPresent( "Apache" );
- }
-
- public String getBaseUrl()
- {
- return baseUrl;
- }
-
- //////////////////////////////////////
- // About
- //////////////////////////////////////
- public void goToAboutPage()
- {
- clickLinkWithText( "About" );
-
- assertAboutPage();
- }
-
- public void assertAboutPage()
- {
- assertPage( "Continuum - About" );
- assertTextPresent( "About Continuum" );
- assertTextPresent( "Version:" );
- assertTextPresent( "1.4.0-SNAPSHOT" );
- assertTextPresent( "Build Number:" );
- }
-
- //////////////////////////////////////
- // Configuration
- //////////////////////////////////////
- public void goToConfigurationPage()
- {
- clickLinkWithText( "Configuration" );
-
- assertEditConfigurationPage();
- }
-
- public void assertEditConfigurationPage()
- {
- assertPage( "Continuum - Configuration" );
- String configText = "General Configuration,Working Directory*:,Build Output Directory*:,Release Output Directory:,Deployment Repository Directory:,Base URL*:,Number of Allowed Builds in Parallel:";
- String[] arrayConfigText = configText.split(",");
- for( String configtext : arrayConfigText )
- assertTextPresent( configtext );
- String configElements = "configuration_workingDirectory,configuration_buildOutputDirectory,configuration_releaseOutputDirectory,configuration_deploymentRepositoryDirectory,configuration_baseUrl,configuration_numberOfAllowedBuildsinParallel,configuration_distributedBuildEnabled";
- String[] arrayConfigElements = configElements.split( "," );
- for ( String configelements : arrayConfigElements )
- assertElementPresent( configelements );
- }
-
-
- //////////////////////////////////////
- // ANT/SHELL Projects
- //////////////////////////////////////
- public void assertAddProjectPage( String type )
- {
- assertPage( "Continuum - Add " + type + " Project" );
- assertTextPresent( "Add " + type + " Project" );
- assertTextPresent( "Project Name*:" );
- assertElementPresent( "projectName" );
- assertTextPresent( "Description:" );
- assertElementPresent( "projectDescription" );
- assertTextPresent( "Version*:" );
- assertElementPresent( "projectVersion" );
- assertTextPresent( "Scm Url*:" );
- assertElementPresent( "projectScmUrl" );
- assertTextPresent( "Scm Username:" );
- assertElementPresent( "projectScmUsername" );
- assertTextPresent( "Scm Password:" );
- assertElementPresent( "projectScmPassword" );
- assertTextPresent( "Scm Branch/Tag:" );
- assertElementPresent( "projectScmTag" );
- assertElementPresent( "projectScmUseCache" );
- assertTextPresent( "Project Group Name:" );
- assertElementPresent( "selectedProjectGroup" );
- assertTextPresent( "Build Definition Template:" );
- assertElementPresent( "buildDefinitionTemplateId" );
- }
-
- public void assertAddAntProjectPage()
- {
- assertAddProjectPage( "Ant" );
- }
-
- public void assertAddShellProjectPage()
- {
- assertAddProjectPage( "Shell" );
- }
-
- //////////////////////////////////////
- // Parallel Build Queue
- //////////////////////////////////////
- public void goToParallelBuildQueuePage()
- {
- clickLinkWithText( "Build Queue" );
- assertParallelBuildQueuePage();
- }
-
- public void assertParallelBuildQueuePage()
- {
- assertPage( "Continuum - Parallel Build Queue" );
- assertTextPresent( "Continuum - Parallel Build Queue" );
- assertTextPresent( "Name" );
- assertTextPresent( "DEFAULT_BUILD_QUEUE" );
- }
-
- public void assertAddParallelBuildQueuePage()
- {
- assertPage( "Continuum - Add/Edit Parallel Build Queue" );
- assertTextPresent( "Continuum - Add/Edit Parallel Build Queue" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "name" );
- }
-
- public void addParallelBuildQueue(String name)
- {
- goToParallelBuildQueuePage();
-
- clickButtonWithValue( "Add" );
- assertAddParallelBuildQueuePage();
-
- setFieldValue( "name", name );
- clickButtonWithValue( "Save" );
-
- if ( isTextPresent( "You are only allowed 1 number of builds in parallel." ))
- {
- goToConfigurationPage();
- setFieldValue( "numberOfAllowedBuildsinParallel", "3" );
- }
- else
- {
- assertPage( "Continuum - Parallel Build Queue" );
- }
- }
-
- public void removeParallelBuildQueue()
- {
- clickLinkWithLocator( "//table[@id='ec_table']/tbody/tr[2]/td[2]/a/img" );
- }
-
-
- //////////////////////////////////////
- // Local Repositories
- //////////////////////////////////////
- public void goToLocalRepositoriesPage()
- {
- clickLinkWithText( "Local Repositories" );
- assertLocalRepositoryPage();
- }
-
- public void assertLocalRepositoryPage()
- {
- assertPage( "Continuum - Local Repositories" );
-
- assertTextPresent( "Local Repositories" );
- String tableElement = "ec_table";
- assertCellValueFromTable("Name", tableElement, 0, 0);
- assertCellValueFromTable("Location", tableElement, 0, 1);
- assertCellValueFromTable("Layout", tableElement, 0, 2);
- assertCellValueFromTable("", tableElement, 0, 3);
- assertCellValueFromTable("", tableElement, 0, 4);
- assertCellValueFromTable("", tableElement, 0, 5);
- assertCellValueFromTable("DEFAULT", tableElement, 1, 0);
- assertCellValueFromTable("default", tableElement, 1, 2);
- assertImgWithAlt( "Edit" );
- assertImgWithAlt( "Purge" );
- assertImgWithAlt( "Delete" );
- }
-
- public void assertAddEditLocalRepositoryPage()
- {
- assertPage( "Continuum - Add/Edit Local Repository" );
- assertTextPresent( "Continuum - Add/Edit Local Repository" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "repository.name" );
- assertTextPresent( "Location*:" );
- assertElementPresent( "repository.location" );
- assertTextPresent( "Layout:" );
- assertElementPresent( "repository.layout" );
- }
-
- public void addLocalRepository( String name, String location, String layout )
- {
- goToLocalRepositoriesPage();
-
- clickLinkWithText( "Add" );
- assertAddEditLocalRepositoryPage();
-
- setFieldValue( "repository.name" , name );
- setFieldValue( "repository.location" , location );
- setFieldValue( "repository.layout", layout );
- clickButtonWithValue( "Save" );
- assertPage( "Continuum - Local Repositories" ) ;
- }
-
- //////////////////////////////////////
- // Purge Configuration
- //////////////////////////////////////
- public void goToPurgeConfigPage()
- {
- clickLinkWithText( "Purge Configurations" );
- assertPurgeConfigurationPage();
- }
-
- public void assertPurgeConfigurationPage()
- {
- assertPage( "Continuum - Purge Configurations" );
-
- assertTextPresent( "Repository Purge Configurations" );
- String tableElement = "ec_table";
- assertCellValueFromTable( "Repository", tableElement, 0, 0 );
- assertCellValueFromTable( "Days Older", tableElement, 0, 1 );
- assertCellValueFromTable( "Retention Count", tableElement, 0, 2 );
- assertCellValueFromTable( "Delete All", tableElement, 0, 3 );
- assertCellValueFromTable( "Delete Released Snapshots", tableElement, 0, 4 );
- assertCellValueFromTable( "Schedule", tableElement, 0, 5 );
- assertCellValueFromTable( "Default", tableElement, 0, 6 );
- assertCellValueFromTable( "Enabled", tableElement, 0, 7 );
- assertCellValueFromTable( "Description", tableElement, 0, 8 );
- assertCellValueFromTable( "", tableElement, 0, 9 );
- assertCellValueFromTable( "", tableElement, 0, 10 );
- assertCellValueFromTable( "", tableElement, 0, 11 );
- assertCellValueFromTable( "DEFAULT", tableElement, 1, 0 );
- assertCellValueFromTable( "100", tableElement, 1, 1 );
- assertCellValueFromTable( "2", tableElement, 1, 2 );
- assertCellValueFromTable( "false", tableElement, 1, 3 );
- assertCellValueFromTable( "false", tableElement, 1, 4 );
- assertCellValueFromTable( "", tableElement, 1, 5 );
- assertCellValueFromTable( "true", tableElement, 1, 6 );
- assertCellValueFromTable( "true", tableElement, 1, 7 );
- assertCellValueFromTable( "", tableElement, 1, 8 );
- assertImgWithAlt("Edit");
- assertImgWithAlt("Purge");
- assertImgWithAlt("Deletes");
-
- assertTextPresent( "Directory Purge Configurations" );
- assertTextPresent( "Directory Type" );
- assertTextPresent( "Days Older" );
- assertTextPresent( "Retention Count" );
- assertTextPresent( "Delete All" );
- assertTextPresent( "Schedule" );
- assertTextPresent( "Default" );
- assertTextPresent( "Enabled" );
- assertTextPresent( "Description" );
- }
-
- public void addRepositoryPurgeConfig(String repository, String daysOlder,
- String retentionCount, String schedule, String description)
- {
- goToPurgeConfigPage();
-
- clickButtonWithValue( "Add" );
- assertAddEditRepositoryPurgeConfigPage();
- selectValue( "savePurgeConfig_repositoryId", repository );
- setFieldValue( "daysOlder", daysOlder );
- setFieldValue( "retentionCount", retentionCount );
- selectValue( "savePurgeConfig_scheduleId", schedule );
- setFieldValue( "description", description );
-
- clickButtonWithValue( "Save" );
- assertPage( "Continuum - Purge Configurations" );
- }
-
- public void removeRepositoryPurgeConfig()
- {
- goToPurgeConfigPage();
- clickLinkWithLocator( "//table[@id='ec_table']/tbody/tr[2]/td[12]/a/img" );
- assertPage( "Delete Purge Configuration" );
- clickButtonWithValue( "Delete" );
- }
-
- public void editRepositoryPurgeConfig(String repository, String daysOlder,
- String retentionCount, String schedule, String description)
- {
- //TODO
- }
-
- public void assertAddEditRepositoryPurgeConfigPage()
- {
- assertPage( "Continuum - Add/Edit Repository Purge Configuration" );
- assertTextPresent( "Add/Edit Repository Purge Configuration" );
- assertTextPresent( "Repository*:" );
- assertElementPresent( "repositoryId" );
- assertTextPresent( "Days Older:" );
- assertElementPresent( "daysOlder" );
- assertTextPresent( "Retention Count:" );
- assertElementPresent( "retentionCount" );
- assertElementPresent( "deleteAll" );
- assertElementPresent( "deleteReleasedSnapshots" );
- assertElementPresent( "defaultPurgeConfiguration" );
- assertTextPresent( "Schedule:" );
- assertElementPresent( "scheduleId" );
- assertTextPresent( "Description:" );
- assertElementPresent( "description" );
- }
-
- public void addDirectoryPurgeConfig(String repository, String daysOlder,
- String retentionCount, String schedule, String description)
- {
- //TODO
- }
-
- public void editDirectoryPurgeConfig(String repository, String daysOlder,
- String retentionCount, String schedule, String description)
- {
- //TODO
- }
-
- public void removeDirectoryPurgeConfig()
- {
- //TODO
- }
-
- public void assertAddEditDirectoryPurgeConfigurationPage()
- {
- assertPage( "Continuum - Add/Edit Directory Purge Configuration" );
- assertTextPresent( "Add/Edit Directory Purge Configuration" );
- assertTextPresent( "Directory Type:" );
- assertElementPresent( "directoryType" );
- assertTextPresent( "Days Older:" );
- assertElementPresent( "daysOlder" );
- assertTextPresent( "Retention Count:" );
- assertElementPresent( "retentionCount" );
- assertElementPresent( "deleteAll" );
- assertElementPresent( "defaultPurgeConfiguration" );
- assertTextPresent( "Schedule:" );
- assertElementPresent( "scheduleId" );
- assertTextPresent( "Description:" );
- assertElementPresent( "description" );
- }
-
- //////////////////////////////////////
- // Schedules
- //////////////////////////////////////
- public void goToSchedulesPage()
- {
- clickLinkWithText( "Schedules" );
- assertSchedulesPage();
- }
-
- public void assertSchedulesPage()
- {
- assertPage( "Continuum - Schedules" );
-
- assertTextPresent( "Schedules" );
- String tableElement = "ec_table";
- assertCellValueFromTable("Name", tableElement, 0, 0);
- assertCellValueFromTable("Description", tableElement, 0, 1);
- assertCellValueFromTable("Quiet Period", tableElement, 0, 2);
- assertCellValueFromTable("Cron Expression", tableElement, 0, 3);
- assertCellValueFromTable("Max Job Time", tableElement, 0, 4);
- assertCellValueFromTable("Active", tableElement, 0, 5);
- assertCellValueFromTable("", tableElement, 1, 6);
- assertCellValueFromTable("", tableElement, 1, 7);
-
- assertCellValueFromTable("DEFAULT_SCHEDULE", tableElement, 1, 0);
- assertCellValueFromTable("Run hourly", tableElement, 1, 1);
- assertCellValueFromTable("0", tableElement, 1, 2);
- assertCellValueFromTable("exact:0 0 * * * ?", tableElement, 1, 3);
- assertCellValueFromTable("3600", tableElement, 1, 4);
- assertCellValueFromTable("true", tableElement, 1, 5);
- assertImgWithAlt( "Edit" );
- assertImgWithAlt( "Delete" );
- }
-
- //////////////////////////////////////
- // Installations
- //////////////////////////////////////
- public void assertInstallationTypeChoicePage()
- {
- assertPage( "Continuum - Installation Type Choice" );
- assertTextPresent( "Installation Type Choice" );
- assertTextPresent( "Installation Type:" );
- assertElementPresent( "installationType" );
- }
-
- public void assertAddEditInstallationToolPage()
- {
- assertPage( "Continuum - Installation" );
- assertTextPresent( "Continuum - Installation" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "installation.name" );
- assertTextPresent( "Type:" );
- assertElementPresent( "installation.type" );
- assertTextPresent( "Value/Path*:" );
- assertElementPresent( "installation.varValue" );
- assertElementPresent( "automaticProfile" );
- assertTextPresent( "Create a Build Environment with the Installation name" );
- }
-
- public void assertAddEditInstallationEnvironmentVariablePage()
- {
- assertPage( "Continuum - Installation" );
- assertTextPresent( "Continuum - Installation" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "installation.name" );
- assertTextPresent( "Environment Variable Name*:" );
- assertElementPresent( "installation.varName" );
- assertTextPresent( "Value/Path*:" );
- assertElementPresent( "installation.varValue" );
- assertElementPresent( "automaticProfile" );
- }
-
- public void assertInstallationPage()
- {
- assertPage( "Continuum - Installations" );
- assertTextPresent( "Installations" );
- assertTextPresent( "Name" );
- assertTextPresent( "Type" );
- assertTextPresent( "Environment Variable Name" );
- assertTextPresent( "Value/Path" );
- }
-
- //////////////////////////////////////
- // Build Environments
- //////////////////////////////////////
- public void assertBuildEnvironmentPage()
- {
- assertPage( "Continuum - Build Environments" );
- assertTextPresent( "Build Environments" );
- }
-
- public void assertBuildEnvironmentNamePage()
- {
- assertPage( "Continuum - Build Environment" );
- assertTextPresent( "Build Environment" );
- assertTextPresent( "Build Environment Name*:" );
- assertElementPresent( "profile.name" );
- }
-
- public void assertBuildEnvironmentBuildAgentInstallationPage()
- {
- assertPage( "Continuum - Build Environment" );
- assertTextPresent( "Build Environment" );
- assertTextPresent( "Build Environment Name*:" );
- assertElementPresent( "profile.name" );
- assertTextPresent( "Build Agent Group:" );
- assertElementPresent( "profile.buildAgentGroup" );
- assertTextPresent( "Installation Name" );
- assertTextPresent( "Type" );
- assertElementPresent( "installationId" );
- }
-
- //////////////////////////////////////
- // Queues
- //////////////////////////////////////
- public void assertQueuePage()
- {
- assertPage( "Continuum - Queues" );
- assertTextPresent( "Current Build" );
- assertTextPresent( "Build Queue" );
- assertTextPresent( "Project Name" );
- assertTextPresent( "Build Definition" );
- assertTextPresent( "Continuum - Build Queue" );
- assertTextPresent( "Current Checkout" );
- assertTextPresent( "Checkout Queue" );
- }
-
- //////////////////////////////////////
- // Build Definition Templates
- //////////////////////////////////////
- public void assertBuildDefTemplatesPage()
- {
- //Available Templates Table Assertion
- assertPage( "Continuum - Build Definition Templates" );
- assertTextPresent( "Available Templates" );
- assertTextPresent( "Name" );
- assertTextPresent( "Default Ant Template" );
- assertImgWithAlt( "Edit" );
- assertImgWithAlt( "Disabled" );
- assertTextPresent( "Default Maven 1 Template" );
-
- assertTextPresent( "Default Maven 2 Template" );
- assertTextPresent( "Default Shell Template" );
-
- //Available Build Definitions Table Assertion
- assertTextPresent( "Goals" );
- assertTextPresent( "Arguments" );
- assertTextPresent( "Build File" );
- assertTextPresent( "Schedule" );
- assertTextPresent( "Build Environment" );
- assertTextPresent( "Is Build Fresh?" );
- assertTextPresent( "Default" );
- assertTextPresent( "Description" );
- assertTextPresent( "Type" );
-
- }
-
- public void assertAddEditAvailableTemplatesPage()
- {
- assertPage( "Continuum - Build Definition Template" );
- assertTextPresent( "Build Definition Template" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "buildDefinitionTemplate.name" );
- assertTextPresent( "Configure the used Build Definitions:" );
- assertElementPresent( "buildDefinitionIds" );
- assertElementPresent( "selectedBuildDefinitionIds" );
- }
-
- public void assertAddEditAvailableBuildDefPage()
- {
- assertPage( "Continuum - Add/Edit Build Definition" );
- assertTextPresent( "Add/Edit Build Definition" );
- assertTextPresent( "POM filename*:" );
- assertElementPresent( "buildFile" );
- assertTextPresent( "Goals:" );
- assertElementPresent( "goals" );
- assertTextPresent( "Arguments:" );
- assertElementPresent( "arguments" );
- assertElementPresent( "buildFresh" );
- assertElementPresent( "alwaysBuild" );
- assertElementPresent( "defaultBuildDefinition" );
- assertTextPresent( "Schedule:" );
- assertElementPresent( "scheduleId" );
- assertTextPresent( "Build Environment:" );
- assertElementPresent( "profileId" );
- assertTextPresent( "Type:" );
- assertElementPresent( "buildDefinitionType" );
- assertTextPresent( "Description*:" );
- assertElementPresent( "description" );
- }
-
- //TODO assertion for Appearance Page
-
- //////////////////////////////////////
- // Build Agents
- //////////////////////////////////////
- public void assertBuildAgentPage()
- {
- assertPage( "Continuum - Build Agents" );
- assertTextPresent( "Build Agent URL" );
- assertTextPresent( "Enabled" );
- assertTextPresent( "Description" );
- assertTextPresent( "Build Agent Groups" );
- assertTextPresent( "Name" );
- assertTextPresent( "Build Agents" );
- }
-
- public void assertAddEditBuildAgentPage()
- {
- assertPage( "Continuum - Add/Edit Build Agent" );
- assertTextPresent( "Continuum - Add/Edit Build Agent" );
- assertTextPresent( "Build Agent URL*:" );
- assertElementPresent( "buildAgent.url" );
- assertTextPresent( "Description:" );
- assertElementPresent( "buildAgent.description" );
- assertElementPresent( "buildAgent.enabled" );
- }
-
- public void assertAddEditBuildAgentGroupPage()
- {
- assertPage( "Continuum - Add/Edit Build Agent Group" );
- assertTextPresent( "Add/Edit Build Agent Group" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "buildAgentGroup.name" );
- }
-
- //////////////////////////////////////
- // Project Groups
- //////////////////////////////////////
- public void goToProjectGroupsSummaryPage()
- throws Exception
- {
- clickLinkWithText( "Show Project Groups" );
- }
-
- public void assertProjectGroupsSummaryPage()
- throws Exception
- {
- goToProjectGroupsSummaryPage();
- assertPage( "Continuum - Group Summary" );
-
- if ( isTextPresent( "Project Groups list is empty." ) )
- {
- assertTextNotPresent( "Name" );
- assertTextNotPresent( "Group Id" );
- assertTextNotPresent( "Total" );
- assertTextNotPresent( "Summary" );
- }
- else
- {
- String tableElement = "ec_table";
- assertCellValueFromTable( "Name", tableElement, 0, 0 );
- assertCellValueFromTable( "Group Id", tableElement, 0, 1 );
- assertCellValueFromTable( "", tableElement, 0, 2 );
- assertCellValueFromTable( "", tableElement, 0, 3 );
- assertCellValueFromTable( "", tableElement, 0, 4 );
- assertCellValueFromTable( "", tableElement, 0, 5 );
- assertCellValueFromTable( "", tableElement, 0, 6 );
- assertCellValueFromTable( "", tableElement, 0, 7 );
- assertCellValueFromTable( "Total", tableElement, 0, 8 );
- /*assertCellValueFromTable( "Default Project Group", tableElement, 1, 0 );
- assertCellValueFromTable( "default", tableElement, 1, 1 );*/
- assertImgWithAlt( "Build all projects" );
- assertImgWithAlt( "Release Group" );
- assertImgWithAlt( "Delete Group" );
- /*assertCellValueFromTable( "0", tableElement, 1, 5 );
- assertCellValueFromTable( "0", tableElement, 1, 6 );
- assertCellValueFromTable( "0", tableElement, 1, 7 );
- assertCellValueFromTable( "0", tableElement, 1, 8 );*/
-
- }
- }
-
- //////////////////////////////////////
- // Project Group
- //////////////////////////////////////
- public void showProjectGroup( String name, String groupId, String description )
- throws Exception
- {
- goToProjectGroupsSummaryPage();
-
- // Checks the link to the created Project Group
- assertLinkPresent( name );
- clickLinkWithText( name );
-
- assertProjectGroupSummaryPage( name, groupId, description);
- }
-
- public void assertProjectGroupSummaryPage( String name, String groupId, String description )
- {
- assertTextPresent( "Project Group Name:" );
- assertTextPresent( name );
- assertTextPresent( "Group Id:" );
- assertTextPresent( groupId );
- assertTextPresent( "Description:" );
- assertTextPresent( description );
- assertTextPresent( "Local Repository" );
- assertTextPresent( "DEFAULT" );
-
- //Assert Project Group SCM Root
- assertTextPresent( "Project Group Scm Root" );
- assertTextPresent( "Scm Root URL" );
-
- // Assert the available Project Group Actions
- assertTextPresent( "Group Actions" );
- assertElementPresent( "buildDefinitionId" );
- assertElementPresent( "build" );
- assertElementPresent( "edit" );
- assertElementPresent( "release" );
- assertElementPresent( "preferredExecutor" );
- assertButtonWithValuePresent("Add");
- assertButtonWithValuePresent("Delete Group");
- assertButtonWithValuePresent("Cancel Group Build");
-
- if ( isTextPresent( "Member Projects" ) )
- {
- assertTextPresent( "Project Name" );
- assertTextPresent( "Version" );
- assertTextPresent( "Build" );
- assertTextPresent( "Last Build Date" );
- assertElementPresent( "buildDef" );
- assertElementPresent( "build-projects" );
- assertElementPresent( "cancel-builds" );
- assertElementPresent( "delete-projects" );
- }
- else
- {
- assertTextNotPresent( "Project Name" );
- }
- }
-
- public void assertDefaultProjectGroupBuildDefinitionPage()
- {
- String tableElement = "ec_table";
- assertCellValueFromTable( "Goals", tableElement, 0, 0 );
- assertCellValueFromTable( "Arguments", tableElement, 0, 1 );
- assertCellValueFromTable( "Build File", tableElement, 0, 2 );
- assertCellValueFromTable( "Schedule", tableElement, 0, 3 );
- assertCellValueFromTable( "Build Environment", tableElement, 0, 4 );
- assertCellValueFromTable( "From", tableElement, 0, 5 );
- assertCellValueFromTable( "Build Fresh", tableElement, 0, 6 );
- assertCellValueFromTable( "Default", tableElement, 0, 7 );
- assertCellValueFromTable( "Description", tableElement, 0, 8 );
- assertCellValueFromTable( "Type", tableElement, 0, 9 );
- assertCellValueFromTable( "Always Build", tableElement, 0, 10);
- assertCellValueFromTable( "", tableElement, 0, 11 );
- assertCellValueFromTable( "", tableElement, 0, 12 );
- assertCellValueFromTable( "", tableElement, 0, 13 );
-
- assertCellValueFromTable( "clean install", tableElement, 1, 0 );
- assertCellValueFromTable( "--batch-mode --non-recursive", tableElement, 1, 1 );
- assertCellValueFromTable( "pom.xml", tableElement, 1, 2 );
- assertCellValueFromTable( "DEFAULT_SCHEDULE", tableElement, 1, 3 );
- assertCellValueFromTable( "", tableElement, 1, 4 );
- assertCellValueFromTable( "GROUP", tableElement, 1, 5 );
- assertCellValueFromTable( "false", tableElement, 1, 6 );
- assertCellValueFromTable( "true", tableElement, 1, 7 );
- assertCellValueFromTable( "Default Maven 2 Build Definition", tableElement, 1, 8 );
- assertCellValueFromTable( "maven2", tableElement, 1, 9 );
- assertCellValueFromTable( "false", tableElement, 1, 10 );
- assertImgWithAlt( "Build" );
- assertImgWithAlt( "Edit" );
- assertImgWithAlt( "Delete" );
- }
-
-
- public void addProjectGroup( String name, String groupId, String description )
- throws Exception
- {
- goToProjectGroupsSummaryPage();
-
- // Go to Add Project Group Page
- clickButtonWithValue( "Add Project Group" );
- assertAddProjectGroupPage();
-
- // Enter values into Add Project Group fields, and submit
- setFieldValue( "name", name );
- setFieldValue( "groupId", groupId );
- setFieldValue( "description", description );
-
- submit();
- waitPage();
-
- //TODO: Check the result Page
- }
-
- public void assertAddProjectGroupPage()
- {
- assertPage( "Continuum - Add Project Group" );
-
- assertTextPresent( "Add Project Group" );
- assertTextPresent( "Project Group Name*:" );
- assertElementPresent( "name" );
- assertTextPresent( "Project Group Id*:" );
- assertElementPresent( "groupId" );
- assertTextPresent( "Description:" );
- assertElementPresent( "description" );
- assertTextPresent( "Local Repository:" );
- assertElementPresent( "repositoryId" );
- }
-
- public void removeProjectGroup( String name, String groupId, String description )
- throws Exception
- {
- showProjectGroup( name, groupId, description );
-
- // Remove
- clickSubmitWithLocator( "remove" );
- //clickButtonWithValue("Delete Group");
-
- // Assert Confirmation
- assertElementPresent( "removeProjectGroup_" );
- assertElementPresent( "Cancel" );
-
- // Confirm Project Group deletion
- clickSubmitWithLocator( "removeProjectGroup_" );
- }
-
- public void editProjectGroup( String name, String groupId, String description, String newName, String newDescription )
- throws Exception
- {
- showProjectGroup( name, groupId, description );
- clickButtonWithValue( "Edit" );
- assertEditGroupPage( groupId );
- setFieldValue( "saveProjectGroup_name", newName );
- setFieldValue( "saveProjectGroup_description", newDescription );
- clickButtonWithValue( "Save" );
- }
-
- public void assertEditGroupPage( String groupId ) throws Exception
- {
- assertPage( "Continuum - Update Project Group" );
- assertTextPresent( "Update Project Group" );
- assertTextPresent( "Project Group Name*:" );
- assertElementPresent( "saveProjectGroup_name" );
- assertTextPresent( "Project Group Id:" );
- assertTextPresent( groupId );
- assertTextPresent( "Description:" );
- assertElementPresent( "saveProjectGroup_description" );
- assertTextPresent( "Local Repository:" );
- assertElementPresent( "saveProjectGroup_repositoryId" );
- assertTextPresent( "Homepage Url:" );
- assertElementPresent( "saveProjectGroup_url" );
-
- assertElementPresent( "saveProjectGroup_" );
- assertElementPresent( "Cancel" );
- }
-
- public void buildProjectGroup( String projectGroupName, String groupId, String description ) throws Exception
- {
- int tries = 0, maxTries = 100;
-
- showProjectGroup( projectGroupName, groupId, description );
- clickButtonWithValue( "Build" );
-
- // make sure build will be completed
- while ( isElementPresent( "//img[@alt='Updating sources']" ) )
- {
- Thread.sleep( 5000 );
- showProjectGroup( projectGroupName, groupId, description );
-
- if ( tries++ >= maxTries )
- {
- assertTrue( "Max tries waiting for the project to build reached.", false );
- }
- }
- // test if successfully built, then return to the original page
- clickLinkWithText( "Apache Maven" );
- clickLinkWithText( "Builds" );
- clickLinkWithText( "Result" );
- assertTextPresent( "BUILD SUCCESSFUL" );
- clickLinkWithText( "Project Group Summary" );
- }
-
- public void assertReleaseSuccess()
- {
- assertTextPresent( "Choose Release Goal for Apache Maven" );
- }
-
- /*public void assertReleaseEmpty()
- {
- assertTextPresent( "Cannot release an empty group" );
- }*/
-
- public void addValidM2ProjectFromProjectGroup( String projectGroupName, String groupId, String description,
- String m2PomUrl ) throws Exception
- {
- showProjectGroup( projectGroupName, groupId, description );
- selectValue( "preferredExecutor", "Add M2 Project" );
- clickButtonWithValue( "Add" );
- assertAddMavenTwoProjectPage();
-
- setFieldValue( "m2PomUrl", m2PomUrl );
- clickButtonWithValue( "Add" );
-
- // if success redirect to summary page
- assertProjectGroupsSummaryPage();
- }
-
- public void goToBuildDefinitionPage( String projectGroupName, String groupId, String description ) throws Exception
- {
- showProjectGroup( projectGroupName, groupId, description );
- clickLinkWithText( "Build Definitions" );
- assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group" );
-
- assertBuildDefinitionPage( projectGroupName );
-
- }
-
- public void assertBuildDefinitionPage( String projectGroupName )
- {
-
- assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group" );
- assertElementPresent( "buildDefinition_0" );
- }
-
- public void assertNotifierPage( String projectGroupName )
- {
- assertTextPresent( "Project Group Notifiers of group " + projectGroupName );
- }
-
- public void assertAddNotifierPage()
- {
- assertPage( "Continuum - Add Notifier" );
- assertTextPresent( "Add Notifier" );
- assertTextPresent( "Type" );
- assertElementPresent( "notifierType" );
- assertElementPresent( "Cancel" );
- }
-
- public void assertAddEditMailNotifierPage()
- {
- assertPage( "Continuum - Add/Edit Mail Notifier" );
- assertTextPresent( "Add/Edit Mail Notifier" );
- assertTextPresent( "Mail Recipient Address:" );
- assertElementPresent( "address" );
- assertTextPresent( "Send a mail to latest committers" );
- assertTextPresent( "Send on Success" );
- assertTextPresent( "Send on Failure" );
- assertTextPresent( "Send on Error" );
- assertTextPresent( "Send on Warning" );
- assertTextPresent( "Send on SCM Failure" );
- assertElementPresent( "Cancel" );
- }
-
- public void assertAddEditIrcNotifierPage()
- {
- assertPage( "Continuum - Add/Edit IRC Notifier" );
-
- assertTextPresent( "IRC Host*:" );
- assertElementPresent( "host" );
-
- assertTextPresent( "IRC port:" );
- assertElementPresent( "port" );
-
- assertTextPresent( "IRC channel*:" );
- assertElementPresent( "channel" );
-
- assertTextPresent( "Nick Name (default value is continuum):" );
- assertElementPresent( "nick" );
-
- assertTextPresent( "Alternate Nick Name (default value is continuum_):" );
- assertElementPresent( "alternateNick" );
-
- assertTextPresent( "User Name (default value is the nick name):" );
- assertElementPresent( "username" );
-
- assertTextPresent( "Full Name (default value is the nick name):" );
- assertElementPresent( "fullName" );
-
- assertTextPresent( "Password" );
- assertElementPresent( "password" );
-
- assertTextPresent( "SSL" );
- assertTextPresent( "Send on Success" );
- assertTextPresent( "Send on Failure" );
- assertTextPresent( "Send on Error" );
- assertTextPresent( "Send on Warning" );
- assertTextPresent( "Send on SCM Failure") ;
- }
-
- public void assertAddEditJabberPage()
- {
- assertPage( "Continuum - Add/Edit Jabber Notifier" );
-
- assertTextPresent( "Jabber Host*:" );
- assertElementPresent( "host" );
- assertTextPresent( "Jabber port:" );
- assertElementPresent( "port" );
- assertTextPresent( "Jabber login*:" );
- assertElementPresent( "login" );
- assertTextPresent( "Jabber Password*:" );
- assertElementPresent( "password" );
- assertTextPresent( "Jabber Domain Name:" );
- assertElementPresent( "domainName" );
- assertTextPresent( "Jabber Recipient Address*:" );
- assertElementPresent( "address" );
-
- assertTextPresent( "Is it a SSL connection?" );
- assertTextPresent( "Is it a Jabber group?" );
- assertTextPresent( "Send on Success" );
- assertTextPresent( "Send on Failure" );
- assertTextPresent( "Send on Error" );
- assertTextPresent( "Send on Warning" );
- assertTextPresent( "Send on SCM Failure" );
- }
-
- public void assertAddEditMsnPage()
- {
- assertPage( "Continuum - Add/Edit MSN Notifier" );
-
- assertTextPresent( "MSN login*:" );
- assertElementPresent( "login" );
- assertTextPresent( "MSN Password*:" );
- assertElementPresent( "password" );
- assertTextPresent( "MSN Recipient Address*:" );
- assertElementPresent( "address" );
-
- assertTextPresent( "Send on Success" );
- assertTextPresent( "Send on Failure" );
- assertTextPresent( "Send on Error" );
- assertTextPresent( "Send on Warning" );
- assertTextPresent( "Send on SCM Failure" );
- }
-
- public void assertAddEditWagonPage()
- {
- assertPage( "Continuum - Add/Edit Wagon Notifier" );
-
- assertTextPresent( "Project Site URL*:" );
- assertElementPresent( "url" );
- assertTextPresent( "Server Id (defined in your settings.xml for authentication)*:" );
- assertElementPresent( "id" );
-
- assertTextPresent( "Send on Success" );
- assertTextPresent( "Send on Failure" );
- assertTextPresent( "Send on Error" );
- assertTextPresent( "Send on Warning" );
- }
-
- public void addMailNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription,
- String email, boolean isValid ) throws Exception
- {
-
- showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( projectGroupName );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "Mail" );
- clickButtonWithValue( "Submit" );
- assertAddEditMailNotifierPage();
- setFieldValue( "address", email );
- clickButtonWithValue( "Save" );
-
- if ( isValid )
- {
- assertNotifierPage( projectGroupName );
- }
- else
- {
- assertTextPresent( "Address is invalid" );
- }
- }
-
- public void addIrcNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription,
- String host, String channel, boolean isValid ) throws Exception
- {
- showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
-
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( projectGroupName );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "IRC" );
-
- clickButtonWithValue( "Submit" );
- assertAddEditIrcNotifierPage();
- setFieldValue( "host", host );
- setFieldValue( "channel", channel );
-
- clickButtonWithValue( "Save" );
- if ( isValid )
- {
- assertNotifierPage( projectGroupName );
- }
- else
- {
- assertTextPresent( "Host is required" );
- assertTextPresent( "Channel is required" );
- }
- }
-
- public void addJabberNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription,
- String host, String login, String password, String address, boolean isValid )
- throws Exception
- {
- showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
-
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( projectGroupName );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "Jabber" );
- clickButtonWithValue( "Submit" );
-
- assertAddEditJabberPage();
- setFieldValue( "host", host );
- setFieldValue( "login", login );
- setFieldValue( "password", password );
- setFieldValue( "address", address );
- clickButtonWithValue( "Save" );
-
- if ( isValid )
- {
- assertNotifierPage( projectGroupName );
- }
- else
- {
- assertTextPresent( "Host is required" );
- assertTextPresent( "Login is required" );
- assertTextPresent( "Password is required" );
- assertTextPresent( "Address is required" );
- }
- }
-
- public void addMsnNotifierPage( String projectGroupName, String projectGroupId, String projectGroupDescription,
- String login, String password, String recipientAddress, boolean isValid )
- throws Exception
- {
- showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
-
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( projectGroupName );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "MSN" );
- clickButtonWithValue( "Submit" );
- assertAddEditMsnPage();
- setFieldValue( "login", login );
- setFieldValue( "password", password );
- setFieldValue( "address", recipientAddress );
- clickButtonWithValue( "Save" );
-
- if ( isValid )
- {
- assertNotifierPage( projectGroupName );
- }
- else
- {
- assertTextPresent( "Login is required" );
- assertTextPresent( "Password is required" );
- assertTextPresent( "Address is required" );
- }
- }
-
- public void addWagonNotifierPage( String projectGroupName, String projectGroupId, String projectGroupDescription,
- String siteUrl, boolean isValid ) throws Exception
- {
- showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
-
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( projectGroupName );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "Wagon" );
- clickButtonWithValue( "Submit" );
- assertAddEditWagonPage();
- setFieldValue( "url", siteUrl );
- clickButtonWithValue( "Save" );
-
- if ( isValid )
- {
- assertNotifierPage( projectGroupName );
- }
- else
- {
- assertTextPresent( "Destination URL is required" );
- }
- }
-
- //////////////////////////////////////
- // General Project Pages
- //////////////////////////////////////
- public void goToEditProjectPage( String projectGroupName, String projectName )
- {
- clickLinkWithText( "Show Project Groups" );
- clickLinkWithText( projectGroupName );
- clickLinkWithText( projectName );
- clickButtonWithValue( "Edit" );
-
- assertEditProjectPage();
- }
-
- public void assertEditProjectPage()
- {
- assertTextPresent( "Update Continuum Project" );
- assertTextPresent( "Project Name*:" );
- assertElementPresent( "name" );
- assertTextPresent( "Version*:" );
- assertElementPresent( "version" );
- assertTextPresent( "SCM Url*:" );
- assertElementPresent( "scmUrl" );
- assertTextPresent( "Use SCM Credentials Cache, if available" );
- assertElementPresent( "scmUseCache" );
- assertTextPresent( "SCM Username:" );
- assertElementPresent( "scmUsername" );
- assertTextPresent( "SCM Password:" );
- assertElementPresent( "scmPassword" );
- assertTextPresent( "SCM Branch/Tag:" );
- assertElementPresent( "scmTag" );
- }
-
- public void goToAddBuildDefinitionPage( String projectGroupName, String projectName )
- {
- clickLinkWithText( "Show Project Groups" );
- clickLinkWithText( projectGroupName );
- clickLinkWithText( projectName );
- clickButtonWithValue( "Add" );
-
- assertAddBuildDefinitionPage();
- }
-
- public void assertAddBuildDefinitionPage()
- {
- assertTextPresent( "Add/Edit Build Definition" );
- assertTextPresent( "POM filename*:" );
- assertElementPresent( "buildFile" );
- assertTextPresent( "Goals:" );
- assertElementPresent( "goals" );
- assertTextPresent( "Arguments:" );
- assertElementPresent( "arguments" );
- assertTextPresent( "Build Fresh" );
- assertElementPresent( "buildFresh" );
- assertTextPresent( "Is it default?" );
- assertElementPresent( "defaultBuildDefinition" );
- assertTextPresent( "Schedule:" );
- assertElementPresent( "scheduleId" );
- }
-
- public void addBuildDefinition( String projectGroupName, String projectName, String buildFile, String goals,
- String arguments, boolean buildFresh, boolean isDefault )
- {
- goToAddBuildDefinitionPage( projectGroupName, projectName );
-
- // Enter values into Add Build Definition fields, and submit
- setFieldValue( "buildFile", buildFile );
- setFieldValue( "goals", goals );
- setFieldValue( "arguments", arguments );
- if ( buildFresh )
- {
- checkField( "buildFresh" );
- }
- if ( isDefault )
- {
- checkField( "defaultBuildDefinition" );
- }
-
- submit();
-
- assertProjectInformationPage();
- }
-
- public void goToAddNotifierPage( String projectGroupName, String projectName )
- {
- clickLinkWithText( "Show Project Groups" );
- clickLinkWithText( projectGroupName );
- clickLinkWithText( projectName );
- getSelenium().click( "addProjectNotifier" );
- clickLinkWithXPath( "//input[@id='addProjectNotifier_0']" );
-
- assertNotifierPage();
- }
-
- public void assertNotifierPage()
- {
- assertPage( "Continuum - Add Notifier" );
- assertTextPresent( "Add Notifier" );
- assertTextPresent( "Type:" );
- assertElementPresent( "notifierType" );
- }
-
- public void addMailNotifier( String projectGroupName, String projectName, String email, boolean success,
- boolean failure, boolean error, boolean warning )
- {
- goToAddNotifierPage( projectGroupName, projectName );
- clickButtonWithValue( "Submit" );
-
- // Enter values into Add Notifier fields, and submit
- setFieldValue( "address", email );
- if ( success )
- {
- checkField( "sendOnSuccess" );
- }
- if ( failure )
- {
- checkField( "sendOnFailure" );
- }
- if ( error )
- {
- checkField( "sendOnError" );
- }
- if ( warning )
- {
- checkField( "sendOnWarning" );
- }
-
- submit();
- assertProjectInformationPage();
- }
-
- public void goToProjectInformationPage( String projectGroupName, String projectName )
- {
- clickLinkWithText( "Show Project Groups" );
- clickLinkWithText( projectGroupName );
- clickLinkWithText( projectName );
-
- assertProjectInformationPage();
- }
-
- public void assertProjectInformationPage()
- {
- assertTextPresent( "Project Group Summary" );
- assertTextPresent( "Project Information" );
- assertTextPresent( "Builds" );
- assertTextPresent( "Working Copy" );
- assertTextPresent( "Build Definitions" );
- assertTextPresent( "Notifiers" );
- assertTextPresent( "Dependencies" );
- assertTextPresent( "Developers" );
- }
-
- //////////////////////////////////////
- // Maven 2.0.x Project
- //////////////////////////////////////
- public void goToAddMavenTwoProjectPage()
- {
- clickLinkWithText( "Maven 2.0.x Project" );
-
- assertAddMavenTwoProjectPage();
- }
-
- public void assertAddMavenTwoProjectPage()
- {
- assertTextPresent( "POM Url" );
- assertElementPresent( "m2PomUrl" );
- assertTextPresent( "Username" );
- assertElementPresent( "scmUsername" );
- assertTextPresent( "Password" );
- assertElementPresent( "scmPassword" );
- assertElementPresent( "scmUseCache" );
- assertTextPresent( "Upload POM" );
- assertElementPresent( "m2PomFile" );
- assertTextPresent( "Project Group" );
- assertElementPresent( "selectedProjectGroup" );
- assertTextPresent( "Build Definition Template" );
- assertElementPresent( "buildDefinitionTemplateId" );
- }
-
- public void addMavenTwoProject( String pomUrl, String username, String password, String projectGroup, boolean validProject )
- throws Exception
- {
- goToAddMavenTwoProjectPage();
-
- // Enter values into Add Maven Two Project fields, and submit
- setFieldValue( "m2PomUrl", pomUrl );
- setFieldValue( "scmUsername", username );
- setFieldValue( "scmPassword", password );
-
- if ( projectGroup != null )
- {
- selectValue( "addMavenTwoProject_selectedProjectGroup", projectGroup );
- }
-
- submit();
-
- if ( validProject )
- {
- assertProjectGroupsSummaryPage();
- }
- else
- {
- assertAddMavenTwoProjectPage();
- }
- }
-
- //TODO: problem with input type="file", selenium.type(..) does not work,
- // TODO: refer to http://forums.openqa.org/thread.jspa?messageID=1365Օ for workaround
- /*
- public void addMavenTwoProject( String pomFile, String projectGroup, boolean validProject )
- throws Exception
- {
- goToAddMavenTwoProjectPage();
-
- // Enter values into Add Maven Two Project fields, and submit
- setFieldValue( "m2PomFile", pomFile );
-
- if ( projectGroup != null )
- {
- selectValue( "addMavenTwoProject_selectedProjectGroup", projectGroup );
- }
-
- submit();
-
- if ( validProject )
- {
- assertProjectGroupsSummaryPage();
- }
- else
- {
- assertAddMavenTwoProjectPage();
- }
- }
- */
-
- //////////////////////////////////////
- // Maven 1.x Project
- //////////////////////////////////////
- public void goToAddMavenOneProjectPage()
- {
- clickLinkWithText( "Maven 1.x Project" );
-
- assertAddMavenOneProjectPage();
- }
-
- public void assertAddMavenOneProjectPage()
- {
- assertPage( "Continuum - Add Maven 1 Project" );
- assertTextPresent( "M1 POM Url" );
- assertElementPresent( "m1PomUrl" );
- assertTextPresent( "Username" );
- assertElementPresent( "scmUsername" );
- assertTextPresent( "Password" );
- assertElementPresent( "scmPassword" );
- assertElementPresent( "scmUseCache" );
- assertTextPresent( "Upload POM" );
- assertElementPresent( "m1PomFile" );
- assertTextPresent( "Project Group" );
- assertElementPresent( "selectedProjectGroup" );
- assertTextPresent( "Build Definition Template" );
- assertElementPresent( "buildDefinitionTemplateId" );
- }
-
- public void addMavenOneProject( String pomUrl, String username, String password, String projectGroup, boolean validProject )
- throws Exception
- {
- goToAddMavenOneProjectPage();
-
- // Enter values into Add Maven One Project fields, and submit
- setFieldValue( "m1PomUrl", pomUrl );
- setFieldValue( "scmUsername", username );
- setFieldValue( "scmPassword", password );
-
- if ( projectGroup != null )
- {
- selectValue( "addMavenOneProject_selectedProjectGroup", projectGroup );
- }
-
- clickButtonWithValue( "Add" );
- assertTextPresent( "Adding your project is in progress. Please wait .." );
- waitPage( 100000 );
-
- if ( validProject )
- {
- assertProjectGroupsSummaryPage();
- }
- else
- {
- assertAddMavenOneProjectPage();
- }
- }
-
- //TODO: problem with input type="file", selenium.type(..) does not work,
- // TODO: refer to http://forums.openqa.org/thread.jspa?messageID=1365Օ for workaround
- /*
- public void addMavenOneProject( String pomFile, String projectGroup, boolean validProject )
- throws Exception
- {
- goToAddMavenOneProjectPage();
-
- // Enter values into Add Maven One Project fields, and submit
- setFieldValue( "m1PomFile", pomFile );
-
- if ( projectGroup != null )
- {
- selectValue( "addMavenOneProject_selectedProjectGroup", projectGroup );
- }
-
- submit();
-
- if ( validProject )
- {
- assertProjectGroupsSummaryPage();
- }
- else
- {
- assertAddMavenOneProjectPage();
- }
- }
- */
-
- public void moveProjectToProjectGroup( String name, String groupId, String description, String newProjectGroup )
- throws Exception
- {
- showProjectGroup( name, groupId, description );
-
- assertElementPresent( "edit" );
- clickButtonWithValue( "Edit" );
-
- //assertTextPresent( "Move to Group" );
- selectValue( "//select", newProjectGroup );
-
- assertElementPresent( "saveProjectGroup_" );
- clickButtonWithValue( "Save" );
- }
-
- public void tearDown()
- throws Exception
- {
- super.tearDown();
- }
-
- protected String getWebContext()
- {
- return "/continuum";
- }
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractGuestAccessTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractGuestAccessTestCase.java
deleted file mode 100644
index e95f0d9..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractGuestAccessTestCase.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractGuestAccessTestCase
- extends AbstractContinuumTestCase
-{
- public void setUp()
- throws Exception
- {
- super.setUp();
- assertFalse( "User was authenticated.", isAuthenticated() );
- }
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java
deleted file mode 100644
index ba770e4..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractSeleniumTestCase.java
+++ /dev/null
@@ -1,593 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * 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.
- */
-
-import com.thoughtworks.selenium.DefaultSelenium;
-import com.thoughtworks.selenium.Selenium;
-import junit.framework.TestCase;
-import org.codehaus.plexus.util.StringUtils;
-
-import java.io.File;
-import java.util.Calendar;
-import java.util.Properties;
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractSeleniumTestCase
- extends TestCase
-{
- public static final String CHECKBOX_CHECK = "on";
-
- public static final String CHECKBOX_UNCHECK = "off";
-
- private Selenium sel;
-
- protected String adminUsername;
-
- protected String adminPassword;
-
- protected String adminFullName = getApplicationName() + " Admin";
-
- protected String adminEmail = "admin@localhost.localdomain";
-
- protected String maxWaitTimeInMs;
-
- protected String baseUrl;
-
- public void setUp()
- throws Exception
- {
- super.setUp();
-
- Properties p = new Properties();
- p.load ( this.getClass().getClassLoader().getResourceAsStream( "it.properties" ) );
-
- baseUrl = p.getProperty( "BASE_URL" );
- maxWaitTimeInMs = p.getProperty( "MAX_WAIT_TIME_IN_MS" );
- adminUsername = p.getProperty( "ADMIN_USERNAME" );
- adminPassword = p.getProperty( "ADMIN_PASSWORD" );
- String seleniumHost = p.getProperty( "SELENIUM_HOST" );
- int seleniumPort = Integer.parseInt( (p.getProperty( "SELENIUM_PORT" ) ) );
-
- String browser = System.getProperty( "browser" );
- if ( StringUtils.isEmpty( browser ) )
- {
- browser = p.getProperty( "SELENIUM_BROWSER" );
- }
-
- sel = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
- sel.start();
- initialize();
- }
-
- public void tearDown()
- throws Exception
- {
- sel.stop();
- }
-
- public Selenium getSelenium()
- {
- return sel;
- }
-
- public abstract String getBaseUrl();
-
- /**
- * We create an admin user if it doesn't exist
- */
- protected void initialize()
- {
- open( getWebContext() );
-
- if ( getTitle().endsWith( "Create Admin User" ) )
- {
- assertCreateAdminUserPage();
- submitCreateAdminUserPage( adminFullName, adminEmail, adminPassword, adminPassword );
- assertLoginPage();
- submitLoginPage( adminUsername, adminPassword );
- postAdminUserCreation();
- logout();
- }
- }
-
- /**
- * where webapp initial configurations can be done
- */
- protected void postAdminUserCreation()
- {
- if ( getTitle().endsWith( "Continuum - Configuration" ) )
- {
- String workingDir = sel.getValue( "configuration_workingDirectory" );
- String buildOutputDir = sel.getValue( "configuration_buildOutputDirectory" );
- String releaseOutputDir = sel.getValue( "configuration_releaseOutputDirectory" );
- String locationDir = "target/data";
- String data = "data";
- setFieldValue( "workingDirectory" , workingDir.replaceFirst( data, locationDir ) );
- setFieldValue( "buildOutputDirectory", buildOutputDir.replaceFirst( data , locationDir ) );
- setFieldValue( "releaseOutputDirectory" , releaseOutputDir.replaceFirst( data, locationDir ) );
- setFieldValue( "baseUrl", baseUrl );
- clickButtonWithValue( "Save" );
- }
- }
-
- protected abstract String getApplicationName();
-
- /**
- * some webapps have
- *
- * @return the page prefix set by the webapp
- */
- protected String getTitlePrefix()
- {
- return "";
- }
-
- protected abstract String getInceptionYear();
-
- protected String getWebContext()
- {
- return "/";
- }
-
- public void open( String url )
- {
- sel.open( url );
- }
-
- public String getTitle()
- {
- return sel.getTitle();
- }
-
- public String getHtmlContent()
- {
- return getSelenium().getHtmlSource();
- }
-
- public void assertTextPresent( String text )
- {
- assertTrue( "'" + text + "' isn't present.", sel.isTextPresent( text ) );
- }
-
- public void assertTextNotPresent( String text )
- {
- assertFalse( "'" + text + "' is present.", sel.isTextPresent( text ) );
- }
-
- public void assertElementPresent( String elementLocator )
- {
- assertTrue( "'" + elementLocator + "' isn't present.", isElementPresent( elementLocator ) );
- }
-
- public void assertElementNotPresent( String elementLocator )
- {
- assertFalse( "'" + elementLocator + "' is present.", isElementPresent( elementLocator ) );
- }
-
- public void assertLinkPresent( String text )
- {
- assertTrue( "The link '" + text + "' isn't present.", isElementPresent( "link=" + text ) );
- }
-
- public void assertLinkNotPresent( String text )
- {
- assertFalse( "The link '" + text + "' is present.", isElementPresent( "link=" + text ) );
- }
-
- public void assertImgWithAlt( String alt )
- {
- assertElementPresent( "//img[@alt='" + alt + "']" );
- }
-
- public void assertImgWithAltAtRowCol( boolean isALink, String alt, int row, int column )
- {
- String locator = "//tr[" + row + "]/td[" + column + "]/";
- locator += isALink ? "a/" : "";
- locator += "img[@alt='" + alt + "']";
-
- assertElementPresent( locator );
- }
-
- public void assertCellValueFromTable( String expected, String tableElement, int row, int column )
- {
- assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );
- }
-
- public boolean isTextPresent( String text )
- {
- return sel.isTextPresent( text );
- }
-
- public boolean isLinkPresent( String text )
- {
- return isElementPresent( "link=" + text );
- }
-
- public boolean isElementPresent( String locator )
- {
- return sel.isElementPresent( locator );
- }
-
- public void waitPage()
- {
- waitPage( 180000 );
- }
-
- public void waitPage( int nbMillisecond )
- {
- sel.waitForPageToLoad( String.valueOf( nbMillisecond ) );
- }
-
- public void assertPage( String title )
- {
- assertEquals( getTitlePrefix() + title, getTitle() );
- assertHeader();
- //assertFooter();
- }
-
- public abstract void assertHeader();
-
-
- public void assertFooter()
- {
- int currentYear = Calendar.getInstance().get( Calendar.YEAR );
- assertTrue( getSelenium().getText( "xpath=//div[@id='footer']/div[1]" ).endsWith(
- "Copyright © " + getInceptionYear() + "-" + currentYear + " The Apache Software Foundation" ) );
- }
-
- public String getFieldValue( String fieldName )
- {
- return sel.getValue( fieldName );
- }
-
- public String getCellValueFromTable( String tableElement, int row, int column )
- {
- return getSelenium().getTable( tableElement + "." + row + "." + column );
- }
-
- public void selectValue( String locator, String value )
- {
- getSelenium().select( locator, "label=" + value );
- }
-
- public void submit()
- {
- clickLinkWithXPath( "//input[@type='submit']" );
- }
-
- public void assertButtonWithValuePresent( String text )
- {
- assertTrue( "'" + text + "' button isn't present", isButtonWithValuePresent( text ) );
- }
-
- public void assertButtonWithValueNotPresent( String text )
- {
- assertFalse( "'" + text + "' button is present", isButtonWithValuePresent( text ) );
- }
-
- public boolean isButtonWithValuePresent( String text )
- {
- return isElementPresent( "//button[@value='" + text + "']" ) || isElementPresent( "//input[@value='" + text + "']" );
- }
-
- public void clickButtonWithValue( String text )
- {
- clickButtonWithValue( text, true );
- }
-
- public void clickButtonWithValue( String text, boolean wait )
- {
- assertButtonWithValuePresent( text );
-
- if ( isElementPresent( "//button[@value='" + text + "']" ) )
- {
- clickLinkWithXPath( "//button[@value='" + text + "']", wait );
- }
- else
- {
- clickLinkWithXPath( "//input[@value='" + text + "']", wait );
- }
- }
-
- public void clickSubmitWithLocator( String locator )
- {
- clickLinkWithLocator( locator );
- }
-
- public void clickSubmitWithLocator( String locator, boolean wait )
- {
- clickLinkWithLocator( locator, wait );
- }
-
- public void clickImgWithAlt( String alt )
- {
- clickLinkWithLocator( "//img[@alt='" + alt + "']" );
- }
-
- public void clickLinkWithText( String text )
- {
- clickLinkWithText( text, true );
- }
-
- public void clickLinkWithText( String text, boolean wait )
- {
- clickLinkWithLocator( "link=" + text, wait );
- }
-
- public void clickLinkWithXPath( String xpath )
- {
- clickLinkWithXPath( xpath, true );
- }
-
- public void clickLinkWithXPath( String xpath, boolean wait )
- {
- clickLinkWithLocator( "xpath=" + xpath, wait );
- }
-
- public void clickLinkWithLocator( String locator )
- {
- clickLinkWithLocator( locator, true );
- }
-
- public void clickLinkWithLocator( String locator, boolean wait )
- {
- assertElementPresent( locator );
- sel.click( locator );
- if ( wait )
- {
- waitPage();
- }
- }
-
- public void setFieldValue( String fieldName, String value )
- {
- sel.type( fieldName, value );
- }
-
- public void checkField( String locator )
- {
- sel.check( locator );
- }
-
- public void uncheckField( String locator )
- {
- sel.uncheck( locator );
- }
-
- public boolean isChecked( String locator )
- {
- return sel.isChecked( locator );
- }
-
- //////////////////////////////////////
- // Login
- //////////////////////////////////////
- public void goToLoginPage()
- {
- clickLinkWithText( "Login" );
-
- assertLoginPage();
- }
-
- public void login( String username, String password )
- {
- login( username, password, true, "Login Page" );
- }
-
- public void login( String username, String password, boolean valid, String assertReturnPage )
- {
- if ( isLinkPresent( "Login" ) )
- {
- goToLoginPage();
-
- submitLoginPage( username, password, false, valid, assertReturnPage );
- }
- }
-
- public void assertLoginPage()
- {
- assertPage( "Login Page" );
- assertTextPresent( "Login" );
- assertTextPresent( "Username" );
- assertTextPresent( "Password" );
- assertTextPresent( "Remember Me" );
- assertFalse( isChecked( "rememberMe" ) );
- }
-
- public void submitLoginPage( String username, String password )
- {
- submitLoginPage( username, password, false, true, "Login Page" );
- }
-
- public void submitLoginPage( String username, String password, boolean validUsernamePassword )
- {
- submitLoginPage( username, password, false, validUsernamePassword, "Login Page" );
- }
-
- public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword,
- String assertReturnPage )
- {
- assertLoginPage();
- setFieldValue( "username", username );
- setFieldValue( "password", password );
- if ( rememberMe )
- {
- checkField( "rememberMe" );
- }
- clickButtonWithValue( "Login" );
-
- if ( validUsernamePassword )
- {
- assertTextPresent( "Current User:" );
- assertTextPresent( username );
- assertLinkPresent( "Edit Details" );
- assertLinkPresent( "Logout" );
- }
- else
- {
- if ( "Login Page".equals( assertReturnPage ) )
- {
- assertLoginPage();
- }
- else
- {
- assertPage( assertReturnPage );
- }
- }
- }
-
- public boolean isAuthenticated()
- {
- return !( isLinkPresent( "Login" ) && isLinkPresent( "Register" ) );
- }
-
- //////////////////////////////////////
- // Logout
- //////////////////////////////////////
- public void logout()
- {
- assertTrue( "User wasn't authenticated.", isAuthenticated() );
- clickLinkWithText( "Logout" );
- assertFalse( "The user is always authenticated after a logout.", isAuthenticated() );
- }
-
- //////////////////////////////////////
- // My Account
- //////////////////////////////////////
- public void goToMyAccount()
- {
- clickLinkWithText( "Edit Details" );
- }
-
- public void assertMyAccountDetails( String username, String newFullName, String newEmailAddress )
- throws Exception
- {
- assertPage( "Account Details" );
-
- //isTextPresent( "Username" );
- assertTextPresent( "Username:" );
- assertElementPresent( "registerForm_user_username" );
- assertCellValueFromTable( username, "//form/table", 0, 1 );
-
- assertTextPresent( "Full Name*:" );
- assertElementPresent( "user.fullName" );
- assertEquals( newFullName, getFieldValue( "user.fullName" ) );
-
- assertTextPresent( "Email Address*:" );
- assertElementPresent( "user.email" );
- assertEquals( newEmailAddress, getFieldValue( "user.email" ) );
-
- assertTextPresent("Current Password*:");
- assertElementPresent("oldPassword");
-
- assertTextPresent( "New Password*:" );
- assertElementPresent( "user.password" );
-
- assertTextPresent( "Confirm Password*:" );
- assertElementPresent( "user.confirmPassword" );
-
- assertTextPresent( "Last Password Change" );
- assertElementPresent( "registerForm_user_timestampLastPasswordChange" );
-
- }
-
- public void editMyUserInfo( String newFullName, String newEmailAddress, String oldPassword, String newPassword,
- String confirmNewPassword )
- {
- goToMyAccount();
-
- setFieldValue( "user.fullName", newFullName );
- setFieldValue( "user.email", newEmailAddress );
- setFieldValue( "oldPassword", oldPassword );
- setFieldValue( "user.password", newPassword );
- setFieldValue( "user.confirmPassword", confirmNewPassword );
- clickButtonWithValue( "Submit" );
- }
-
- //////////////////////////////////////
- // User Roles
- //////////////////////////////////////
- public void assertUserRoleCheckBoxPresent( String value )
- {
- sel.isElementPresent( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
- }
-
- public void assertResourceRolesCheckBoxPresent( String value )
- {
- sel.isElementPresent( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
- }
-
- public void checkUserRoleWithValue( String value )
- {
- assertUserRoleCheckBoxPresent( value );
- sel.click( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
- }
-
- public void checkResourceRoleWithValue( String value )
- {
- assertResourceRolesCheckBoxPresent( value );
- sel.click( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
- }
-
- //////////////////////////////////////
- // Create Admin User
- //////////////////////////////////////
- public void assertCreateAdminUserPage()
- {
- assertPage( "Create Admin User" );
- assertTextPresent( "Create Admin User" );
- assertTextPresent( "Username" );
- assertElementPresent( "user.username" );
- assertTextPresent( "Full Name" );
- assertElementPresent( "user.fullName" );
- assertTextPresent( "Email Address" );
- assertElementPresent( "user.email" );
- assertTextPresent( "Password" );
- assertElementPresent( "user.password" );
- assertTextPresent( "Confirm Password" );
- assertElementPresent( "user.confirmPassword" );
- }
-
- public void submitCreateAdminUserPage( String fullName, String email, String password, String confirmPassword )
- {
- setFieldValue( "user.fullName", fullName );
- setFieldValue( "user.email", email );
- setFieldValue( "user.password", password );
- setFieldValue( "user.confirmPassword", confirmPassword );
- submit();
- waitPage();
- }
-
- public String getBasedir()
- {
- String basedir = System.getProperty( "basedir" );
-
- if ( basedir == null )
- {
- basedir = new File( "" ).getAbsolutePath();
- }
-
- return basedir;
- }
-
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AccountSecurityTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AccountSecurityTest.java
deleted file mode 100644
index 663243d..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AccountSecurityTest.java
+++ /dev/null
@@ -1,920 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-
-public class AccountSecurityTest
- extends AbstractAuthenticatedAccessTestCase
-{
- public final String SIMPLE_POM = getBasedir() + "/target/test-classes/unit/simple-project/pom.xml";
-
- // create user fields
- public static final String CREATE_FORM_USERNAME_FIELD = "userCreateForm_user_username";
-
- public static final String CREATE_FORM_FULLNAME_FIELD = "userCreateForm_user_fullName";
-
- public static final String CREATE_FORM_EMAILADD_FIELD = "userCreateForm_user_email";
-
- public static final String CREATE_FORM_PASSWORD_FIELD = "userCreateForm_user_password";
-
- public static final String CREATE_FORM_CONFIRM_PASSWORD_FIELD = "userCreateForm_user_confirmPassword";
-
- public static final String PASSWORD_FIELD = "user.password";
-
- public static final String CONFIRM_PASSWORD_FIELD = "user.confirmPassword";
-
- public static final String DUMMY_USER = "user_dummy";
-
- public static final String GUEST_USER = "new_guest";
-
- public static final String REGISTERED_USER = "reguser";
-
- public static final String SYSTEM_ADMINISTRATOR = "sysad";
-
- public static final String USER_ADMINISTRATOR = "useradmin";
-
- public static final String GROUP_PROJECT_ADMIN = "projadmingroup";
-
- public static final String GROUP_PROJECT_DEVELOPER = "projdevgroup";
-
- public static final String GROUP_PROJECT_USER = "projusergroup";
-
- public static final String MANAGE_BUILD_ENV = "managebuildenv";
-
- public static final String MANAGE_BUILD_TEMPLATES = "managebuildtemp";
-
- public static final String INSTALLATION = "manageinstallation";
-
- public static final String LOCAL_REPOSITORIES = "managelocalrepo";
-
- public static final String PURGING = "managepurging";
-
- public static final String QUEUES = "managequeues";
-
- public static final String SCHEDULING = "scheduling";
-
- public static final String PROJECT_ADMIN = "projectadmin";
-
- public static final String PROJECT_DEV = "projectdev";
-
- public static final String PROJECT_USER = "projectuser";
-
- public static final String CUSTOM_FULLNAME = "custom fullname";
-
- public static final String CUSTOM_EMAILADD = "custom@custom.com";
-
- public static final String CUSTOM_PASSWORD = "custompassword1";
-
- public static final String CUSTOM_PASSWORD1 = "user1234";
-
- public String getUsername()
- {
- return super.adminUsername;
- }
-
- public String getPassword()
- {
- return super.adminPassword;
- }
-
- public void testBasicUserAddDelete()
- {
- createUser( GUEST_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true );
-
- // delete custom user
- deleteUser( GUEST_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- }
-
- public void testPasswordConfirmation()
- throws Exception
- {
- // initial user account creation ignores the password creation checks
- createUser( USER_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true );
- logout();
-
- // start password creation validation test
- login( USER_ADMINISTRATOR, CUSTOM_PASSWORD );
-
- // Edit user informations
- goToMyAccount();
-
- //TODO: verify account details page
- assertPage( "Change Password" );
-
- // test password confirmation
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", CUSTOM_PASSWORD );
- setFieldValue( "newPasswordConfirm", CUSTOM_PASSWORD + "error" );
- submit();
-
- // we should still be in Account Details
- assertPage( "Change Password" );
- isTextPresent( "Password confirmation failed. Passwords do not match." );
-
- logout();
-
- // house keeping
- login( getUsername(), getPassword() );
- deleteUser( USER_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
-
- public void testTenStrikeRule()
- throws Exception
- {
- createUser( GROUP_PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true );
- logout();
-
- login( GROUP_PROJECT_ADMIN, CUSTOM_PASSWORD );
-
- assertPage( "Change Password" );
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", CUSTOM_PASSWORD1 );
- setFieldValue( "newPasswordConfirm", CUSTOM_PASSWORD1 );
- clickButtonWithValue( "Change Password" );
- logout();
-
- int numberOfTries = 10;
-
- for ( int nIndex = 0; nIndex < numberOfTries; nIndex++ )
- {
- if ( nIndex < 9 )
- {
- login( GROUP_PROJECT_ADMIN, CUSTOM_PASSWORD, false, "Login Page" );
- // login should fail
- assertTextPresent( "You have entered an incorrect username and/or password." );
- assertFalse( "user is authenticated using wrong password", isAuthenticated() );
- }
- else
- {
- // on the 10nth try, account is locked and we are returned to the Group Summary Page
- login( GROUP_PROJECT_ADMIN, CUSTOM_PASSWORD, false, "Continuum - Group Summary" );
- assertTextPresent( "Account Locked" );
- }
- }
-
- // house keeping
- login( getUsername(), getPassword() );
- deleteUser( GROUP_PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD, false, true );
- logout();
- }
-
- public void testDefaultRolesOfNewSystemAdministrator()
- throws Exception
- {
- // initialize
- createUser( SYSTEM_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true );
-
- // upgrade the role of the user to system administrator
- assertUsersListPage();
- clickLinkWithText( SYSTEM_ADMINISTRATOR );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "System Administrator" );
- submit();
-
- // after adding roles, we are returned to the list of users
- //TODO: check Permanent/validated/locked columns
- clickLinkWithText( SYSTEM_ADMINISTRATOR );
-
- assertPage( "[Admin] User Edit" );
- // verify roles
- String sysadRoles = "Continuum Group Project Administrator,Continuum Group Project Developer,Continuum Group Project User,Continuum Manage Build Environments,Continuum Manage Build Templates,Continuum Manage Installations,Continuum Manage Local Repositories,Continuum Manage Purging,Continuum Manage Queues,Continuum Manage Scheduling,Project Administrator - Default Project Group,Project Developer - Default Project Group,Project User - Default Project Group,System Administrator,User Administrator";
- String[] arraySysad = sysadRoles.split( "," );
- for( String sysadroles : arraySysad )
- assertTextPresent( sysadroles );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( SYSTEM_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfUserAdmin()
- {
- createUser( USER_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( USER_ADMINISTRATOR );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "User Administrator" );
- submit();
- clickLinkWithText( USER_ADMINISTRATOR );
-
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "User Administrator" );
-
- logout();
-
- login(USER_ADMINISTRATOR, CUSTOM_PASSWORD);
- changePassword();
- assertPagesWithUserRoles( "User Administrator" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( USER_ADMINISTRATOR, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfRegisteredUser()
- {
- createUser( REGISTERED_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( REGISTERED_USER );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Registered User" );
- submit();
- //check registered user available roles if correct
- clickLinkWithText( REGISTERED_USER );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Registered User" );
- logout();
-
- //check registered user's access to continuum page
- login( REGISTERED_USER, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Registered User" );
- logout();
-
- //house keeping
- login( getUsername(), getPassword() );
- deleteUser( REGISTERED_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
-
- public void testDefaultRolesOfGuestUser()
- {
- createUser( GUEST_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( GUEST_USER );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Guest" );
- submit();
- //check guest user's available roles if correct
- clickLinkWithText( GUEST_USER );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Guest" );
- logout();
-
- //check access to continuum page
- login( GUEST_USER, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Guest" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( GUEST_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
-
- public void testDefaultRolesOfProjectGroupAdmin()
- {
- createUser( GROUP_PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( GROUP_PROJECT_ADMIN );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Group Project Administrator" );
- submit();
- //check project group admin's available roles if correct
- clickLinkWithText( GROUP_PROJECT_ADMIN );
- assertPage( "[Admin] User Edit" );
- String userProjectGroupAdmin = "Continuum Group Project Administrator,Continuum Group Project Developer,Continuum Group Project User,Project Administrator - Default Project Group,Project Developer - Default Project Group,Project User - Default Project Group";
- String[] arrayProjectGroupAdmin = userProjectGroupAdmin.split( "," );
- for( String projectgroupadmin : arrayProjectGroupAdmin )
- assertTextPresent( projectgroupadmin );
- logout();
- //check access to continuum page
- login( GROUP_PROJECT_ADMIN, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Group Project Administrator" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( GROUP_PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
-
- public void testDefaultRolesOfProjectGroupDev()
- {
- createUser( GROUP_PROJECT_DEVELOPER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( GROUP_PROJECT_DEVELOPER );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Group Project Developer" );
- submit();
- //check available roles if correct
- clickLinkWithText( GROUP_PROJECT_DEVELOPER );
- assertPage( "[Admin] User Edit" );
- String userProjectGroupDev = "Continuum Group Project Developer,Continuum Group Project User,Project Developer - Default Project Group,Project User - Default Project Group";
- String[] arrayProjectGroupDev = userProjectGroupDev.split( "," );
- for( String projectgroupdev : arrayProjectGroupDev )
- assertTextPresent( projectgroupdev );
- logout();
- //check access to continuum page
- login( GROUP_PROJECT_DEVELOPER, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Group Project Developer" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( GROUP_PROJECT_DEVELOPER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfProjectGroupUser()
- {
- createUser( GROUP_PROJECT_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( GROUP_PROJECT_USER );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Group Project User" );
- submit();
- //check available roles if correct
- clickLinkWithText( GROUP_PROJECT_USER );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Group Project User" );
- assertTextPresent( "Project User - Default Project Group" );
- logout();
- //check access to continuum page
- login( GROUP_PROJECT_USER, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Group Project Developer" );
- logout();
-
- login( getUsername(), getPassword() );
-
- deleteUser( GROUP_PROJECT_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfBuildEnvironments()
- {
- createUser( MANAGE_BUILD_ENV, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( MANAGE_BUILD_ENV );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Build Environments" );
- submit();
-
- clickLinkWithText( MANAGE_BUILD_ENV );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Build Environments" );
- logout();
-
- //check access to continuum page
- login( MANAGE_BUILD_ENV, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Build Environments" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( MANAGE_BUILD_ENV, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfBuildTemp()
- {
- createUser( MANAGE_BUILD_TEMPLATES, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( MANAGE_BUILD_TEMPLATES );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Build Templates" );
- submit();
-
- clickLinkWithText( MANAGE_BUILD_TEMPLATES );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Build Templates" );
- logout();
-
- //check access to continuum page
- login( MANAGE_BUILD_TEMPLATES, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Build Templates" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( MANAGE_BUILD_TEMPLATES, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfInstallations()
- {
- createUser( INSTALLATION, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( INSTALLATION );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Installations" );
- submit();
-
- clickLinkWithText( INSTALLATION );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Installations" );
- logout();
-
- //check access to continuum page
- login( INSTALLATION, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Installations" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( INSTALLATION, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfLocalRepositories()
- {
- createUser( LOCAL_REPOSITORIES, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( LOCAL_REPOSITORIES );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Local Repositories" );
- submit();
-
- clickLinkWithText( LOCAL_REPOSITORIES );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Local Repositories" );
- logout();
-
- //check access to continuum page
- login( LOCAL_REPOSITORIES, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Local Repositories" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( LOCAL_REPOSITORIES, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfPurging()
- {
- createUser( PURGING, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( PURGING );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Purging" );
- submit();
-
- clickLinkWithText( PURGING );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Purging" );
- logout();
- //check access to continuum page
- login( PURGING, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Purging" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( PURGING, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfQueues()
- {
- createUser( QUEUES, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( QUEUES );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Queues" );
- submit();
-
- clickLinkWithText( QUEUES );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Queues" );
- logout();
-
- //check access to continuum page
- login( QUEUES, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Queues" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( QUEUES, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfScheduling()
- {
- createUser( SCHEDULING, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( SCHEDULING );
- clickLinkWithText( "Edit Roles" );
- checkUserRoleWithValue( "Continuum Manage Scheduling" );
- submit();
-
- clickLinkWithText( SCHEDULING );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Continuum Manage Scheduling" );
- logout();
- //check access to continuum page
- login( SCHEDULING, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Continuum Manage Scheduling" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( SCHEDULING, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfProjectAdmin()
- {
- createUser( PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( PROJECT_ADMIN );
- clickLinkWithText( "Edit Roles" );
- checkResourceRoleWithValue( "Project Administrator - Default Project Group" );
- submit();
-
- clickLinkWithText( PROJECT_ADMIN );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Project Administrator - Default Project Group" );
- assertTextPresent( "Project Developer - Default Project Group" );
- assertTextPresent( "Project User - Default Project Group" );
- logout();
- //check access to continuum page
- login( PROJECT_ADMIN, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Project Administrator - Default Project Group" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( PROJECT_ADMIN, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfProjectDev()
- {
- createUser( PROJECT_DEV, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( PROJECT_DEV );
- clickLinkWithText( "Edit Roles" );
- checkResourceRoleWithValue( "Project Developer - Default Project Group" );
- submit();
-
- clickLinkWithText( PROJECT_DEV );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Project Developer - Default Project Group" );
- assertTextPresent( "Project User - Default Project Group" );
- logout();
- //check access to continuum page
- login( PROJECT_DEV, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Project Developer - Default Project Group" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( PROJECT_DEV, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
- public void testDefaultRolesOfProjectUser()
- {
- createUser( PROJECT_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true);
- assertUsersListPage();
- clickLinkWithText( PROJECT_USER );
- clickLinkWithText( "Edit Roles" );
- checkResourceRoleWithValue( "Project User - Default Project Group" );
- submit();
-
- clickLinkWithText( PROJECT_USER );
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "Project User - Default Project Group" );
- logout();
- //check access to continuum page
- login( PROJECT_USER, CUSTOM_PASSWORD );
- changePassword();
- assertPagesWithUserRoles( "Project User - Default Project Group" );
- logout();
-
- login( getUsername(), getPassword() );
- deleteUser( PROJECT_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-
-/* public void testPasswordCreationValidation()
- throws Exception
- {
- // initial user account creation ignores the password creation checks
- createUser( DUMMY_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD, CUSTOM_PASSWORD, true );
- logout();
-
- // start password creation validation test
- login( DUMMY_USER, CUSTOM_PASSWORD );
-
- // password test
- String alphaTest = "abcdef";
- String numericalTest = "123456";
- String characterLengthTest = "aaaaaaa12";
- String validPassword = "abc123";
-
- //TODO: verify account details page
- assertPage( "Change Password" );
-
- // test all alpha
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", alphaTest );
- setFieldValue( "newPasswordConfirm", alphaTest );
- clickButtonWithValue( "Change Password" );
-
- // we should still be in Account Details
- assertPage( "Change Password" );
- isTextPresent( "You must provide a password containing at least 1 numeric character(s)." );
-
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", numericalTest );
- setFieldValue( "newPasswordConfirm", numericalTest );
- clickButtonWithValue( "Change Password" );
-
- // we should still be in Account Details
- assertPage( "Change Password" );
- isTextPresent( "You must provide a password containing at least 1 alphabetic character(s)." );
-
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", characterLengthTest );
- setFieldValue( "newPasswordConfirm", characterLengthTest );
- clickButtonWithValue( "Change Password" );
-
- // we should still be in Account Details
- assertPage( "Account Details" );
- isTextPresent( "You must provide a password between 1 and 8 characters in length." );
-
- // we should still be in Account Details
- assertPage( "Account Details" );
- isTextPresent( "You must provide a password containing at least 1 alphabetic character(s)." );
-
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", validPassword );
- setFieldValue( "newPasswordConfirm", validPassword );
- clickButtonWithValue( "Submit" );
-
- // we should still be in Account Details
- assertPage( "Continuum - Group Summary" );
-
- logout();
-
- // house keeping
- login( getUsername(), getPassword() );
- deleteUser( DUMMY_USER, CUSTOM_FULLNAME, CUSTOM_EMAILADD );
- logout();
- }
-*/
-
- private void createUser( String userName, String fullName, String emailAdd, String password, boolean valid )
- {
- createUser( userName, fullName, emailAdd, password, password, valid );
- }
-
- private void createUser( String userName, String fullName, String emailAdd, String password, String confirmPassword,
- boolean valid )
- {
- clickLinkWithText( "Users" );
- assertUsersListPage();
-
- // create user
- clickButtonWithValue( "Create New User" );
- assertCreateUserPage();
- setFieldValue( "user.username", userName );
- setFieldValue( "user.fullName", fullName );
- setFieldValue( "user.email", emailAdd );
- setFieldValue( "user.password", password );
- setFieldValue( "user.confirmPassword", confirmPassword );
- submit();
-
- // click past second page without adding any roles
- assertAddUserRolesPage();
- clickButtonWithValue( "Submit" );
-
- if ( valid )
- {
- assertUsersListPage();
-
- String[] columnValues = {userName, fullName, emailAdd};
-
- // check if custom user is created
- assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) );
- //TODO: check Permanent/validated/locked columns
- }
- else
- {
- assertCreateUserPage();
- }
- }
-
- private void deleteUser( String userName, String fullName, String emailAdd )
- {
- deleteUser( userName, fullName, emailAdd, false, false );
- }
-
- private void deleteUser( String userName, String fullName, String emailAdd, boolean validated, boolean locked )
- {
- //TODO: Add permanent/validated/locked values
- String[] columnValues = {userName, fullName, emailAdd};
-
- clickLinkWithText( "Users" );
-
- // delete user
- clickLinkWithXPath( "//table[@id='ec_table']/tbody[2]/tr[3]/td[7]/a/img" );
-
- // confirm
- assertDeleteUserPage( userName );
- submit();
-
- // check if account is successfuly deleted
- assertElementNotPresent( XPathExpressionUtil.getTableRow( columnValues ) );
- }
-
- public void changePassword()
- {
- assertPage( "Change Password" );
- setFieldValue( "existingPassword" , CUSTOM_PASSWORD );
- setFieldValue( "newPassword", CUSTOM_PASSWORD1 );
- setFieldValue( "newPasswordConfirm", CUSTOM_PASSWORD1 );
- clickButtonWithValue( "Change Password" );
- }
-
- /*
- * User assertions starts here...
- * */
-
- public void assertUsersListPage()
- {
- assertPage( "[Admin] User List" );
- assertTextPresent( "[Admin] List of Users in Role: Any" );
- assertLinkPresent( "guest" );
- assertLinkPresent( "admin" );
- }
-
- public void assertCreateUserPage()
- {
- assertPage( "[Admin] User Create" );
- assertTextPresent( "[Admin] User Create" );
- assertTextPresent( "Username*:" );
- assertElementPresent( CREATE_FORM_USERNAME_FIELD );
- assertTextPresent( "Full Name*:" );
- assertElementPresent( CREATE_FORM_FULLNAME_FIELD );
- assertTextPresent( "Email Address*:" );
- assertElementPresent( CREATE_FORM_EMAILADD_FIELD );
- assertTextPresent( "Password*:" );
- assertElementPresent( CREATE_FORM_PASSWORD_FIELD );
- assertTextPresent( "Confirm Password*:" );
- assertElementPresent( CREATE_FORM_CONFIRM_PASSWORD_FIELD );
- assertButtonWithValuePresent( "Create User" );
- }
-
- public void assertAddUserRolesPage()
- {
- assertPage( "[Admin] User Edit" );
- assertTextPresent( "[Admin] User Roles" );
- assertTextPresent( "redback-xwork-integration-core" );
- assertTextPresent( "Redback XWork Integration Security Core" );
- assertTextPresent( "Available Roles:" );
- String rolesCheckbox = "Guest,Registered User,System Administrator,User Administrator,Continuum Group Project Administrator,Continuum Group Project Developer,Continuum Group Project User,Continuum Manage Build Environments,Continuum Manage Build Templates,Continuum Manage Installations,Continuum Manage Local Repositories,Continuum Manage Purging,Continuum Manage Queues,Continuum Manage Scheduling";
- String[] arrayUserRoles = rolesCheckbox.split( "," );
- for( String userRoles : arrayUserRoles )
- assertUserRoleCheckBoxPresent( userRoles );
- assertTextPresent( "Resource Roles:" );
- assertResourceRolesCheckBoxPresent( "Project Administrator - Default Project Group" );
- assertResourceRolesCheckBoxPresent( "Project Developer - Default Project Group" );
- assertResourceRolesCheckBoxPresent( "Project User - Default Project Group" );
- }
-
- public void assertDeleteUserPage( String username )
- {
- assertPage( "[Admin] User Delete" );
- assertTextPresent( "[Admin] User Delete" );
- assertTextPresent( "The following user will be deleted:" );
- assertTextPresent( "Username: " + username );
- assertButtonWithValuePresent( "Delete User" );
- }
-
- public void assertPagesWithUserRoles( String role )
- {
- if( role == "System Administrator" )
- {
- String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Local Repositories,Purge Configurations,Schedules,Installations,Build Environments,Queues,Build Definition Templates,Configuration,Appearance,Users,Roles,Build Queue";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "User Administrator" )
- {
- String navMenu = "About,Show Project Groups,Users,Roles";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Group Project Administrator" )
- {
- String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Schedules,Queues,Users,Roles";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Group Project Developer" )
- {
- String navMenu = "About,Show Project Groups,Queues";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Group Project User" )
- {
- String navMenu = "About,Show Project Groups,Queues";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Build Environments" )
- {
- String navMenu = "About,Show Project Groups,Build Environments";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Build Templates" )
- {
- String navMenu = "About,Show Project Groups,Build Definition Templates";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Installations" )
- {
- String navMenu = "About,Show Project Groups,Installations";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Local Repositories" )
- {
- String navMenu = "About,Show Project Groups,Local Repositories";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Purging" )
- {
- String navMenu = "About,Show Project Groups,Purge Configurations";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Queues" )
- {
- String navMenu = "About,Show Project Groups,Queues";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Continuum Manage Scheduling" )
- {
- String navMenu = "About,Show Project Groups,Schedules";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Project Administrator - Default Project Group" )
- {
- String navMenu = "About,Show Project Groups,Queues,Users,Roles";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else if( role == "Project Developer - Default Project Group" || role == "Project User - Default Project Group" )
- {
- String navMenu = "About,Show Project Groups,Queues";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- }
- else
- {
- String navMenu = "About,Show Project Groups";
- String[] arrayNavMenu = navMenu.split( "," );
- for( String navmenu : arrayNavMenu )
- assertLinkPresent( navmenu );
- assertTextPresent( "Project Groups" );
- //assertTextPresent( "Project Groups list is empty." );
- }
- }
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
deleted file mode 100644
index b27bc9c..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-import java.io.File;
-
-/**
- * Class for testing add maven one project UI page.
- */
-public class AddMavenOneProjectTestCase
- extends AbstractAuthenticatedAccessTestCase
-{
- public String getUsername()
- {
- return adminUsername;
- }
-
- public String getPassword()
- {
- return adminPassword;
- }
-
- public void setUp()
- throws Exception
- {
- super.setUp();
- }
-
- /**
- * submit the page
- *
- * @param m1PomUrl
- * @param validPom
- */
- public void submitAddMavenOneProjectPage( String m1PomUrl, boolean validPom )
- throws Exception
- {
- addMavenOneProject( m1PomUrl, "", "", null, validPom );
-
- if ( validPom )
- {
- assertTextPresent( "Default Project Group" );
- //TODO: Add more tests
- }
- }
-
- /**
- * test with valid pom url
- */
-/* public void testValidPomUrl()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/valid-project.xml";
- submitAddMavenOneProjectPage( pomUrl, true );
- //Test the group is created
- assertTextPresent( "Maven One Project" );
- //TODO: add more tests
- removeProjectGroup( "Maven One Project", "maven-one-project", "This is a sample Maven One Project." );
- }
-*/
- /**
- * test with no pom file or pom url specified
- */
- public void testNoPomSpecified()
- throws Exception
- {
- submitAddMavenOneProjectPage( " ", false );
- assertTextPresent( "Either POM URL or Upload POM is required." );
- }
-
- /**
- * test with missing <repository> element in the pom file
- */
-/* public void testMissingElementInPom()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent( "Missing 'repository' element in the POM." );
- }
-
-*/
- /**
- * test with <extend> element present in pom file
- */
-/* public void testWithExtendElementPom()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent( "Cannot use a POM with an 'extend' element." );
- }
-*/
- /**
- * test with unparseable xml content for pom file
- */
-/* public void testUnparseableXmlContent()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/unparseable-content-project.xml";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent( "The XML content of the POM can not be parsed." );
- }
-*/
- /**
- * test with a malformed pom url
- */
-/* public void testMalformedPomUrl()
- throws Exception
- {
- String pomUrl = "aaa";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent(
- "The specified resource cannot be accessed. Please try again later or contact your administrator." );
- }
-*/
- /**
- * test with an inaccessible pom url
- */
-
-//TODO currently, when adding M1 project that is not accessible, no messages/prompts will be displayed.
-/* public void testInaccessiblePomUrl()
- throws Exception
- {
- String pomUrl = "http://www.google.com";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent( "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
- }
-*/
- /**
- * test unallowed file protocol
- */
-/* public void testNotAllowedProtocol()
- throws Exception
- {
- String pomUrl = "file:///project.xml";
- submitAddMavenOneProjectPage( pomUrl, false );
- assertTextPresent( "The specified resource isn't a file or the protocol used isn't allowed." );
- }
-*/
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
deleted file mode 100644
index 80d7465..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-public class AddMavenTwoProjectTest
- extends AbstractAuthenticatedAdminAccessTestCase
-{
-/* public void testAddMavenTwoProjectFromRemoteSource()
- throws Exception
- {
- // Enter values into Add Maven Two Project fields, and submit
- addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, null, true );
-
- //clickLinkWithText( DEFAULT_PROJ_GRP_NAME );
-
- removeProjectGroup( "Apache Maven", "org.apache.maven", "Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information." );
- }
-
- public void testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup()
- throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME, true );
-
- assertCellValueFromTable( TEST_PROJ_GRP_NAME, "ec_table", 2, 0 );
- assertCellValueFromTable( TEST_PROJ_GRP_ID, "ec_table", 2, 1 );
- assertCellValueFromTable( "1", "ec_table", 2, 2 );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-*/
- /**
- * submit the page
- *
- * @param m2PomUrl
- * @param validPom
- */
- public void submitAddMavenTwoProjectPage( String m2PomUrl, boolean validPom )
- throws Exception
- {
- addMavenTwoProject( m2PomUrl, "", "", null, validPom );
-
- if ( validPom )
- {
- assertTextPresent( "Default Project Group" );
- //TODO: Add more tests
- }
- }
-
- /**
- * Test invalid pom url
- */
- public void testNoPomSpecified()
- throws Exception
- {
- submitAddMavenTwoProjectPage( "", false );
- assertTextPresent( "Either POM URL or Upload POM is required." );
- }
-
- /**
- * Test when scm element is missing from pom
- */
-/* public void testMissingScmElementPom()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent( "Missing 'scm' element in the POM." );
- }
-*/
- /**
- * Test when the specified pom url is invalid
- */
-/* public void testCannotAccessResource()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/asf/maven/continuum/trunk/bad_url/pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent(
- "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
- }
-*/
- /**
- * test with a malformed pom url
- */
- public void testMalformedPomUrl()
- throws Exception
- {
- String pomUrl = "aaa";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent(
- "The specified resource cannot be accessed. Please try again later or contact your administrator." );
- }
-
- /**
- * Test when the connection element is missing from the scm tag
- */
-/* public void testMissingConnectionElement()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent( "Missing 'connection' sub-element in the 'scm' element in the POM." );
- }
-*/
- /**
- * Test when the parent pom is missing or not yet added in continuum
- */
-/* public void testMissingParentPom()
- throws Exception
- {
- String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-parent-pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent(
- "Missing artifact trying to build the POM. Check that its parent POM is available or add it first in Continuum." );
- }
-*/
- /**
- * Test when the modules/subprojects specified in the pom are not found
- */
-/* public void testMissingModules()
- throws Exception
- {
- String pomUrl= "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-modules-pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent( "Unknown error trying to build POM." );
- }
-*/
- /**
- * test with an inaccessible pom url
-
- public void testInaccessiblePomUrl()
- throws Exception
- {
- String pomUrl = "http://www.google.com";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent( "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
- }
-*/
- /**
- * test unallowed file protocol
- */
- public void testNotAllowedProtocol()
- throws Exception
- {
- String pomUrl = "file:///pom.xml";
- submitAddMavenTwoProjectPage( pomUrl, false );
- assertTextPresent( "The specified resource isn't a file or the protocol used isn't allowed." );
- }
-
- /**
- * test cancel button
-
- public void testCancelButton()
- {
- goToAboutPage();
- goToAddMavenTwoProjectPage();
- clickButtonWithValue( "Cancel" );
- assertAboutPage();
- } */
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
deleted file mode 100644
index 7e54047..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public class AntTest
- extends AbstractAuthenticatedAdminAccessTestCase
-{
-/* public void testAddAntProject()
- throws Exception
- {
- goToAddAntPage();
- setFieldValue( "projectName", "Foo" );
- setFieldValue( "projectVersion", "1.0-SNAPSHOT" );
- setFieldValue( "projectScmUrl",
- "https://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-test-projects/ant/" );
- clickButtonWithValue( "Add" );
-
- assertProjectGroupsSummaryPage();
- assertTextPresent( "Default Project Group" );
- clickLinkWithText( "Default Project Group" );
- assertTextPresent( "Foo" );
-
- //TODO Add more tests (values in Default Project Group, values in project view, notifiers, build defintions, delete, build,...)
- }
-*/
- public void testSubmitEmptyForm()
- {
- goToAddAntPage();
- clickButtonWithValue( "Add" );
- assertTextPresent( "Name is required and cannot contain null or spaces only" );
- assertTextPresent( "Version is required and cannot contain null or spaces only" );
- assertTextPresent( "SCM Url is required and cannot contain null or spaces only" );
- assertAddAntProjectPage();
- }
-
-/* public void testSubmitEmptyProjectName()
- {
- goToAddAntPage();
- clickButtonWithValue( "Add", false );
- assertAddAntProjectPage();
- assertTextPresent( "Name is required" );
- }
-
- public void testSubmitEmptyVersion()
- {
- goToAddAntPage();
- clickButtonWithValue( "Add", false );
- assertAddAntProjectPage();
- assertTextPresent( "Version is required" );
- }
-
- public void testSubmitEmptyScmUrl()
- {
- goToAddAntPage();
- clickButtonWithValue( "Add", false );
- assertAddAntProjectPage();
- assertTextPresent( "SCM Url is required" );
- }
-
- public void testSubmitDoubleErrorMessages()
- {
- goToAddAntPage();
- clickButtonWithValue( "Add", false );
- clickButtonWithValue( "Add", false );
- assertAddAntProjectPage();
- if ( "Name is required".equals( getSelenium().getText( "//td/span" ) ) )
- {
- assertFalse( "Double Error Messages", "Name is required".equals( getSelenium().getText( "//tr[2]/td/span" ) ) );
- }
- if ( "Version is required".equals( getSelenium().getText( "//tr[4]/td/span" ) ) )
- {
- assertFalse( "Double Error Messages", "Version is required".equals( getSelenium().getText( "//tr[5]/td/span" ) ) );
- }
- if ( "SCM Url is required".equals( getSelenium().getText( "//tr[7]/td/span" ) ) )
- {
- assertFalse( "Double Error Messages", "SCM Url is required".equals( getSelenium().getText( "//tr[8]/td/span" ) ) );
- }
- }
-*/
- public void testCancelButton()
- {
- goToAboutPage();
- goToAddAntPage();
- clickButtonWithValue( "Cancel" );
- assertTextPresent( "Project Groups" );
- //assertAboutPage();
- }
-
- private void goToAddAntPage()
- {
- clickLinkWithText( "Ant Project" );
- assertAddAntProjectPage();
- }
-
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/LoginTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/LoginTest.java
deleted file mode 100644
index f161042..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/LoginTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public class LoginTest
- extends AbstractGuestAccessTestCase
-{
- public void setUp()
- throws Exception
- {
- super.setUp();
- clickLinkWithText( "Login" );
- assertLoginPage();
- }
-
- public void testWithBadUsername()
- {
- submitLoginPage( "badUsername", "badPassword", false );
- assertLoginPage();
- assertTextPresent( "You have entered an incorrect username and/or password" );
- }
-
- public void testWithBadPassword()
- {
- submitLoginPage( adminUsername, "badPassword", false );
- assertLoginPage();
- assertTextPresent( "You have entered an incorrect username and/or password" );
- }
-
- public void testWithEmptyUsername()
- {
- submitLoginPage( "", "badPassword", false );
- assertLoginPage();
- assertTextPresent( "User Name is required." );
- }
-
- public void testWithEmptyPassword()
- {
- submitLoginPage( adminUsername, "", false );
- assertLoginPage();
- assertTextPresent( "You have entered an incorrect username and/or password" );
- }
-
- public void testWithCorrectUsernamePassword()
- {
- submitLoginPage( adminUsername, adminPassword );
- logout();
- }
-
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/MyAccountTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/MyAccountTest.java
deleted file mode 100644
index f91acaf..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/MyAccountTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * Test update or edit account of the current user.
- */
-public class MyAccountTest
- extends AbstractAuthenticatedAdminAccessTestCase
-{
- public void setUp()
- throws Exception
- {
- super.setUp();
- }
-
- public void testMyAccountEdit()
- throws Exception
- {
- goToMyAccount();
- // check current account details
- assertMyAccountDetails( adminUsername, adminFullName, adminEmail );
- }
-
- public void testEditAccountDuplicatePassword()
- throws Exception
- {
- goToMyAccount();
- assertMyAccountDetails( adminUsername, adminFullName, adminEmail );
- editMyUserInfo( adminFullName, adminEmail, adminPassword ,adminPassword, adminPassword );
- assertTextPresent( "Your password cannot match any of your previous 6 password(s)." );
- clickButtonWithValue( "Cancel" );
- assertPage( "Login Page" );
- }
-
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
deleted file mode 100644
index aab706d..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
+++ /dev/null
@@ -1,478 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-/**
- * Test case for project groups.
- */
-public class ProjectGroupTest
- extends AbstractAuthenticatedAdminAccessTestCase
-{
- public void testAddRemoveProjectGroup()
- throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testDefaultBuildDefinition()
- throws Exception
- {
- goToProjectGroupsSummaryPage();
-
- showProjectGroup( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Build Definitions" );
-
- assertDefaultProjectGroupBuildDefinitionPage();
- }
-/*
- public void testMoveProject()
- throws Exception
- {
- // Add a project group and a project to it
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME, true );
-
- goToProjectGroupsSummaryPage();
-
- // assert that the default project group has 0 projects while the test project group has 1
- assertCellValueFromTable( "0", "ec_table", 1, 8 );
- //assertCellValueFromTable( "1", "ec_table", 2, 8 );
-
- // move the project of the test project group to the default project group
- moveProjectToProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
- DEFAULT_PROJ_GRP_NAME );
-
- // assert that the default project group now has 1 while the test project group has 0
- goToProjectGroupsSummaryPage();
- assertCellValueFromTable( "1", "ec_table", 1, 8 );
- assertCellValueFromTable( "0", "ec_table", 2, 8 );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-*/
- public void testAddBuildDefinitionWithEmptyStrings() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Build Definitions" );
- clickButtonWithValue( "Add" );
- assertAddEditAvailableBuildDefPage();
- setFieldValue( "buildFile" , "" );
- clickButtonWithValue( "Save" );
-
- assertTextPresent( "Build file is required and cannot contain spaces only" );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddBuildDefinitionWithSpaces() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Build Definitions" );
- clickButtonWithValue( "Add" );
- assertAddEditAvailableBuildDefPage();
- setFieldValue( "buildFile", " " );
- clickButtonWithValue( "Save" );
-
- assertTextPresent( "Build file is required and cannot contain spaces only" );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testCancelAddProjectGroup() throws Exception
- {
- clickLinkWithText( "Show Project Groups" );
- clickButtonWithValue( "Add Project Group" );
- clickButtonWithValue( "Cancel" );
-
- assertPage( "Continuum - Group Summary" );
- assertTextPresent( "Project Groups" );
- assertButtonWithValuePresent( "Add Project Group" );
- }
-
- public void testCancelEditProjectGroup() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickButtonWithValue( "Edit" );
- clickButtonWithValue( "Cancel" );
-
- assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testCancelDeleteProjectGroup() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickButtonWithValue( "Delete Group" );
- clickButtonWithValue( "Cancel" );
-
- assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testCancelAddBuildDefinition() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Build Definitions" );
- clickButtonWithValue( "Add" );
- clickButtonWithValue( "Cancel" );
-
- assertTextPresent( "Project Group Build Definitions of " + TEST_PROJ_GRP_NAME );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- /* TODO: Create a test with build definition that can be deleted.
- * Default Build Definition can't be deleted with the latest version.
- *
- * public void testCancelDeleteBuildDefinition() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Build Definitions" );
- clickLinkWithXPath( "//img[@alt='Delete']" );
- clickButtonWithValue( "Cancel" );
-
- assertTextPresent( "Project Group Build Definitions of " + TEST_PROJ_GRP_NAME );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }*/
-
- public void testCancelAddNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Notifiers" );
- clickButtonWithValue( "Add" );
- clickButtonWithValue( "Cancel" );
-
- assertTextPresent( "Project Group Notifiers of group " + TEST_PROJ_GRP_NAME );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testCancelDeleteNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Notifiers" );
- clickButtonWithValue( "Add" );
- clickButtonWithValue( "Submit" );
- setFieldValue( "address", "email@domain.com" );
- submit();
- clickLinkWithXPath( "//img[@alt='Delete']" );
- clickButtonWithValue( "Cancel" );
-
- assertTextPresent( "Project Group Notifiers of group " + TEST_PROJ_GRP_NAME );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddProjectGroupWithEmptyString() throws Exception
- {
- addProjectGroup( "", "", "" );
- assertTextPresent( "Project Group Name is required." );
- assertTextPresent( "Project Group ID is required." );
- }
-
- public void testAddProjectGroupWithWhitespaceString() throws Exception
- {
- addProjectGroup( " ", " ", " " );
- assertTextPresent( "Project Group Name cannot contain spaces only." );
- assertTextPresent( "Project Group ID cannot contain spaces only." );
- }
-
- public void testEditProjectGroupWithInvalidValues() throws Exception
- {
-
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- editProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "",
- TEST_PROJ_GRP_DESCRIPTION + "_2" );
-
- assertTextPresent( "Project Group Name is required." );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testEditProjectGroupWithValidValues() throws Exception
- {
- final String sNewProjectName = TEST_PROJ_GRP_NAME + "_2";
- final String sNewProjectDescription = TEST_PROJ_GRP_DESCRIPTION + "_2";
-
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- editProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, sNewProjectName,
- sNewProjectDescription );
-
- assertProjectGroupSummaryPage( sNewProjectName, TEST_PROJ_GRP_ID, sNewProjectDescription );
-
- removeProjectGroup( sNewProjectName, TEST_PROJ_GRP_ID, sNewProjectDescription );
- }
-
- /* TODO Modify scripts with re: to latest working version
- *
- * public void testProjectGroupAllBuildSuccess() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addValidM2ProjectFromProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
- TEST_POM_URL );
-
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- buildProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickButtonWithValue( "Release" );
-
- assertReleaseSuccess();
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }*/
-
- public void testProjectGroupNoProject() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickButtonWithValue( "Release" );
- // assertReleaseEmpty(); TODO file an issue for this
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- /* The sample URL for projectScmUrl does not exist. Need to have an existing sample project for ant
- *
- * public void testAddGroupProjectAnt() throws Exception
- {
- clickLinkWithText( "Ant Project" );
- assertAddAntProjectPage();
- setFieldValue( "projectName", "Foo" );
- setFieldValue( "projectVersion", "1.0-SNAPSHOT" );
- // TODO change to invalid url
- setFieldValue( "projectScmUrl",
- "https://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-test-projects/ant/" );
-
- // selectValue( "projectTypes", "Add M2 Project" );
- // setselectedProjectGroup
- clickButtonWithValue( "Add" );
-
- assertProjectGroupsSummaryPage();
- assertTextPresent( "Default Project Group" );
- clickLinkWithText( "Default Project Group" );
- assertTextPresent( "Foo" );
-
- }*/
-
- public void testfromGroupBuildDefinition() throws Exception
- {
- final String projectGroupName2 = TEST_PROJ_GRP_NAME + "_2";
- final String projectgroupId2 = TEST_PROJ_GRP_ID + "_2";
- final String projectGroupDescription2 = TEST_PROJ_GRP_DESCRIPTION + "_2";
-
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
-
- addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
-
- addMavenTwoProject( TEST_POM_URL, "", "", projectGroupName2, true );
-
- goToBuildDefinitionPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- clickImgWithAlt( "Build" );
-
- goToProjectGroupsSummaryPage();
-
- removeProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- /* TODO
- *
- * public void testBuildFromProjectGroupSummary() throws Exception
- {
- final String projectGroupName2 = TEST_PROJ_GRP_NAME + "_2";
- final String projectgroupId2 = TEST_PROJ_GRP_ID + "_2";
- final String projectGroupDescription2 = TEST_PROJ_GRP_DESCRIPTION + "_2";
-
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
-
- addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
-
- addMavenTwoProject( TEST_POM_URL, "", "", projectGroupName2, true );
-
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- clickButtonWithValue( "Build" );
-
- assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- removeProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- }*/
-
- /* TODO
- *
- * public void testDeleteProjectGroupBuild() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
-
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- clickImgWithAlt( "Delete" );
- assertElementPresent( "deleteProject_0" );
- assertElementPresent( "Cancel" );
-
- clickSubmitWithLocator( "deleteProject_0" );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }*/
-
-
- public void testAddValidMailNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMailNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "test@test.com", true );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddInvalidMailNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMailNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "invalid_email_add", false );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- /* TODO
- *
- * public void testAddValidIrcNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addIrcNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "test.com", "test_channel",
- true );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddInvalidIrcNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addIrcNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "", "", false );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddValidJabberNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addJabberNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "test", "test_login",
- "hello", "test@address.com", true );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddInvalidJabberNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addJabberNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "", "", "", "", false );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddValidMsnNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMsnNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "test", "hello",
- "test@address.com", true );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddInvalidMsnNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addMsnNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "", "", "", false );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddValidWagonNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, TEST_POM_URL, true );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }
-
- public void testAddInvalidWagonNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, "", false );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }*/
-
- /* TODO
- *
- *
- * public void testDeleteNotifier() throws Exception
- {
- addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
-
- clickLinkWithText( "Notifiers" );
- assertNotifierPage( TEST_PROJ_GRP_NAME );
-
- clickButtonWithValue( "Add" );
- assertAddNotifierPage();
- selectValue( "addProjectGroupNotifier_notifierType", "Wagon" );
- clickButtonWithValue( "Submit" );
- assertAddEditWagonPage();
- setFieldValue( "url", TEST_POM_URL );
- clickButtonWithValue( "Save" );
-
- assertNotifierPage( TEST_PROJ_GRP_NAME );
-
- clickImgWithAlt( "Delete" );
- clickSubmitWithLocator( "deleteProjectGroupNotifier_0" );
- assertNotifierPage( TEST_PROJ_GRP_NAME );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- }*/
-}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java b/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
deleted file mode 100644
index 507efcb..0000000
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
+++ /dev/null
@@ -1,453 +0,0 @@
-package org.apache.continuum.web.test;
-
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-
-
-import java.util.HashMap;
-
-/**
- *
- *
- *
- */
-public class SchedulesPageTest
- extends AbstractAuthenticatedAccessTestCase
-{
- // Add Edit Page fields
- final public static String FIELD_NAME = "name";
-
- final public static String FIELD_DESCRIPTION = "description";
-
- final public static String FIELD_SECOND = "second";
-
- final public static String FIELD_MINUTE = "minute";
-
- final public static String FIELD_HOUR = "hour";
-
- final public static String FIELD_DAYOFMONTH = "dayOfMonth";
-
- final public static String FIELD_MONTH = "month";
-
- final public static String FIELD_DAYOFWEEK = "dayOfWeek";
-
- final public static String FIELD_YEAR = "year";
-
- final public static String FIELD_MAXJOBEXECUTIONTIME = "maxJobExecutionTime";
-
- final public static String FIELD_DELAY = "delay";
-
-
- // field values
- final public static String SCHEDULES_PAGE_TITLE = "Continuum - Schedules";
-
- final public static String DEFAULT_SCHEDULE = "DEFAULT_SCHEDULE";
-
- final public static String DEFAULT_SCHEDULE_DESCRIPTION = "Run hourly";
-
- final public static String DEFAULT_CRONVALUE = "0 0 * * * ?";
-
- final public static String DEFAULT_DELAY = "0";
-
- final public static String DEFAULT_MAXJOBEXECUTIONTIME = "0";
-
- final public static String EDIT_SCHEDULE_PAGE_TITLE = "Continuum - Edit Schedule";
-
- final public static String SCHEDULE_NAME = "Test Schedule";
-
- final public static String SCHEDULE_NAME_EDIT = "Test Schedule Edit";
-
- final public static String SCHEDULE_DESCRIPTION = "Test Description";
-
- final public static String SECOND = "1";
-
- final public static String MINUTE = "2";
-
- final public static String HOUR = "3";
-
- final public static String DAYOFMONTH = "?";
-
- final public static String MONTH = "4";
-
- final public static String DAYOFWEEK = "5";
-
- final public static String YEAR = "2020";
-
- final public static String MAXJOBEXECUTIONTIME = "6";
-
- final public static String DELAY = "7";
-
- public void setUp()
- throws Exception
- {
- super.setUp();
-
- clickLinkWithText( "Schedules" );
-
- assertSchedulesPage();
- }
-
- public String getUsername()
- {
- return this.adminUsername;
- }
-
- public String getPassword()
- {
- return this.adminPassword;
- }
-
-/* public void testBasicScheduleAddAndDelete()
- throws Exception
- {
- // add schedule
- clickButtonWithValue( "Add" );
-
- assertEditSchedulePage();
-
- inputSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SECOND, MINUTE, HOUR, DAYOFMONTH, MONTH, DAYOFWEEK, YEAR,
- MAXJOBEXECUTIONTIME, DELAY, true );
-
- String cronSchedule = SECOND;
- cronSchedule += " " + MINUTE;
- cronSchedule += " " + HOUR;
- cronSchedule += " " + DAYOFMONTH;
- cronSchedule += " " + MONTH;
- cronSchedule += " " + DAYOFWEEK;
- cronSchedule += " " + YEAR;
-
- String[] columnValues = {SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule, MAXJOBEXECUTIONTIME};
-
- assertTrue( "Can not add schedule",
- getSelenium().isElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ) );
-
- // delete schedule after adding
- deleteSchedule( SCHEDULE_NAME );
-
- assertFalse( "Can not delete schedule",
- getSelenium().isElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ) );
- }
-
- public void testEditSchedule()
- throws Exception
- {
- clickButtonWithValue( "Add" );
-
- assertEditSchedulePage();
-
- inputSchedule( SCHEDULE_NAME_EDIT, SCHEDULE_DESCRIPTION, SECOND, MINUTE, HOUR, DAYOFMONTH, MONTH, DAYOFWEEK,
- YEAR, MAXJOBEXECUTIONTIME, DELAY, true );
-
- String cronSchedule = SECOND;
- cronSchedule += " " + MINUTE;
- cronSchedule += " " + HOUR;
- cronSchedule += " " + DAYOFMONTH;
- cronSchedule += " " + MONTH;
- cronSchedule += " " + DAYOFWEEK;
- cronSchedule += " " + YEAR;
-
- String[] columnValues = {SCHEDULE_NAME, SCHEDULE_DESCRIPTION, DELAY, cronSchedule, MAXJOBEXECUTIONTIME};
-
- // edit the schedule
- clickLinkWithXPath(
- XPathExpressionUtil.getImgColumnElement( XPathExpressionUtil.ANCHOR, 5, "edit.gif", columnValues ) );
-
- inputSchedule( SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION + "updated", "2", "3", "4", "?", "6", "7",
- "2021", "8", "9", false );
-
- cronSchedule = "2 3 4 ? 6 7 2021";
-
- String[] editedColumnValues =
- {SCHEDULE_NAME_EDIT + "modified", SCHEDULE_DESCRIPTION + "updated", "9", cronSchedule, "8"};
-
- assertTrue( "Can not edit schedule",
- getSelenium().isElementPresent( XPathExpressionUtil.getTableRow( editedColumnValues ) ) );
-
- // check if the active state has been saved
- clickLinkWithXPath(
- XPathExpressionUtil.getImgColumnElement( XPathExpressionUtil.ANCHOR, 5, "edit.gif", editedColumnValues ) );
-
- assertEquals( "Can disable the schedule", CHECKBOX_UNCHECK, getFieldValue( "active" ) );
-
- //house keeping
- clickLinkWithText( "Schedules" );
- deleteSchedule( SCHEDULE_NAME_EDIT + "modified" );
- }
-
- public void testScheduleAddEditPageInputValidation()
- {
- clickButtonWithValue( "Add" );
-
- assertEditSchedulePage();
-
- HashMap fields = new HashMap();
- fields.put( FIELD_MAXJOBEXECUTIONTIME, "" );
- boolean valid = false;
- boolean wait = false;
-
- // test saving without editing anything from the initial edit page except for Max Job Execution Time
- inputSchedule( fields, wait, valid );
-
- assertTrue( "Name field not validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']" ) );
- assertTrue( "Description field not validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']" ) );
- assertTrue( "Max Job Execution Time field not validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.maxJobExecutionTime.required']" ) );
-
- // go back to the schedules page
- clickLinkWithText( "Schedules" );
-
- // start new schedule add session
- clickButtonWithValue( "Add" );
-
- // test saving using spaces for name and description
- fields.put( FIELD_NAME, " " );
- fields.put( FIELD_DESCRIPTION, " " );
-
- inputSchedule( fields, wait, valid );
-
- //TODO: Fix text validation, we need real text and not a property in the screen
- assertTrue( "Name field not validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']" ) );
- assertTrue( "Description field not validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']" ) );
-
- // go back to the schedules page
- clickLinkWithText( "Schedules" );
-
- // start new schedule add session
- clickButtonWithValue( "Add" );
-
- // test saving using alpha characters for the maxjobexecution and delay
- // with valid name and description
- fields.put( FIELD_NAME, SCHEDULE_NAME );
- fields.put( FIELD_DESCRIPTION, SCHEDULE_DESCRIPTION );
- fields.put( FIELD_MAXJOBEXECUTIONTIME, "abcde" );
- fields.put( FIELD_DELAY, "abcde" );
-
- inputSchedule( fields, wait, valid );
-
- //TODO: Fix text validation, we need real text and not a property in the screen
- assertFalse( "Name field improperly validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']" ) );
- assertFalse( "Description field improperly validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']" ) );
- assertFalse( "Max Job Execution Time field improperly validated",
- getSelenium().isElementPresent( "//tr/td[span='schedule.maxJobExecutionTime.required']" ) );
- assertTrue( "MaxJobExecutionTime not validated", isTextPresent( "schedule.maxJobExecutionTime.invalid" ) );
- assertTrue( "Delay not validated", isTextPresent( "schedule.delay.invalid" ) );
-
- assertEditSchedulePage();
- }
-
-
- public void testScheduleAddEditPageDoubleErrorMessages()
- {
- clickButtonWithValue( "Add" );
-
- assertEditSchedulePage();
-
- HashMap fields = new HashMap();
- boolean valid = false;
- boolean wait = false;
-
- // test double error messages issue of webworks
- inputSchedule( fields, wait, valid );
- clickButtonWithValue( "Save", false );
-
- if ( "schedule.name.required".equals( getSelenium().getText( "//td/span" ) ) )
- {
- assertFalse( "Double Error Messages", "schedule.name.required".equals( getSelenium().getText( "//tr[2]/td/span" ) ) );
- }
- if ( "schedule.version.required".equals( getSelenium().getText( "//tr[4]/td/span" ) ) )
- {
- assertFalse( "Double Error Messages", "schedule.version.required".equals( getSelenium().getText( "//tr[5]/td/span" ) ) );
- }
-
- assertEditSchedulePage();
- }
-*/
- public void testCancelAddSchedule()
- {
- clickButtonWithValue( "Add" );
- clickButtonWithValue( "Cancel" );
- assertSchedulesPage();
- }
-
- public void testCancelEditSchedule()
- {
- clickLinkWithXPath( "//img[@alt='Edit']" );
- clickButtonWithValue( "Cancel" );
- assertSchedulesPage();
- }
-
- public void testCancelDeleteSchedule()
- {
- clickLinkWithXPath( "//img[@alt='Delete']" );
- clickButtonWithValue( "Cancel" );
- assertSchedulesPage();
- }
-
- public void assertSchedulesPage()
- {
- assertPage( SCHEDULES_PAGE_TITLE );
-
- assertDefaultSchedule();
- }
-
- public void assertDefaultSchedule()
- {
- String[] columnValues = {DEFAULT_SCHEDULE, DEFAULT_SCHEDULE_DESCRIPTION, DEFAULT_DELAY, DEFAULT_CRONVALUE,
- DEFAULT_MAXJOBEXECUTIONTIME};
-
- assertTrue( "Default schedule not found",
- getSelenium().isElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ) );
- }
-
- public void assertEditSchedulePage()
- {
- assertPage( EDIT_SCHEDULE_PAGE_TITLE );
-
- //TODO: assert error messages
-
- assertEditSchedulePageInputFields();
- }
-
- public void assertEditSchedulePageInputFields()
- {
- //TODO: assert content
-
- assertPage( "Continuum - Edit Schedule" );
- assertTextPresent( "Edit Schedule" );
- assertTextPresent( "Name*:" );
- assertElementPresent( "name" );
- assertTextPresent( "Description*:" );
- assertElementPresent( "description" );
- assertTextPresent( "Cron Expression:" );
- assertTextPresent( "Second:" );
- assertElementPresent( "saveSchedule_second" );
- assertTextPresent( "Minute:" );
- assertElementPresent( "saveSchedule_minute" );
- assertTextPresent( "Hour:" );
- assertElementPresent( "saveSchedule_hour" );
- assertTextPresent( "Day of Month:" );
- assertElementPresent( "saveSchedule_dayOfMonth" );
- assertTextPresent( "Month:" );
- assertElementPresent( "saveSchedule_month" );
- assertTextPresent( "Day of Week:" );
- assertElementPresent( "saveSchedule_dayOfWeek" );
- assertTextPresent( "Year [optional]:" );
- assertElementPresent( "saveSchedule_year" );
- assertTextPresent( "Maximum job execution time (seconds)*:" );
- assertElementPresent( "maxJobExecutionTime" );
- assertTextPresent( "Quiet Period (seconds):" );
- assertElementPresent( "delay" );
- assertTextPresent( "Add Build Queue:" );
- assertElementPresent( "availableBuildQueues" );
- assertElementPresent( "selectedBuildQueues" );
- assertElementPresent( "active" );
- }
-
- public void deleteSchedule( String scheduleName )
- {
- // after we save the schedule we should be brought back to the schedules page
- assertSchedulesPage();
-
- String[] columnValues = {scheduleName};
-
- clickLinkWithXPath(
- XPathExpressionUtil.getImgColumnElement( XPathExpressionUtil.ANCHOR, 5, "delete.gif", columnValues ) );
-
- // deletion confirmation page
- assertPage( "Schedule Removal" );
- //TODO: assert content
- //TODO: assert schedule name is in deletion confirmation
-
- clickButtonWithValue( "Delete" );
-
- // after we confirm the deletion we should be brought back to the schedules page
- assertSchedulesPage();
- }
-
-
- public void inputSchedule( String scheduleName, String scheduleDescription, String second, String minute,
- String hour, String dayOfMonth, String month, String dayOfWeek, String year,
- String maxJobExecutionTime, String delay, boolean active )
- {
- inputSchedule( scheduleName, scheduleDescription, second, minute, hour, dayOfMonth, month, dayOfWeek, year,
- maxJobExecutionTime, delay, active, true );
- }
-
-
- public void inputSchedule( String scheduleName, String schedule_description, String second, String minute,
- String hour, String dayOfMonth, String month, String dayOfWeek, String year,
- String maxJobExecutionTime, String delay, boolean active, boolean wait )
- {
- assertEditSchedulePage();
-
- HashMap inputFields = new HashMap();
-
- inputFields.put( "name", scheduleName );
- inputFields.put( "description", schedule_description );
- inputFields.put( "second", second );
- inputFields.put( "minute", minute );
- inputFields.put( "hour", hour );
- inputFields.put( "dayOfMonth", dayOfMonth );
- inputFields.put( "month", month );
- inputFields.put( "dayOfWeek", dayOfWeek );
- inputFields.put( "year", year );
- inputFields.put( "maxJobExecutionTime", maxJobExecutionTime );
- inputFields.put( "delay", delay );
-
- if ( !active )
- {
- uncheckField( "active" );
- }
-
- inputSchedule( inputFields, wait, true );
- }
-
- public void inputSchedule( HashMap fields )
- {
- inputSchedule( fields, true, true );
- }
-
- public void inputSchedule( HashMap fields, boolean wait, boolean valid )
- {
- //setFieldValues( fields );
-
- clickButtonWithValue( "Save", wait );
-
- if ( valid )
- {
- // after we save the schedule we should be brought back to the schedules page
- assertSchedulesPage();
- }
- else
- {
- assertEditSchedulePage();
- }
- }
-
- public void tearDown()
- throws Exception
- {
- //logout();
- super.tearDown();
- }
-}
diff --git a/continuum-webapp-test/src/test/resources/it.properties b/continuum-webapp-test/src/test/resources/it.properties
index 718b263..a16c89c 100644
--- a/continuum-webapp-test/src/test/resources/it.properties
+++ b/continuum-webapp-test/src/test/resources/it.properties
@@ -10,4 +10,4 @@
SELENIUM_HOST=localhost
SELENIUM_PORT=4444
-SELENIUM_BROWSER=*firefox
+
diff --git a/continuum-webapp-test/src/test/resources/testng.properties b/continuum-webapp-test/src/test/resources/testng.properties
index 2ce91ef..6e003a9 100644
--- a/continuum-webapp-test/src/test/resources/testng.properties
+++ b/continuum-webapp-test/src/test/resources/testng.properties
@@ -4,174 +4,306 @@
# General properties
#######################
-BASE_URL=http://localhost:9595/continuum/
MAX_WAIT_TIME_IN_MS=60000
+MAX_PROJECT_WAIT_TIME_IN_MS=600000
+
+WAIT_TRIES=80
+PAGE_LOAD_TIME_IN_MS=30000
ADMIN_USERNAME=admin
ADMIN_FULLNAME=admin
ADMIN_PASSWORD=admin123
ADMIN_MAIL=admin@mail.com
-SELENIUM_HOST=localhost
-SELENIUM_PORT=4444
-SELENIUM_BROWSER=*firefox
-
-DEFAULT_PROJ_GRP_NAME =Default Project Group
-DEFAULT_PROJ_GRP_ID =default
-DEFAULT_PROJ_GRP_DESCRIPTION =Contains all projects that do not have a group of their own
+DEFAULT_PROJ_GRP_NAME=Default Project Group
+DEFAULT_PROJ_GRP_ID=default
+DEFAULT_PROJ_GRP_DESCRIPTION=Contains all projects that do not have a group of their own
########################
# mavenTwoProject group
########################
# Properties for testAddMavenTwoProject
-M2_POM_URL =https://svn.apache.org/repos/asf/continuum/sandbox/simple-example/pom.xml
-M2_PROJ_GRP_NAME=Continuum Simple Example Project
-M2_PROJ_GRP_ID=org.apache.continuum.examples
-M2_PROJ_GRP_DESCRIPTION=
-M2_POM_USERNAME =
-M2_POM_PASSWORD =
+M2_POM_URL=http://localhost:9595/example-projects/continuum-build-queue-test-data/pom.xml
+M2_PROJ_GRP_NAME=ContinuumBuildQueueTestData
+M2_PROJ_GRP_ID=org.apache.continuum
+M2_PROJ_GRP_DESCRIPTION=Project for testing continuum build queue
+M2_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/continuum-build-queue-test-data
+M2_POM_USERNAME=
+M2_POM_PASSWORD=
+
+# Properties for testDeleteMavenTwoProject
+M2_DELETE_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
+M2_DELETE_PROJ_GRP_NAME=Continuum Simple Example Project
+M2_DELETE_PROJ_GRP_ID=org.apache.continuum.examples.simple
+M2_DELETE_PROJ_GRP_DESCRIPTION=Delete test project
+M2_DELETE_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/simple-example
+M2_DELETE_PROJ_TAGBASE=scm:svn:${svn.base.url}/tags
+M2_DELETE_PROJ_TAG=simple-example-1.0
+M2_DELETE_PROJ_RELEASE_VERSION=1.0
+M2_DELETE_PROJ_DEVELOPMENT_VERSION=1.1-SNAPSHOT
+M2_DELETE_PROJ_TAGBASE_PERFORM=http://localhost:9595/example-projects/tags
+
# SCM element is missing from pom
-NOT_SCM_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml
-MISS_CONECT_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml
-MISS_PARENT_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-parent-pom.xml
-MISS_SUBPRO_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-modules-pom.xml
+NOT_SCM_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-scm-element-pom.xml
+MISS_CONECT_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-connection-element-pom.xml
+MISS_PARENT_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-parent-pom.xml
+MISS_SUBPRO_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-modules-pom.xml
+
+# Properties for testAddMavenTwoProjectModuleNameWithSameLetter
+M2_SAME_LETTER_POM_URL=http://localhost:9595/example-projects/flat-example/flat-parent/pom.xml
+M2_SAME_LETTER_PROJ_GRP_NAME=Flat Example
+M2_SAME_LETTER_PROJ_GRP_ID=com.example.flat
+M2_SAME_LETTER_PROJ_GRP_DESCRIPTION=
+M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/flat-example/flat-parent
+
+# Properties for testBuildMaven2ProjectWithTag
+M2_PROJ_WITH_TAG_POM_URL=http://localhost:9595/example-projects/continuum-2437-example/pom.xml
+M2_PROJ_WITH_TAG_PROJ_GRP_NAME=Continuum 2437 Example Project
+M2_PROJ_WITH_TAG_PROJ_GRP_ID=org.apache.continuum.examples
+
+# Properties for testReleasePrepareProjectWithNoBuildagentInBuildEnvironment
+M2_RELEASE_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
+M2_RELEASE_PROJECT_NAME=Continuum Simple Example Project
+M2_RELEASE_GRP_NAME=Simple Example Project Release
+M2_RELEASE_GRP_ID=org.apache.continuum.examples.simple.release
+M2_RELEASE_GRP_DESCRIPTION=Release test project
+M2_RELEASE_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/simple-example
+M2_RELEASE_TAG=simple-example-1.0-test
+M2_RELEASE_RELEASE_VERSION=1.0-test
+M2_RELEASE_DEVELOPMENT_VERSION=1.0-SNAPSHOT
+M2_RELEASE_TAGBASE_URL=http://localhost:9595/example-projects/tags
+M2_RELEASE_BUILD_ENV=RELEASE_BUILD_ENV
+M2_RELEASE_AGENT_GROUP=RELEASE_BUILDAGENT_GROUP
+M2_RELEASE_NO_AGENT_MESSAGE=Unable to prepare release because build agent
########################
# mavenOneProject group
########################
# Properties for testAddMavenOneProject
-M1_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/valid-project.xml
+M1_POM_URL=http://localhost:9595/example-projects/maven-one-projects/valid-project.xml
M1_PROJ_GRP_NAME=Maven One Project
M1_PROJ_GRP_ID=maven-one-project
M1_PROJ_GRP_DESCRIPTION=This is a sample Maven One Project
-M1_POM_USERNAME =
-M1_POM_PASSWORD =
+M1_POM_USERNAME=
+M1_POM_PASSWORD=
-M1_MISS_REPO_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml
-M1_EXTENDED_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml
-M1_UNPARSEABLE_POM_URL =http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/unparseable-content-project.xml
+# Properties for testDeleteMavenOneProject
+M1_DELETE_POM_URL=http://localhost:9595/example-projects/maven-one-projects/valid-project.xml
+M1_DELETE_PROJ_GRP_NAME=Maven One Project
+M1_DELETE_PROJ_GRP_ID=maven-one-project
+M1_DELETE_PROJ_GRP_DESCRIPTION=This is a sample Maven One Project.
+
+M1_MISS_REPO_POM_URL=http://localhost:9595/example-projects/maven-one-projects/missing-repository-element-project.xml
+M1_EXTENDED_POM_URL=http://localhost:9595/example-projects/maven-one-projects/extend-element-project.xml
+M1_UNPARSEABLE_POM_URL=http://localhost:9595/example-projects/maven-one-projects/unparseable-content-project.xml
########################
# antProject group
########################
-ANT_NAME =Ant Project
-ANT_DESCRIPTION =This is a sample Ant Project used for testing
-ANT_VERSION =1.0.0-SNAPSHOT
-ANT_TAG =
-ANT_SCM_URL =http://svn.apache.org/repos/asf/ant/sandbox/parallelexecutor/
-ANT_SCM_USERNAME =
-ANT_SCM_PASSWORD =
+ANT_NAME=Ant Project
+ANT_DESCRIPTION=This is a sample Ant Project used for testing
+ANT_VERSION=1.0.0-SNAPSHOT
+ANT_TAG=
+ANT_SCM_URL=http://localhost:9595/example-projects/ant/
+ANT_SCM_USERNAME=
+ANT_SCM_PASSWORD=
########################
# shellProject group
########################
-SHELL_NAME =Shell Project
-SHELL_DESCRIPTION =This is a sample Shell Project used for testing
-SHELL_VERSION =1.0.0-SNAPSHOT
-SHELL_TAG =
-SHELL_SCM_URL =http://svn.apache.org/repos/asf/continuum/sandbox/examples/shell/
-SHELL_SCM_USERNAME =
-SHELL_SCM_PASSWORD =
+SHELL_NAME=Shell Project
+SHELL_DESCRIPTION=This is a sample Shell Project used for testing
+SHELL_VERSION=1.0.0-SNAPSHOT
+SHELL_TAG=
+SHELL_SCM_URL=http://localhost:9595/example-projects/shell/
+SHELL_SCM_USERNAME=
+SHELL_SCM_PASSWORD=
########################
# projectGroup group
########################
-TEST_PROJ_GRP_NAME =Test Project Group Name
-TEST_PROJ_GRP_ID =Test Project Group Id
-TEST_PROJ_GRP_DESCRIPTION =Test Project Group Description
+TEST_PROJ_GRP_NAME=Test Project Group Name
+TEST_PROJ_GRP_ID=Test Project Group Id
+TEST_PROJ_GRP_DESCRIPTION=Test Project Group Description
## Second project group without projects
-TEST2_PROJ_GRP_NAME =Test Project Group 2 Name
-TEST2_PROJ_GRP_ID =Test Project Group 2 Id
-TEST2_PROJ_GRP_DESCRIPTION =Test Project Group 2 Description
+TEST2_PROJ_GRP_NAME=Test Project Group 2 Name
+TEST2_PROJ_GRP_ID=Test Project Group 2 Id
+TEST2_PROJ_GRP_DESCRIPTION=Test Project Group 2 Description
+
+# Test properties for testDeleteProjectGroup
+TEST_DELETE_GRP_NAME=Add then Delete Project Group
+TEST_DELETE_GRP_ID=test.delete.project.group
+TEST_DELETE_GRP_DESCRIPTION=Test Delete Project Group Description
+
+# Test properties for testProjectGroupMembers
+TEST_PROJ_GRP_NAME_ONE=Group
+TEST_PROJ_GRP_ID_ONE=Group Id
+TEST_PROJ_GRP_DESCRIPTION_ONE=First project group for members test
+TEST_PROJ_GRP_NAME_TWO=Group My
+TEST_PROJ_GRP_ID_TWO=Group Id My
+TEST_PROJ_GRP_DESCRIPTION_TWO=Second project group for members test
+TEST_PROJ_GRP_NAME_THREE = My Group
+TEST_PROJ_GRP_ID_THREE=My Group Id
+TEST_PROJ_GRP_DESCRIPTION_THREE=Third project group for members test
########################
# notifier group
########################
-WAGON_NOTIFIER_URL =http://svn.apache.org/repos/asf/maven/pom/trunk/maven/pom.xml
-WAGON_SERVER_ID =wagoId
-MAIL_NOTIFIER_ADDRESS =test@test.com
-IRC_NOTIFIER_HOST =test.com
-IRC_NOTIFIER_CHANNEL =test_channel
-JABBER_NOTIFIER_HOST =test
-JABBER_NOTIFIER_LOGIN =test_login
-JABBER_NOTIFIER_PASSWORD =hello
-JABBER_NOTIFIER_ADDRESS =test@address.com
-MSN_NOTIFIER_ADDRESS =test@address.com
-MSN_NOTIFIER_LOGIN =test
-MSN_NOTIFIER_PASSWORD =hello
+WAGON_NOTIFIER_URL=http://svn.apache.org/repos/asf/maven/pom/trunk/maven/pom.xml
+WAGON_SERVER_ID=wagoId
+MAIL_NOTIFIER_ADDRESS=test@test.com
+IRC_NOTIFIER_HOST=test.com
+IRC_NOTIFIER_CHANNEL=test_channel
+JABBER_NOTIFIER_HOST=test
+JABBER_NOTIFIER_LOGIN=test_login
+JABBER_NOTIFIER_PASSWORD=hello
+JABBER_NOTIFIER_ADDRESS=test@address.com
+MSN_NOTIFIER_ADDRESS=test@address.com
+MSN_NOTIFIER_LOGIN=test
+MSN_NOTIFIER_PASSWORD=hello
########################
# buildDefinition group
########################
-BUILD_POM_NAME =pom.xml
-BUILD_GOALS =test
-BUILD_ARGUMENTS =--batch-mode --non-recursive
-BUILD_DESCRIPTION =Maven 2 Build Definition Description
+BUILD_POM_NAME=pom.xml
+BUILD_GOALS=test
+BUILD_ARGUMENTS=--batch-mode --non-recursive
+BUILD_DESCRIPTION=Maven 2 Build Definition Description
########################
# queue group
########################
-BUILD_QUEUE_NAME =name_build_queue
+BUILD_QUEUE_NAME=name_build_queue
########################
# purge group
########################
-PURGE_REPOSITORY_DESCRIPTION =repository_description
-PURGE_REPOSITORY_DAYS =100
-PURGE_REPOSITORY_RETETION =3
-PURGE_DIRECTORY_DESCRIPTION =directory_description
-PURGE_DIRECTORY_DAYS =90
-PURGE_DIRECTORY_RETETION =4
+PURGE_REPOSITORY_DESCRIPTION=repository_description
+PURGE_REPOSITORY_DAYS=100
+PURGE_REPOSITORY_RETETION=3
+PURGE_DIRECTORY_DESCRIPTION=directory_description
+PURGE_DIRECTORY_DAYS=90
+PURGE_DIRECTORY_RETETION=4
########################
# local repository group
########################
-LOCAL_REPOSITORY_NAME =repository_name
-LOCAL_REPOSITORY_LOCATION =/usr/m2/repository
+LOCAL_REPOSITORY_NAME=repository_name
+LOCAL_REPOSITORY_LOCATION=/usr/m2/repository
########################
# schedules group
########################
-SCHEDULE_NAME =schedule_name
-SCHEDULE_DESCRIPTION =schedule_description
-SCHEDULE_EXPR_SECOND =10
-SCHEDULE_EXPR_MINUTE =10
-SCHEDULE_EXPR_HOUR =20
-SCHEDULE_EXPR_DAY_MONTH =*
-SCHEDULE_EXPR_MONTH =*
-SCHEDULE_EXPR_DAY_WEEK =?
-SCHEDULE_EXPR_YEAR =2009
-SCHEDULE_MAX_TIME =60000
-SCHEDULE_PERIOD =36000
+SCHEDULE_NAME=schedule_name
+SCHEDULE_DESCRIPTION=schedule_description
+SCHEDULE_EXPR_SECOND=10
+SCHEDULE_EXPR_MINUTE=10
+SCHEDULE_EXPR_HOUR=20
+SCHEDULE_EXPR_DAY_MONTH=*
+SCHEDULE_EXPR_MONTH=*
+SCHEDULE_EXPR_DAY_WEEK=?
+SCHEDULE_EXPR_YEAR=2009
+SCHEDULE_MAX_TIME=60000
+SCHEDULE_PERIOD=36000
########################
# installations group
########################
# Correct location for JDK
-INSTALL_TOOL_JDK_NAME =JDK6
-INSTALL_TOOL_JDK_PATH =${java.home}
+INSTALL_TOOL_JDK_NAME=JDK6
+INSTALL_TOOL_JDK_PATH=${java.home}
# Correct location for maven 2
-INTALLA_TOOL_MAVEN_NAME =M9_HOME
-INTALLA_TOOL_MAVEN_PATH =${maven.home}
+INSTALL_TOOL_MAVEN_NAME=M9_HOME
+INSTALL_TOOL_MAVEN_PATH=${maven.home}
# Not neccesary correct location
-INSTALL_VAR_NAME =JDK5
-INSTALL_VAR_VARIABLE_NAME =/usr/lib/jvm/java-5-sun-1.5.0.12
-INSTALL_VAR_PATH =JAVA5_HOME
+INSTALL_VAR_NAME=JDK5
+INSTALL_VAR_VARIABLE_NAME=/usr/lib/jvm/java-5-sun-1.5.0.12
+INSTALL_VAR_PATH=JAVA5_HOME
########################
# buildEnvironment group
########################
-BUIL_ENV_NAME =APPLICATION_JDK4
+BUILD_ENV_NAME=APPLICATION_JDK4
########################
# buildTemplate group
########################
-TEMPLATE_NAME =PROJECT_MAVEN_TEMPLATE
-TEMPLATE_BUILD_POM_NAME =pom.xml
-TEMPLATE_BUILD_GOALS =test
-TEMPLATE_BUILD_ARGUMENTS =--batch-mode --non-recursive
-TEMPLATE_BUILD_DESCRIPTION =Template Maven Test
\ No newline at end of file
+TEMPLATE_NAME=PROJECT_MAVEN_TEMPLATE
+TEMPLATE_BUILD_POM_NAME=pom.xml
+TEMPLATE_BUILD_GOALS=test
+TEMPLATE_BUILD_ARGUMENTS=--batch-mode --non-recursive
+TEMPLATE_BUILD_DESCRIPTION=Template Maven Test
+
+########################
+# userRoles group
+########################
+# General
+USERROLE_EMAIL=user@localhost.localdomain
+USERROLE_PASSWORD=pass123
+NEW_USERROLE_PASSWORD=pass12345
+# Guest Role
+GUEST_USERNAME=guest1
+GUEST_FULLNAME=Guest
+# Registered User Role
+REGISTERED_USERNAME=reg_user
+REGISTERED_FULLNAME=Registered User
+# System Administrator
+SYSAD_USERNAME=sys_admin
+SYSAD_FULLNAME=System Administrator
+# User Administrator
+USERADMIN_USERNAME=user_admin
+USERADMIN_FULLNAME=User Administrator
+# Continuum Group Project Administrator
+GROUPPROJECTADMIN_USERNAME=groupprojectadmin
+GROUPPROJECTADMIN_FULLNAME=Continuum Group Project Administrator
+# Continuum Group Project Developer
+GROUPPROJECTDEVELOPER_USERNAME=groupprojectdev
+GROUPPROJECTDEVELOPER_FULLNAME=Continuum Group Project Developer
+# Continuum Group Project User
+GROUPPROJECTUSER_USERNAME=groupprojectuser
+GROUPPROJECTUSER_FULLNAME=Continuum Group Project User
+# Continuum Manage Build Environment
+MANAGEBUILDENVIRONMENT_USERNAME=managebuildenv
+MANAGEBUILDENVIRONMENT_FULLNAME=Continuum Manage Build Environments
+# Continuum Manage Build Templates
+MANAGEBUILDTEMPLATES_USERNAME=managebuildtemp
+MANAGEBUILDTEMPLATES_FULLNAME=Continuum Manage Build Templates
+# Continuum Manage Installations
+MANAGEINSTALLATIONS_USERNAME=manageinstallations
+MANAGEINSTALLATIONS_FULLNAME=Continuum Manage Installations
+# Continuum Manage Local Repositories
+MANAGELOCALREPOS_USERNAME=managelocalrepo
+MANAGELOCALREPOS_FULLNAME=Continuum Manage Local Repositories
+# Continuum Manage Purging
+MANAGEPURGING_USERNAME=managepurging
+MANAGEPURGING_FULLNAME=Continuum Manage Purging
+# Continuum Manage Queues
+MANAGEQUEUES_USERNAME=managequeues
+MANAGEQUEUES_FULLNAME=Continuum Manage Queues
+# Continuum Manage Scheduling
+MANAGESCHEDULING_USERNAME=manageschedule
+MANAGESCHEDULING_FULLNAME=Continuum Manage Scheduling
+# Project Administrator
+PROJECTADMINISTRATOR_DEFAULTPROJECTGROUP_USERNAME=projectadmin
+PROJECTADMINISTRATOR_DEFAULTPROJECTGROUP_FULLNAME=Project Administrator - Default Project Group
+# Project Developer
+PROJECTDEVELOPER_DEFAULTPROJECTGROUP_USERNAME=projectdev
+PROJECTDEVELOPER_DEFAULTPROJECTGROUP_FULLNAME=Project Developer - Default Project Group
+# Project User
+PROJECTUSER_DEFAULTPROJECTGROUP_USERNAME=projectuser
+PROJECTUSER_DEFAULTPROJECTGROUP_FULLNAME=Project User - Default Project Group
+
+########################
+# buildAgents group
+########################
+BUILD_AGENT_NAME2=http://localhost:9595/continuum-buildagent/xmlrpc
+BUILD_AGENT_DESCRIPTION2=Agent_description2
+BUILD_AGENT_NAME=First_Agent
+BUILD_AGENT_DESCRIPTION=Agent_description
+BUILD_AGENT_NAME3=Third_Agent
+BUILD_AGENT_DESCRIPTION3=Agent_description3
+BUILD_AGENT_GROUPNAME=agent_groupname
diff --git a/continuum-webapp-test/src/test/testng/config/testng-multienvironment.xml b/continuum-webapp-test/src/test/testng/config/testng-multienvironment.xml
new file mode 100644
index 0000000..e127633
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/config/testng-multienvironment.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<!--
+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.
+-->
+
+<suite name="ContinuumTestMultiEnvironment" verbose="1" parallel="tests" thread-count="2">
+ <listeners>
+ <listener class-name="org.apache.continuum.web.test.listener.CaptureScreenShotsListener"/>
+ </listeners>
+ <test name="safari4Windows">
+ <parameter name="browser" value="Safari 4 on Windows"/>
+ <groups>
+ <run>
+ <include name="setup" /> <!-- required to setup Selenium -->
+ <include name="login" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test" />
+ </packages>
+ </test>
+ <test name="firefox3Linux">
+ <parameter name="browser" value="Firefox 3 on Linux"/>
+ <groups>
+ <run>
+ <include name="setup" /> <!-- required to setup Selenium -->
+ <include name="login" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test" />
+ </packages>
+ </test>
+</suite>
diff --git a/continuum-webapp-test/src/test/testng/config/testng.xml b/continuum-webapp-test/src/test/testng/config/testng.xml
index 0a64af1..25af7b2 100644
--- a/continuum-webapp-test/src/test/testng/config/testng.xml
+++ b/continuum-webapp-test/src/test/testng/config/testng.xml
@@ -20,44 +20,53 @@
-->
<suite name="ContinuumTest" verbose="1">
- <test name="BasicTest" enabled="true">
- <!--
- Groups are divided into the unit tests. The order will be described
- in the annotations of each type of test.
- -->
- <groups>
- <run>
- <include name="about" />
- </run>
- </groups>
- <packages>
- <package name="org.apache.continuum.web.test" />
- </packages>
- </test>
- <test name="AdminTest" enabled="true">
- <groups>
- <run>
- <include name="login" />
- <include name="mavenTwoProject"/>
- <include name="projectGroup" />
- <include name="mavenOneProject" />
- <include name="antProject" />
- <include name="shellProject" />
- <include name="buildDefinition" />
- <include name="notifier" />
- <include name="schedule" />
- <include name="myAccount" />
- <include name="queue" />
- <include name="purge" />
- <include name="repository" />
- <include name="configuration" />
- <include name="installation" />
- <include name="buildEnvironment" />
- <include name="buildDefinitionTemplate" />
- </run>
- </groups>
- <packages>
- <package name="org.apache.continuum.web.test" />
- </packages>
- </test>
-</suite>
\ No newline at end of file
+ <listeners>
+ <listener class-name="org.apache.continuum.web.test.listener.CaptureScreenShotsListener"/>
+ </listeners>
+ <test name="BasicTest" enabled="true">
+ <!--
+ Groups are divided into the unit tests. The order will be described
+ in the annotations of each type of test.
+ -->
+ <groups>
+ <run>
+ <include name="setup"/>
+ <!-- required to setup Selenium -->
+ <include name="about"/>
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test"/>
+ </packages>
+ </test>
+ <test name="AdminTest" enabled="true">
+ <groups>
+ <run>
+ <include name="setup"/> <!-- required to setup Selenium -->
+ <include name="login"/>
+ <include name="projectGroup"/>
+ <include name="mavenTwoProject"/>
+ <include name="mavenOneProject" />
+ <include name="antProject"/>
+ <include name="shellProject"/>
+ <include name="agent"/>
+ <include name="release"/>
+ <include name="buildDefinition" />
+ <include name="notifier"/>
+ <include name="myAccount" />
+ <include name="schedule"/>
+ <include name="queue"/>
+ <include name="purge" />
+ <include name="repository" />
+ <include name="configuration" />
+ <include name="installation"/>
+ <include name="buildEnvironment" />
+ <include name="buildDefinitionTemplate" />
+ <include name="userroles"/>
+ </run>
+ </groups>
+ <packages>
+ <package name="org.apache.continuum.web.test"/>
+ </packages>
+ </test>
+</suite>
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AboutTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AboutTest.java
index 531eec5..bb2261e 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AboutTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AboutTest.java
@@ -20,15 +20,11 @@
*/
import org.apache.continuum.web.test.parent.AbstractContinuumTest;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
/**
* Based on AboutTest of Wendy Smoak test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -36,48 +32,9 @@
public class AboutTest
extends AbstractContinuumTest
{
- @BeforeSuite
- public void initializeContinuum()
- throws Exception
- {
- super.open();
- getSelenium().open( baseUrl );
- String title = getSelenium().getTitle();
- if ( title.equals( "Create Admin User" ) )
- {
- assertCreateAdmin();
- String fullname = p.getProperty( "ADMIN_FULLNAME" );
- String username = p.getProperty( "ADMIN_USERNAME" );
- String mail = p.getProperty( "ADMIN_MAIL" );
- String password = p.getProperty( "ADMIN_PASSWORD" );
- submitAdminData( fullname, mail, password );
- assertAutenticatedPage( username );
- assertEditConfigurationPage();
- submit();
- clickLinkWithText( "Logout" );
- }
- super.close();
- }
-
- @BeforeTest( groups = { "about" } )
- public void open()
- throws Exception
- {
- super.open();
- }
-
public void displayAboutPage()
{
- getSelenium().open( baseUrl + "/about.action" );
- getSelenium().waitForPageToLoad( maxWaitTimeInMs );
- Assert.assertEquals( "Continuum - About", getSelenium().getTitle() );
+ goToAboutPage();
}
- @Override
- @AfterTest( groups = { "about" } )
- public void close()
- throws Exception
- {
- super.close();
- }
}
\ No newline at end of file
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
index 4c9ced7..5eaa4f1 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
@@ -24,7 +24,7 @@
/**
* Based on AddAntProjectTestCase of Emmanuel Venisse.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -36,19 +36,19 @@
public void testAddAntProject()
throws Exception
{
- String ANT_NAME = p.getProperty( "ANT_NAME" );
- String ANT_DESCRIPTION = p.getProperty( "ANT_DESCRIPTION" );
- String ANT_VERSION = p.getProperty( "ANT_VERSION" );
- String ANT_TAG = p.getProperty( "ANT_TAG" );
- String ANT_SCM_URL = p.getProperty( "ANT_SCM_URL" );
- String ANT_SCM_USERNAME = p.getProperty( "ANT_SCM_USERNAME" );
- String ANT_SCM_PASSWORD = p.getProperty( "ANT_SCM_PASSWORD" );
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String ANT_NAME = getProperty( "ANT_NAME" );
+ String ANT_DESCRIPTION = getProperty( "ANT_DESCRIPTION" );
+ String ANT_VERSION = getProperty( "ANT_VERSION" );
+ String ANT_TAG = getProperty( "ANT_TAG" );
+ String ANT_SCM_URL = getProperty( "ANT_SCM_URL" );
+ String ANT_SCM_USERNAME = getProperty( "ANT_SCM_USERNAME" );
+ String ANT_SCM_PASSWORD = getProperty( "ANT_SCM_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToAddAntProjectPage();
addProject( ANT_NAME, ANT_DESCRIPTION, ANT_VERSION, ANT_SCM_URL, ANT_SCM_USERNAME, ANT_SCM_PASSWORD, ANT_TAG,
- false, TEST_PROJ_GRP_NAME, null, true );
+ false, TEST_PROJ_GRP_NAME, null, true, "ant" );
assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
}
@@ -63,19 +63,19 @@
}
@Test( dependsOnMethods = { "testAddAntProject" } )
- public void testAddDupliedAntProject()
+ public void testAddDuplicateAntProject()
throws Exception
{
- String ANT_NAME = p.getProperty( "ANT_NAME" );
- String ANT_DESCRIPTION = p.getProperty( "ANT_DESCRIPTION" );
- String ANT_VERSION = p.getProperty( "ANT_VERSION" );
- String ANT_TAG = p.getProperty( "ANT_TAG" );
- String ANT_SCM_URL = p.getProperty( "ANT_SCM_URL" );
- String ANT_SCM_USERNAME = p.getProperty( "ANT_SCM_USERNAME" );
- String ANT_SCM_PASSWORD = p.getProperty( "ANT_SCM_PASSWORD" );
+ String ANT_NAME = getProperty( "ANT_NAME" );
+ String ANT_DESCRIPTION = getProperty( "ANT_DESCRIPTION" );
+ String ANT_VERSION = getProperty( "ANT_VERSION" );
+ String ANT_TAG = getProperty( "ANT_TAG" );
+ String ANT_SCM_URL = getProperty( "ANT_SCM_URL" );
+ String ANT_SCM_USERNAME = getProperty( "ANT_SCM_USERNAME" );
+ String ANT_SCM_PASSWORD = getProperty( "ANT_SCM_PASSWORD" );
goToAddAntProjectPage();
addProject( ANT_NAME, ANT_DESCRIPTION, ANT_VERSION, ANT_SCM_URL, ANT_SCM_USERNAME, ANT_SCM_PASSWORD, ANT_TAG,
- false, null, null, false );
+ false, null, null, false, "ant" );
assertTextPresent( "Project name already exist" );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
new file mode 100644
index 0000000..bf8e35f
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
@@ -0,0 +1,290 @@
+package org.apache.continuum.web.test;
+
+/*
+ * 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.
+ */
+
+//import org.apache.continuum.web.test.parent.AbstractBuildQueueTest;
+import org.testng.annotations.Test;
+import org.apache.continuum.web.test.parent.AbstractBuildAgentsTest;
+
+@Test( groups = { "agent" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
+public class BuildAgentsTest
+ extends AbstractBuildAgentsTest
+{
+ public void testAddBuildAgent()
+ {
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_DESCRIPTION2 = getProperty( "BUILD_AGENT_DESCRIPTION2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+ String BUILD_AGENT_DESCRIPTION3 = getProperty( "BUILD_AGENT_DESCRIPTION3" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgent();
+ addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, true, false );
+ goToAddBuildAgent();
+ addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true, true, true );
+ goToAddBuildAgent();
+ addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true, false, false );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testEditBuildAgent" } )
+ public void testAddAnExistingBuildAgent()
+ {
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgent();
+ addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false, false ) ;
+ assertTextPresent( "Build agent already exists" );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildAgent" } )
+ public void testEditBuildAgent()
+ {
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+ String new_agentDescription = "new_agentDescription";
+
+ try
+ {
+ enableDistributedBuilds();
+ goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ addEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription );
+ goToEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription);
+ addEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddAnExistingBuildAgent" } )
+ public void testDeleteBuildAgent()
+ {
+ try
+ {
+ enableDistributedBuilds();
+ goToBuildAgentPage();
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ removeBuildAgent( BUILD_AGENT_NAME );
+ assertTextNotPresent( BUILD_AGENT_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testDeleteBuildAgent" } )
+ public void testAddEmptyBuildAgent()
+ {
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgent();
+ addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false, false ) ;
+ assertTextPresent( "Build agent url is required." );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testDeleteBuildAgent" }, enabled=false )
+ public void testBuildSuccessWithDistributedBuildsAfterDisableEnableOfBuildAgent()
+ throws Exception
+ {
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION2" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+ String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
+
+ try
+ {
+ enableDistributedBuilds();
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ goToProjectGroupsSummaryPage();
+ assertLinkPresent( M2_PROJ_GRP_NAME );
+
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+
+ // disable then enable build agent
+ goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ enableDisableBuildAgent( BUILD_AGENT_NAME, false );
+ goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ enableDisableBuildAgent( BUILD_AGENT_NAME, true );
+
+ buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+//TESTS FOR BUILD AGENT GROUPS
+
+ @Test( dependsOnMethods = { "testAddBuildAgent", "testDeleteBuildAgent" } )
+ public void testAddBuildAgentGroup()
+ throws Exception
+ {
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2, BUILD_AGENT_NAME3 }, new String[] {}, true );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
+ public void testEditBuildAgentGroup()
+ throws Exception
+ {
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ String newName = "new_agentgroupname";
+ try
+ {
+ enableDistributedBuilds();
+ goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2, BUILD_AGENT_NAME3 } );
+ addEditBuildAgentGroup( newName, new String[] {},
+ new String[] { BUILD_AGENT_NAME3 }, true );
+ goToEditBuildAgentGroup( newName, new String[] { BUILD_AGENT_NAME2 } );
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME3 },
+ new String[] {}, true );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testEditBuildAgentGroup" } )
+ public void testAddAnExistingBuildAgentGroup()
+ throws Exception
+ {
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2, BUILD_AGENT_NAME3 }, new String[] {}, false );
+ assertTextPresent( "Build agent group already exists." );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddAnExistingBuildAgentGroup" } )
+ public void testAddEmptyBuildAgentGroupName()
+ throws Exception
+ {
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( "", new String[] {}, new String[] {}, false );
+ assertTextPresent( "Build agent group name required." );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddEmptyBuildAgentGroupName" } )
+ public void testDeleteBuildAgentGroup()
+ {
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ try
+ {
+ enableDistributedBuilds();
+ removeBuildAgentGroup( BUILD_AGENT_GROUPNAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testDeleteBuildAgentGroup" } )
+ public void testAddBuildAgentGroupWithEmptyBuildAgent()
+ throws Exception
+ {
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ try
+ {
+ enableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] {}, new String[] {}, true );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
index 1447052..7745840 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTemplateTest.java
@@ -33,7 +33,7 @@
public void testAddTemplate()
throws Exception
{
- String TEMPLATE_NAME = p.getProperty( "TEMPLATE_NAME" );
+ String TEMPLATE_NAME = getProperty( "TEMPLATE_NAME" );
goToAddTemplate();
addEditTemplate( TEMPLATE_NAME, new String[] { "Default Maven 2 Build Definition",
"Default Maven 1 Build Definition" }, new String[] {}, true );
@@ -51,7 +51,7 @@
public void testEditTemplate()
throws Exception
{
- String TEMPLATE_NAME = p.getProperty( "TEMPLATE_NAME" );
+ String TEMPLATE_NAME = getProperty( "TEMPLATE_NAME" );
String newName = "new_name";
goToEditTemplate( TEMPLATE_NAME, new String[] { "Default Maven 2 Build Definition",
"Default Maven 1 Build Definition" } );
@@ -66,17 +66,17 @@
@Test( dependsOnMethods = { "testEditTemplate" } )
public void testDeleteTemplate()
{
- String TEMPLATE_NAME = p.getProperty( "TEMPLATE_NAME" );
+ String TEMPLATE_NAME = getProperty( "TEMPLATE_NAME" );
removeTemplate( TEMPLATE_NAME );
}
public void testAddBuildDefinitionTemplate()
throws Exception
{
- String TEMPLATE_BUILD_POM_NAME = p.getProperty( "TEMPLATE_BUILD_POM_NAME" );
- String TEMPLATE_BUILD_GOALS = p.getProperty( "TEMPLATE_BUILD_GOALS" );
- String TEMPLATE_BUILD_ARGUMENTS = p.getProperty( "TEMPLATE_BUILD_ARGUMENTS" );
- String TEMPLATE_BUILD_DESCRIPTION = p.getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
+ String TEMPLATE_BUILD_POM_NAME = getProperty( "TEMPLATE_BUILD_POM_NAME" );
+ String TEMPLATE_BUILD_GOALS = getProperty( "TEMPLATE_BUILD_GOALS" );
+ String TEMPLATE_BUILD_ARGUMENTS = getProperty( "TEMPLATE_BUILD_ARGUMENTS" );
+ String TEMPLATE_BUILD_DESCRIPTION = getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
goToAddBuildDefinitionTemplate();
addEditBuildDefinitionTemplate( TEMPLATE_BUILD_POM_NAME, TEMPLATE_BUILD_GOALS, TEMPLATE_BUILD_ARGUMENTS,
TEMPLATE_BUILD_DESCRIPTION, true, true, true, true );
@@ -95,10 +95,10 @@
public void testEditBuildDefinitionTemplate()
throws Exception
{
- String TEMPLATE_BUILD_POM_NAME = p.getProperty( "TEMPLATE_BUILD_POM_NAME" );
- String TEMPLATE_BUILD_GOALS = p.getProperty( "TEMPLATE_BUILD_GOALS" );
- String TEMPLATE_BUILD_ARGUMENTS = p.getProperty( "TEMPLATE_BUILD_ARGUMENTS" );
- String TEMPLATE_BUILD_DESCRIPTION = p.getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
+ String TEMPLATE_BUILD_POM_NAME = getProperty( "TEMPLATE_BUILD_POM_NAME" );
+ String TEMPLATE_BUILD_GOALS = getProperty( "TEMPLATE_BUILD_GOALS" );
+ String TEMPLATE_BUILD_ARGUMENTS = getProperty( "TEMPLATE_BUILD_ARGUMENTS" );
+ String TEMPLATE_BUILD_DESCRIPTION = getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
goToEditBuildDefinitionTemplate( TEMPLATE_BUILD_DESCRIPTION );
addEditBuildDefinitionTemplate( TEMPLATE_BUILD_POM_NAME, TEMPLATE_BUILD_GOALS, TEMPLATE_BUILD_ARGUMENTS,
TEMPLATE_BUILD_DESCRIPTION, false, false, false, true );
@@ -107,7 +107,7 @@
@Test( dependsOnMethods = { "testEditBuildDefinitionTemplate" } )
public void testDeleteBuildDefinitionTemplate()
{
- String TEMPLATE_BUILD_DESCRIPTION = p.getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
+ String TEMPLATE_BUILD_DESCRIPTION = getProperty( "TEMPLATE_BUILD_DESCRIPTION" );
removeBuildDefinitionTemplate( TEMPLATE_BUILD_DESCRIPTION );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
index d08bd0c..8eae779 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
@@ -33,9 +33,9 @@
public void testDefaultGroupBuildDefinition()
throws Exception
{
- String DEFAULT_PROJ_GRP_NAME = p.getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String DEFAULT_PROJ_GRP_ID = p.getProperty( "DEFAULT_PROJ_GRP_ID" );
- String DEFAULT_PROJ_GRP_DESCRIPTION = p.getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" );
+ String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+ String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_ID" );
+ String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" );
goToGroupBuildDefinitionPage( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION );
String tableElement = "ec_table";
@@ -70,9 +70,9 @@
public void testAddInvalidGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
clickButtonWithValue( "Add" );
setFieldValue( "buildFile", "" );
@@ -84,25 +84,25 @@
public void testBuildFromGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
clickImgWithAlt( "Build" );
- assertProjectGroupsSummaryPage();
+ assertProjectGroupSummaryPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
}
@Test( dependsOnMethods = { "testAddProjectGroup2" } )
public void testAddDefautltGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = p.getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = p.getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
clickButtonWithValue( "Add" );
addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
@@ -113,13 +113,13 @@
public void testAddNotDefautltGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = p.getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = p.getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
clickButtonWithValue( "Add" );
addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
@@ -130,13 +130,13 @@
public void testEditGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = p.getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = p.getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
String newPom = "newpom.xml";
String newGoals = "new goals";
String newArguments = "new arguments";
@@ -154,11 +154,11 @@
public void testDeleteGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
// Click in Delete Image
clickLinkWithXPath( "(//a[contains(@href,'removeGroupBuildDefinition')])//img" );
@@ -171,12 +171,12 @@
public void testAddNotDefautltProjectBuildDefinition()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String BUILD_POM_NAME = p.getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = p.getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
clickLinkWithXPath( "//input[contains(@id,'buildDefinition')]" );
addEditGroupBuildDefinition( null, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS, BUILD_DESCRIPTION, false,
@@ -187,10 +187,10 @@
public void testDeleteProjectBuildDefinition()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String BUILD_GOALS = p.getProperty( "BUILD_GOALS" );
- String BUILD_DESCRIPTION = p.getProperty( "BUILD_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String BUILD_GOALS = getProperty( "BUILD_GOALS" );
+ String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
// Click in Delete Image
clickLinkWithXPath( "(//a[contains(@href,'removeProjectBuildDefinition')])//img" );
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
index 270d122..c1f26cd 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
@@ -32,9 +32,9 @@
{
public void testAddBuildEnvironment()
{
- String BUIL_ENV_NAME = p.getProperty( "BUIL_ENV_NAME" );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
goToAddBuildEnvironment();
- addBuildEnvironment( BUIL_ENV_NAME, new String[] {}, true );
+ addBuildEnvironment( BUILD_ENV_NAME, new String[] {}, true );
}
public void testAddInvalidBuildEnvironment()
@@ -47,8 +47,8 @@
@Test( dependsOnMethods = { "testAddBuildEnvironment" } )
public void testEditInvalidBuildEnvironment()
{
- String BUIL_ENV_NAME = p.getProperty( "BUIL_ENV_NAME" );
- goToEditBuildEnvironment( BUIL_ENV_NAME );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+ goToEditBuildEnvironment( BUILD_ENV_NAME );
editBuildEnvironment( "", new String[] {}, false );
assertTextPresent( "You must define a name" );
}
@@ -56,29 +56,79 @@
@Test( dependsOnMethods = { "testAddBuildEnvironment" } )
public void testAddDuplicatedBuildEnvironment()
{
- String BUIL_ENV_NAME = p.getProperty( "BUIL_ENV_NAME" );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
goToAddBuildEnvironment();
- addBuildEnvironment( BUIL_ENV_NAME, new String[] {}, false );
+ addBuildEnvironment( BUILD_ENV_NAME, new String[] {}, false );
assertTextPresent( "A Build Environment with the same name already exists" );
}
@Test( dependsOnMethods = { "testAddBuildEnvironment" } )
public void testEditBuildEnvironment()
{
- String BUIL_ENV_NAME = p.getProperty( "BUIL_ENV_NAME" );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
String newName = "new_name";
- goToEditBuildEnvironment( BUIL_ENV_NAME );
+ goToEditBuildEnvironment( BUILD_ENV_NAME );
editBuildEnvironment( newName, new String[] {}, true );
// TODO: ADD INSTALLATIONS TO ENVIROTMENT
goToEditBuildEnvironment( newName );
- editBuildEnvironment( BUIL_ENV_NAME, new String[] {}, true );
+ editBuildEnvironment( BUILD_ENV_NAME, new String[] {}, true );
}
@Test( dependsOnMethods = { "testEditInvalidBuildEnvironment", "testEditBuildEnvironment",
"testAddDuplicatedBuildEnvironment", "testEditInvalidBuildEnvironment" } )
public void testDeleteBuildEnvironment()
{
- String BUIL_ENV_NAME = p.getProperty( "BUIL_ENV_NAME" );
- removeBuildEnvironment( BUIL_ENV_NAME );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+ removeBuildEnvironment( BUILD_ENV_NAME );
+ }
+
+ @Test( dependsOnMethods = { "testDeleteBuildEnvironment", "testAddBuildAgentGroupWithEmptyBuildAgent" } )
+ public void testAddBuildEnvironmentWithBuildAgentGroup()
+ {
+ try
+ {
+ enableDistributedBuilds();
+
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+ goToAddBuildEnvironment();
+ addBuildEnvironmentWithBuildAgentGroup( BUILD_ENV_NAME, new String[] {}, BUILD_AGENT_GROUPNAME, true );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildEnvironmentWithBuildAgentGroup" } )
+ public void testEditDuplicatedBuildEnvironmentParallelBuilds()
+ {
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+ String newName = "NEW_BUILD_ENV";
+ goToAddBuildEnvironment();
+ addBuildEnvironment( newName, new String[] {}, true );
+ goToEditBuildEnvironment( newName );
+ editBuildEnvironment( BUILD_ENV_NAME, new String[] {}, false );
+ assertTextPresent( "A Build Environment with the same name already exists" );
+ }
+
+ @Test( dependsOnMethods = { "testEditDuplicatedBuildEnvironmentParallelBuilds" } )
+ public void testEditDuplicatedBuildEnvironmentDistributedBuilds()
+ {
+ try
+ {
+ enableDistributedBuilds();
+
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+ String newName = "NEW_BUILD_ENV";
+ goToEditBuildEnvironment( newName );
+ editBuildEnvironmentWithBuildAgentGroup( BUILD_ENV_NAME, new String[] {}, BUILD_AGENT_GROUPNAME, false );
+ assertTextPresent( "A Build Environment with the same name already exists" );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
index f6af149..020843a 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/InstallationTest.java
@@ -30,36 +30,37 @@
public class InstallationTest
extends AbstractInstallationTest
{
- public void testAddJdkToolWithoutBuildEnvirotment()
+ public void testAddJdkToolWithoutBuildEnvironment()
{
- String INSTALL_TOOL_JDK_NAME = p.getProperty( "INSTALL_TOOL_JDK_NAME" );
- String INSTALL_TOOL_JDK_PATH = p.getProperty( "INSTALL_TOOL_JDK_PATH" );
- goToAddInstallationTool();
- addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, true );
+ String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
+ String INSTALL_TOOL_JDK_PATH = isWindows() ? getProperty( "INSTALL_TOOL_JDK_PATH" ) : getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+ goToAddInstallationTool();
+ addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, true );
}
- public void testAddMavenToolWithBuildEnvirotment()
+ public void testAddMavenToolWithBuildEnvironment()
{
- String INTALLA_TOOL_MAVEN_NAME = p.getProperty( "INTALLA_TOOL_MAVEN_NAME" );
- String INTALLA_TOOL_MAVEN_PATH = p.getProperty( "INTALLA_TOOL_MAVEN_PATH" );
- goToAddInstallationTool();
- addInstallation( INTALLA_TOOL_MAVEN_NAME, "Maven 2", INTALLA_TOOL_MAVEN_PATH, true, true, true );
- // TODO: Validate build envirotment
+ String INSTALL_TOOL_MAVEN_NAME = getProperty( "INSTALL_TOOL_MAVEN_NAME" );
+ String INSTALL_TOOL_MAVEN_PATH = isWindows() ? getProperty( "INSTALL_TOOL_MAVEN_PATH" ) : getEscapeProperty( "INSTALL_TOOL_MAVEN_PATH" );
+ goToAddInstallationTool();
+ addInstallation( INSTALL_TOOL_MAVEN_NAME, "Maven 2", INSTALL_TOOL_MAVEN_PATH, true, true, true );
+ // TODO: Validate build environment
+
}
- public void testAddInstallationVariableWithBuildEnvirotment()
+ public void testAddInstallationVariableWithBuildEnvironment()
{
- String INSTALL_VAR_NAME = p.getProperty( "INSTALL_VAR_NAME" );
- String INSTALL_VAR_VARIABLE_NAME = p.getProperty( "INSTALL_VAR_VARIABLE_NAME" );
- String INSTALL_VAR_PATH = p.getProperty( "INSTALL_VAR_PATH" );
+ String INSTALL_VAR_NAME = getProperty( "INSTALL_VAR_NAME" );
+ String INSTALL_VAR_VARIABLE_NAME = getProperty( "INSTALL_VAR_VARIABLE_NAME" );
+ String INSTALL_VAR_PATH = getProperty( "INSTALL_VAR_PATH" );
goToAddInstallationVariable();
addInstallation( INSTALL_VAR_NAME, INSTALL_VAR_VARIABLE_NAME, INSTALL_VAR_PATH, true, false, true );
- // TODO: Validate build envirotment
+ // TODO: Validate build environment
}
- public void testAddInstallationVariableWithoutBuildEnvirotment()
+ public void testAddInstallationVariableWithoutBuildEnvironment()
{
- String INSTALL_VAR_NAME = "var_without_build_envirotment";
+ String INSTALL_VAR_NAME = "var_without_build_environment";
String INSTALL_VAR_VARIABLE_NAME = "var_name";
String INSTALL_VAR_PATH = "path";
goToAddInstallationVariable();
@@ -96,45 +97,46 @@
assertTextPresent( "You must define an environment variable" );
}
- @Test( dependsOnMethods = { "testAddJdkToolWithoutBuildEnvirotment" } )
+ @Test( dependsOnMethods = { "testAddJdkToolWithoutBuildEnvironment" } )
public void testAddDuplicatedInstallationTool()
{
- String INSTALL_TOOL_JDK_NAME = p.getProperty( "INSTALL_TOOL_JDK_NAME" );
- String INSTALL_TOOL_JDK_PATH = p.getProperty( "INSTALL_TOOL_JDK_PATH" );
- goToAddInstallationTool();
- addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, false );
- assertTextPresent( "Installation name already exists" );
+ String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
+ String INSTALL_TOOL_JDK_PATH = isWindows() ? getProperty( "INSTALL_TOOL_JDK_PATH" ) : getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+ goToAddInstallationTool();
+ addInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, false, true, false );
+ assertTextPresent( "Installation name already exists" );
+
}
- @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvirotment" } )
+ @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvironment" } )
public void testAddDuplicatedInstallationVariable()
{
- String INSTALL_VAR_NAME = p.getProperty( "INSTALL_VAR_NAME" );
- String INSTALL_VAR_VARIABLE_NAME = p.getProperty( "INSTALL_VAR_VARIABLE_NAME" );
- String INSTALL_VAR_PATH = p.getProperty( "INSTALL_VAR_PATH" );
+ String INSTALL_VAR_NAME = getProperty( "INSTALL_VAR_NAME" );
+ String INSTALL_VAR_VARIABLE_NAME = getProperty( "INSTALL_VAR_VARIABLE_NAME" );
+ String INSTALL_VAR_PATH = getProperty( "INSTALL_VAR_PATH" );
goToAddInstallationVariable();
addInstallation( INSTALL_VAR_NAME, INSTALL_VAR_VARIABLE_NAME, INSTALL_VAR_PATH, false, false, false );
assertTextPresent( "Installation name already exists" );
}
- @Test( dependsOnMethods = { "testAddJdkToolWithoutBuildEnvirotment" } )
+ @Test( dependsOnMethods = { "testAddJdkToolWithoutBuildEnvironment" } )
public void testEditInstallationTool()
{
- String INSTALL_TOOL_JDK_NAME = p.getProperty( "INSTALL_TOOL_JDK_NAME" );
- String INSTALL_TOOL_JDK_PATH = p.getProperty( "INSTALL_TOOL_JDK_PATH" );
- String newName = "new_name";
- goToEditInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true );
- editInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
- goToEditInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true );
- editInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+ String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
+ String INSTALL_TOOL_JDK_PATH = isWindows() ? getProperty( "INSTALL_TOOL_JDK_PATH" ) : getEscapeProperty( "INSTALL_TOOL_JDK_PATH" );
+ String newName = "new_name";
+ goToEditInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true );
+ editInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
+ goToEditInstallation( newName, "JDK", INSTALL_TOOL_JDK_PATH, true );
+ editInstallation( INSTALL_TOOL_JDK_NAME, "JDK", INSTALL_TOOL_JDK_PATH, true, true );
}
- @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvirotment" } )
+ @Test( dependsOnMethods = { "testAddInstallationVariableWithBuildEnvironment" } )
public void testEditInstallationVariable()
{
- String INSTALL_VAR_NAME = p.getProperty( "INSTALL_VAR_NAME" );
- String INSTALL_VAR_VARIABLE_NAME = p.getProperty( "INSTALL_VAR_VARIABLE_NAME" );
- String INSTALL_VAR_PATH = p.getProperty( "INSTALL_VAR_PATH" );
+ String INSTALL_VAR_NAME = getProperty( "INSTALL_VAR_NAME" );
+ String INSTALL_VAR_VARIABLE_NAME = getProperty( "INSTALL_VAR_VARIABLE_NAME" );
+ String INSTALL_VAR_PATH = getProperty( "INSTALL_VAR_PATH" );
String newName = "new_name";
String newVarName = "new_var_name";
String newPath = "new_path";
@@ -147,14 +149,21 @@
@Test( dependsOnMethods = { "testEditInstallationTool", "testAddDuplicatedInstallationTool" } )
public void testDeleteInstallationTool()
{
- String INSTALL_TOOL_JDK_NAME = p.getProperty( "INSTALL_TOOL_JDK_NAME" );
+ String INSTALL_TOOL_JDK_NAME = getProperty( "INSTALL_TOOL_JDK_NAME" );
removeInstallation( INSTALL_TOOL_JDK_NAME );
}
@Test( dependsOnMethods = { "testEditInstallationVariable", "testAddDuplicatedInstallationVariable" } )
public void testDeleteInstallationVariable()
{
- String INSTALL_VAR_NAME = p.getProperty( "INSTALL_VAR_NAME" );
+ String INSTALL_VAR_NAME = getProperty( "INSTALL_VAR_NAME" );
removeInstallation( INSTALL_VAR_NAME );
}
+
+ public static boolean isWindows()
+ {
+ String os = System.getProperty("os.name").toLowerCase();
+ //windows
+ return (os.indexOf( "win" ) >= 0);
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LocalRepositoriesTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LocalRepositoriesTest.java
index af6ebb1..2f6e67d 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LocalRepositoriesTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LocalRepositoriesTest.java
@@ -32,8 +32,8 @@
{
public void testAddLocalRepository()
{
- String LOCAL_REPOSITORY_NAME = p.getProperty( "LOCAL_REPOSITORY_NAME" );
- String LOCAL_REPOSITORY_LOCATION = p.getProperty( "LOCAL_REPOSITORY_LOCATION" );
+ String LOCAL_REPOSITORY_NAME = getProperty( "LOCAL_REPOSITORY_NAME" );
+ String LOCAL_REPOSITORY_LOCATION = getProperty( "LOCAL_REPOSITORY_LOCATION" );
goToAddLocalRepository();
addEditLocalRepository( LOCAL_REPOSITORY_NAME, LOCAL_REPOSITORY_LOCATION, true );
}
@@ -49,19 +49,30 @@
@Test( dependsOnMethods = { "testAddLocalRepository" } )
public void testAddDuplicatedLocalRepository()
{
- String LOCAL_REPOSITORY_NAME = p.getProperty( "LOCAL_REPOSITORY_NAME" );
- String LOCAL_REPOSITORY_LOCATION = p.getProperty( "LOCAL_REPOSITORY_LOCATION" );
+ String LOCAL_REPOSITORY_NAME = getProperty( "LOCAL_REPOSITORY_NAME" );
+ String LOCAL_REPOSITORY_LOCATION = getProperty( "LOCAL_REPOSITORY_LOCATION" );
goToAddLocalRepository();
addEditLocalRepository( LOCAL_REPOSITORY_NAME, LOCAL_REPOSITORY_LOCATION, false );
assertTextPresent( "Local repository name must be unique" );
assertTextPresent( "Local repository location must be unique" );
}
-
+
@Test( dependsOnMethods = { "testAddDuplicatedLocalRepository" } )
+ public void testAddDuplicateLocalRepositoryWithTrailingWhitespaces()
+ {
+ String duplicateRepositoryName = addTrailingWhitespace( getProperty( "LOCAL_REPOSITORY_NAME" ) );
+ String duplicateRepositoryLocation = addTrailingWhitespace( getProperty( "LOCAL_REPOSITORY_LOCATION" ) );
+ goToAddLocalRepository();
+ addEditLocalRepository( duplicateRepositoryName, duplicateRepositoryLocation, false );
+ assertTextPresent( "Local repository name must be unique" );
+ assertTextPresent( "Local repository location must be unique" );
+ }
+
+ @Test( dependsOnMethods = { "testAddDuplicateLocalRepositoryWithTrailingWhitespaces" } )
public void testEditLocalRepository()
{
- String LOCAL_REPOSITORY_NAME = p.getProperty( "LOCAL_REPOSITORY_NAME" );
- String LOCAL_REPOSITORY_LOCATION = p.getProperty( "LOCAL_REPOSITORY_LOCATION" );
+ String LOCAL_REPOSITORY_NAME = getProperty( "LOCAL_REPOSITORY_NAME" );
+ String LOCAL_REPOSITORY_LOCATION = getProperty( "LOCAL_REPOSITORY_LOCATION" );
String newName = "new_name";
String newLocation = "new_location";
goToEditLocalRepository( LOCAL_REPOSITORY_NAME, LOCAL_REPOSITORY_LOCATION );
@@ -73,7 +84,13 @@
@Test( dependsOnMethods = { "testEditLocalRepository" } )
public void testDeleteLocalRepository()
{
- String LOCAL_REPOSITORY_NAME = p.getProperty( "LOCAL_REPOSITORY_NAME" );
+ String LOCAL_REPOSITORY_NAME = getProperty( "LOCAL_REPOSITORY_NAME" );
removeLocalRepository( LOCAL_REPOSITORY_NAME );
}
+
+ private String addTrailingWhitespace( String str )
+ {
+ String WHITESPACE = " ";
+ return WHITESPACE.concat( str.concat( WHITESPACE ) );
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
index 0ce69eb..cbb591e 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
@@ -20,8 +20,6 @@
*/
import org.apache.continuum.web.test.parent.AbstractContinuumTest;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
/*
@@ -31,7 +29,7 @@
*/
/**
* Based on LoginTest of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -43,7 +41,7 @@
{
goToLoginPage();
getSelenium().type( "loginForm_username", "badUsername" );
- getSelenium().type( "loginForm_username", p.getProperty( "ADMIN_PASSWORD" ) );
+ getSelenium().type( "loginForm_username", getProperty( "ADMIN_PASSWORD" ) );
getSelenium().click( "loginForm__login" );
getSelenium().waitForPageToLoad( maxWaitTimeInMs );
assertTextPresent( "You have entered an incorrect username and/or password" );
@@ -53,7 +51,7 @@
public void testWithBadPassword()
{
goToLoginPage();
- getSelenium().type( "loginForm_username", p.getProperty( "ADMIN_USERNAME" ) );
+ getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
getSelenium().type( "loginForm_password", "badPassword" );
getSelenium().click( "loginForm__login" );
getSelenium().waitForPageToLoad( maxWaitTimeInMs );
@@ -74,7 +72,7 @@
public void testWithEmptyPassword()
{
goToLoginPage();
- getSelenium().type( "loginForm_username", p.getProperty( "ADMIN_USERNAME" ) );
+ getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
getSelenium().click( "loginForm__login" );
getSelenium().waitForPageToLoad( maxWaitTimeInMs );
assertTextPresent( "You have entered an incorrect username and/or password" );
@@ -84,27 +82,12 @@
public void testWithCorrectUsernamePassword()
{
goToLoginPage();
- getSelenium().type( "loginForm_username", p.getProperty( "ADMIN_USERNAME" ) );
- getSelenium().type( "loginForm_password", p.getProperty( "ADMIN_PASSWORD" ) );
+ getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
+ getSelenium().type( "loginForm_password", getProperty( "ADMIN_PASSWORD" ) );
getSelenium().click( "loginForm__login" );
getSelenium().waitForPageToLoad( maxWaitTimeInMs );
assertTextPresent( "Edit Details" );
assertTextPresent( "Logout" );
- assertTextPresent( p.getProperty( "ADMIN_USERNAME" ) );
- }
-
- @BeforeTest
- public void open()
- throws Exception
- {
- super.open();
- }
-
- @Override
- @AfterTest
- public void close()
- throws Exception
- {
- super.close();
+ assertTextPresent( getProperty( "ADMIN_USERNAME" ) );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
index a378826..9423f30 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
@@ -24,7 +24,7 @@
/**
* Based on AddMavenOneProjectTestCase of Emmanuel Venisse.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -32,18 +32,42 @@
public class MavenOneProjectTest
extends AbstractContinuumTest
{
+ public void testAddMavenOneProjectWithNoDefaultBuildDefinitionFromTemplate()
+ throws Exception
+ {
+ String M1_POM_URL = getProperty( "M1_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
+ String M1_PROJ_GRP_NAME = getProperty( "M1_PROJ_GRP_NAME" );
+ String M1_PROJ_GRP_ID = getProperty( "M1_PROJ_GRP_ID" );
+ String M1_PROJ_GRP_DESCRIPTION = getProperty( "M1_PROJ_GRP_DESCRIPTION" );
+
+ removeDefaultBuildDefinitionFromTemplate( "maven1" );
+
+ goToAddMavenOneProjectPage();
+ addMavenOneProject( M1_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, true );
+ assertProjectGroupSummaryPage( M1_PROJ_GRP_NAME, M1_PROJ_GRP_ID, M1_PROJ_GRP_DESCRIPTION );
+
+ // Delete project group
+ removeProjectGroup( M1_PROJ_GRP_NAME );
+
+ // Re-add default build definition of template
+ addDefaultBuildDefinitionFromTemplate( "maven1" );
+ }
+
/**
* test with valid pom url
*/
+ @Test( dependsOnMethods = { "testAddMavenOneProjectWithNoDefaultBuildDefinitionFromTemplate" } )
public void testValidPomUrl()
throws Exception
{
- String M1_POM_URL = p.getProperty( "M1_POM_URL" );
- String M1_POM_USERNAME = p.getProperty( "M1_POM_USERNAME" );
- String M1_POM_PASSWORD = p.getProperty( "M1_POM_PASSWORD" );
- String M1_PROJ_GRP_NAME = p.getProperty( "M1_PROJ_GRP_NAME" );
- String M1_PROJ_GRP_ID = p.getProperty( "M1_PROJ_GRP_ID" );
- String M1_PROJ_GRP_DESCRIPTION = p.getProperty( "M1_PROJ_GRP_DESCRIPTION" );
+ String M1_POM_URL = getProperty( "M1_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
+ String M1_PROJ_GRP_NAME = getProperty( "M1_PROJ_GRP_NAME" );
+ String M1_PROJ_GRP_ID = getProperty( "M1_PROJ_GRP_ID" );
+ String M1_PROJ_GRP_DESCRIPTION = getProperty( "M1_PROJ_GRP_DESCRIPTION" );
// Enter values into Add Maven Two Project fields, and submit
goToAddMavenOneProjectPage();
addMavenOneProject( M1_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, true );
@@ -54,12 +78,12 @@
public void testAddMavenOneProjectFromRemoteSourceToNonDefaultProjectGroup()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String M1_POM_URL = p.getProperty( "M1_POM_URL" );
- String M1_POM_USERNAME = p.getProperty( "M1_POM_USERNAME" );
- String M1_POM_PASSWORD = p.getProperty( "M1_POM_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String M1_POM_URL = getProperty( "M1_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
goToAddMavenOneProjectPage();
addMavenOneProject( M1_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, TEST_PROJ_GRP_NAME, null, true );
assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
@@ -82,9 +106,9 @@
public void testMissingElementInPom()
throws Exception
{
- String M1_MISS_REPO_POM_URL = p.getProperty( "M1_MISS_REPO_POM_URL" );
- String M1_POM_USERNAME = p.getProperty( "M1_POM_USERNAME" );
- String M1_POM_PASSWORD = p.getProperty( "M1_POM_PASSWORD" );
+ String M1_MISS_REPO_POM_URL = getProperty( "M1_MISS_REPO_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
goToAddMavenOneProjectPage();
addMavenOneProject( M1_MISS_REPO_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, false );
assertTextPresent( "Missing 'repository' element in the POM." );
@@ -96,9 +120,9 @@
public void testWithExtendElementPom()
throws Exception
{
- String M1_EXTENDED_POM_URL = p.getProperty( "M1_EXTENDED_POM_URL" );
- String M1_POM_USERNAME = p.getProperty( "M1_POM_USERNAME" );
- String M1_POM_PASSWORD = p.getProperty( "M1_POM_PASSWORD" );
+ String M1_EXTENDED_POM_URL = getProperty( "M1_EXTENDED_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
goToAddMavenOneProjectPage();
addMavenOneProject( M1_EXTENDED_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, false );
assertTextPresent( "Cannot use a POM with an 'extend' element" );
@@ -110,9 +134,9 @@
public void testUnparseableXmlContent()
throws Exception
{
- String M1_UNPARSEABLE_POM_URL = p.getProperty( "M1_UNPARSEABLE_POM_URL" );
- String M1_POM_USERNAME = p.getProperty( "M1_POM_USERNAME" );
- String M1_POM_PASSWORD = p.getProperty( "M1_POM_PASSWORD" );
+ String M1_UNPARSEABLE_POM_URL = getProperty( "M1_UNPARSEABLE_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
goToAddMavenOneProjectPage();
addMavenOneProject( M1_UNPARSEABLE_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, false );
assertTextPresent( "The XML content of the POM can not be parsed." );
@@ -136,7 +160,7 @@
public void testInaccessiblePomUrl()
throws Exception
{
- String pomUrl = "http://www.google.com";
+ String pomUrl = "http://localhost:9595/";
goToAddMavenOneProjectPage();
addMavenOneProject( pomUrl, "", "", null, null, false );
assertTextPresent( "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
@@ -152,4 +176,64 @@
clickButtonWithValue( "Cancel" );
assertAboutPage();
}
+
+ @Test( dependsOnMethods = { "testValidPomUrl" } )
+ public void testDeleteMavenOneProject()
+ throws Exception
+ {
+ boolean isExisting = false;
+ String M1_PROJ_GRP_NAME = getProperty( "M1_DELETE_PROJ_GRP_NAME" );
+ goToProjectGroupsSummaryPage();
+
+ if ( isLinkPresent( M1_PROJ_GRP_NAME ) )
+ {
+ isExisting = true;
+ }
+ else
+ {
+ addMaven1Project( M1_PROJ_GRP_NAME );
+ }
+
+ // delete project - delete icon
+ clickLinkWithText( M1_PROJ_GRP_NAME );
+ clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
+ assertTextPresent( "Delete Continuum Project" );
+ clickButtonWithValue( "Delete" );
+ assertPage( "Continuum - Project Group" );
+ assertLinkNotPresent( M1_PROJ_GRP_NAME );
+
+ // remove group for next test
+ removeProjectGroup( M1_PROJ_GRP_NAME );
+
+ // delete project - "Delete Project(s)" button
+ addMaven1Project( M1_PROJ_GRP_NAME );
+ clickLinkWithText( M1_PROJ_GRP_NAME );
+ checkField( "//tbody/tr['0']/td['0']/input[@name='selectedProjects']" );
+ clickButtonWithValue( "Delete Project(s)" );
+ assertTextPresent( "Delete Continuum Projects" );
+ clickButtonWithValue( "Delete" );
+ assertPage( "Continuum - Project Group" );
+ assertLinkNotPresent( M1_PROJ_GRP_NAME );
+
+ if ( !isExisting )
+ {
+ removeProjectGroup( M1_PROJ_GRP_NAME );
+ }
+ }
+
+ private void addMaven1Project( String groupName )
+ throws Exception
+ {
+ String M1_POM_URL = getProperty( "M1_DELETE_POM_URL" );
+ String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+ String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
+ String M1_PROJ_GRP_ID = getProperty( "M1_DELETE_PROJ_GRP_ID" );
+ String M1_PROJ_GRP_DESCRIPTION = getProperty( "M1_DELETE_PROJ_GRP_DESCRIPTION" );
+
+ goToAddMavenOneProjectPage();
+ assertLinkNotPresent( groupName );
+ addMavenOneProject( M1_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, true );
+ goToProjectGroupsSummaryPage();
+ assertLinkPresent( groupName );
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
index 496a164..cd02dd6 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
@@ -24,7 +24,7 @@
/**
* Based on AddMavenTwoProjectTest of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -33,36 +33,95 @@
extends AbstractContinuumTest
{
+ public void testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate()
+ throws Exception
+ {
+ String M2_POM_URL = getProperty( "M2_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+ String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
+
+ removeDefaultBuildDefinitionFromTemplate( "maven2" );
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+
+ assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+
+ // Delete project group
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+
+ // Re-add default build definition of template
+ addDefaultBuildDefinitionFromTemplate( "maven2" );
+ }
+
+ @Test( dependsOnMethods = { "testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate" } )
public void testAddMavenTwoProject()
throws Exception
{
- String M2_POM_URL = p.getProperty( "M2_POM_URL" );
- String M2_POM_USERNAME = p.getProperty( "M2_POM_USERNAME" );
- String M2_POM_PASSWORD = p.getProperty( "M2_POM_PASSWORD" );
+ String M2_POM_URL = getProperty( "M2_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_ID = p.getProperty( "M2_PROJ_GRP_ID" );
- String M2_PROJ_GRP_DESCRIPTION = p.getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+ String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
+
// Enter values into Add Maven Two Project fields, and submit
addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
// Wait Struct Listener
assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ }
+
+ /**
+ * Test flat multi module project with names that start with the same letter
+ */
+ public void testAddMavenTwoProjectModuleNameWithSameLetter()
+ throws Exception
+ {
+ String M2_POM_URL = getProperty( "M2_SAME_LETTER_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+ String M2_PROJ_GRP_NAME = getProperty( "M2_SAME_LETTER_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_SAME_LETTER_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_SAME_LETTER_PROJ_GRP_DESCRIPTION" );
+
+ String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL" );
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+
+ assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
}
@Test( dependsOnMethods = { "testAddProjectGroup" } )
public void testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
- String M2_POM_URL = p.getProperty( "M2_POM_URL" );
- String M2_POM_USERNAME = p.getProperty( "M2_POM_USERNAME" );
- String M2_POM_PASSWORD = p.getProperty( "M2_POM_PASSWORD" );
+ String M2_POM_URL = getProperty( "M2_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, TEST_PROJ_GRP_NAME, true );
assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+
+ assertTextPresent( TEST_PROJ_GRP_SCM_ROOT_URL );
}
/**
@@ -81,7 +140,7 @@
public void testMissingScmElementPom()
throws Exception
{
- String pomUrl = p.getProperty( "NOT_SCM_POM_URL" );
+ String pomUrl = getProperty( "NOT_SCM_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl, false );
assertTextPresent( "Missing ''scm'' element in the POM, project Maven Two Project" );
}
@@ -103,7 +162,7 @@
public void testMissingConnectionElement()
throws Exception
{
- String pomUrl = p.getProperty( "MISS_CONECT_POM_URL" );
+ String pomUrl = getProperty( "MISS_CONECT_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl, false );
assertTextPresent( "Missing 'connection' sub-element in the 'scm' element in the POM." );
}
@@ -125,7 +184,7 @@
public void testMissingParentPom()
throws Exception
{
- String pomUrl = p.getProperty( "MISS_PARENT_POM_URL" );
+ String pomUrl = getProperty( "MISS_PARENT_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl, false );
assertTextPresent( "Missing artifact trying to build the POM. Check that its parent POM is available or add it first in Continuum." );
}
@@ -136,7 +195,7 @@
public void testMissingModules()
throws Exception
{
- String pomUrl = p.getProperty( "MISS_SUBPRO_POM_URL" );
+ String pomUrl = getProperty( "MISS_SUBPRO_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl, false );
assertTextPresent( "Unknown error trying to build POM." );
}
@@ -147,7 +206,7 @@
public void testInaccessiblePomUrl()
throws Exception
{
- String pomUrl = "http://www.google.com";
+ String pomUrl = "http://localhost:9595/";
submitAddMavenTwoProjectPage( pomUrl, false );
assertTextPresent( "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
}
@@ -162,4 +221,212 @@
clickButtonWithValue( "Cancel" );
assertAboutPage();
}
+
+ @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
+ public void testDeleteMavenTwoProject()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_DELETE_PROJ_GRP_SCM_ROOT_URL" );
+ goToProjectGroupsSummaryPage();
+
+ // delete project - delete icon
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+ assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+
+ // TODO: this doesn't always seem to work, perhaps because of changes in the way icons are displayed
+ // wait for project to finish checkout
+ waitForProjectCheckout();
+
+ clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
+ assertTextPresent( "Delete Continuum Project" );
+ clickButtonWithValue( "Delete" );
+ assertPage( "Continuum - Project Group" );
+ assertTextNotPresent( "Unable to delete project" );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+
+ // remove group for next test
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+
+ // delete project - "Delete Project(s)" button
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+ //wait for project to finish checkout
+ waitForProjectCheckout();
+
+ checkField( "//tbody/tr['0']/td['0']/input[@name='selectedProjects']" );
+ clickButtonWithValue( "Delete Project(s)" );
+ assertTextPresent( "Delete Continuum Projects" );
+ clickButtonWithValue( "Delete" );
+ assertPage( "Continuum - Project Group" );
+ assertTextNotPresent( "Unable to delete project" );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+
+ // remove project group
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+
+ public void testBuildProjectGroupNoBuildAgentConfigured()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+
+ try
+ {
+ enableDistributedBuilds();
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+
+ showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickButtonWithValue( "Build all projects" );
+
+ assertTextPresent( "Unable to build projects because no build agent is configured" );
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testDeleteMavenTwoProject", "testAddBuildAgent" } )
+ public void testProjectGroupAllBuildSuccessWithDistributedBuilds()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+
+ try
+ {
+ enableDistributedBuilds();
+
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+
+ showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickButtonWithValue( "Build all projects" );
+
+ buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildAgentGroupWithEmptyBuildAgent", "testAddBuildEnvironmentWithBuildAgentGroup" } )
+ public void testProjectGroupNoBuildAgentConfiguredInBuildAgentGroup()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+ String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
+
+ try
+ {
+ enableDistributedBuilds();
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+
+ goToGroupBuildDefinitionPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickImgWithAlt( "Edit" );
+ assertAddEditBuildDefinitionPage();
+ selectValue( "profileId", BUILD_ENV_NAME );
+ submit();
+ assertGroupBuildDefinitionPage( M2_PROJ_GRP_NAME );
+
+ clickLinkWithText( "Project Group Summary" );
+ clickButtonWithValue( "Build all projects" );
+
+ assertTextPresent( "Unable to build projects because no build agent is configured in the build agent group" );
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ public void testBuildMaven2ProjectWithTag()
+ throws Exception
+ {
+ String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = "";
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME );
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildAgent" } )
+ public void testBuildMaven2ProjectWithTagDistributedBuild()
+ throws Exception
+ {
+ String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = "";
+
+ try
+ {
+ enableDistributedBuilds();
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME );
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ private void addMaven2Project( String groupName )
+ throws Exception
+ {
+ String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
+ String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+ String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
+
+ addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ goToProjectGroupsSummaryPage();
+ assertLinkPresent( groupName );
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MyAccountTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MyAccountTest.java
index 6efc0b7..d02f7b0 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MyAccountTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MyAccountTest.java
@@ -25,7 +25,7 @@
/**
* Based on MyAccountTest of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -51,11 +51,11 @@
clickLinkWithText( "Edit Details" );
assertFieldValue( newFullName, "user.fullName" );
assertFieldValue( newEmail, "user.email" );
- setFieldValue( "user.fullName", p.getProperty( "ADMIN_USERNAME" ) );
+ setFieldValue( "user.fullName", getProperty( "ADMIN_USERNAME" ) );
setFieldValue( "user.email", email );
submit();
clickLinkWithText( "Edit Details" );
- assertFieldValue( p.getProperty( "ADMIN_USERNAME" ), "user.fullName" );
+ assertFieldValue( getProperty( "ADMIN_USERNAME" ), "user.fullName" );
assertFieldValue( email, "user.email" );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
index 3b5545c..61c41f8 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
@@ -26,16 +26,16 @@
* @author José Morales Martínez
* @version $Id$
*/
-@Test( groups = { "notifier" }, dependsOnMethods = { "testAddMavenTwoProject" } )
+@Test( groups = { "notifier" }, dependsOnMethods = { "testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup" } )
public class NotifierTest
extends AbstractNotifierTest
{
public void testAddValidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, true );
}
@@ -44,9 +44,9 @@
public void testEditValidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
String newMail = "newmail@mail.com";
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, newMail, true );
@@ -57,9 +57,9 @@
public void testEditInvalidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, "invalid_email_add", false );
}
@@ -67,8 +67,8 @@
public void testAddInvalidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "invalid_email_add", false );
}
@@ -76,10 +76,10 @@
public void testAddValidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addMailNotifier( TEST_PROJ_GRP_NAME, null, MAIL_NOTIFIER_ADDRESS, true );
}
@@ -88,10 +88,10 @@
public void testEditValidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
String newMail = "newmail@mail.com";
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
@@ -104,10 +104,10 @@
public void testEditInvalidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = p.getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -117,9 +117,9 @@
public void testAddInvalidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addMailNotifier( TEST_PROJ_GRP_NAME, null, "invalid_email_add", false );
}
@@ -127,10 +127,10 @@
public void testAddValidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, true );
}
@@ -139,10 +139,10 @@
public void testEditValidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
String newHost = "new.test.com";
String newChannel = "new_test_channel";
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
@@ -156,10 +156,10 @@
public void testEditInvalidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, "", "", false );
}
@@ -167,8 +167,8 @@
public void testAddInvalidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", false );
}
@@ -176,11 +176,11 @@
public void testAddValidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addIrcNotifier( TEST_PROJ_GRP_NAME, null, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, true );
}
@@ -189,11 +189,11 @@
public void testEditValidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
String newHost = "new.test.com";
String newChannel = "new_test_channel";
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
@@ -207,11 +207,11 @@
public void testEditInvalidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = p.getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = p.getProperty( "IRC_NOTIFIER_CHANNEL" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
+ String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -221,9 +221,9 @@
public void testAddInvalidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addIrcNotifier( TEST_PROJ_GRP_NAME, null, "", "", false );
}
@@ -231,12 +231,12 @@
public void testAddValidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = p.getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
@@ -246,12 +246,12 @@
public void testEditValidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = p.getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
String newHost = "new_test";
String newLogin = "new_test_login";
String newPassword = "new_password";
@@ -267,11 +267,11 @@
public void testEditInvalidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
JABBER_NOTIFIER_ADDRESS, "", "", "", "", false );
@@ -280,8 +280,8 @@
public void testAddInvalidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", "", "", false );
}
@@ -289,13 +289,13 @@
public void testAddValidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = p.getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addJabberNotifier( TEST_PROJ_GRP_NAME, null, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
@@ -305,13 +305,13 @@
public void testEditValidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = p.getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
String newHost = "new_test";
String newLogin = "new_test_login";
String newPassword = "new_password";
@@ -329,12 +329,12 @@
public void testEditInvalidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = p.getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = p.getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_ADDRESS = p.getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
+ String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -345,9 +345,9 @@
public void testAddInvalidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addJabberNotifier( TEST_PROJ_GRP_NAME, null, "", "", "", "", false );
}
@@ -355,11 +355,11 @@
public void testAddValidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = p.getProperty( "MSN_NOTIFIER_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
+ String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD,
MSN_NOTIFIER_ADDRESS, true );
@@ -369,11 +369,11 @@
public void testEditValidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = p.getProperty( "MSN_NOTIFIER_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
+ String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
@@ -388,10 +388,10 @@
public void testEditInvalidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_ADDRESS, "", "", "",
false );
@@ -400,8 +400,8 @@
public void testAddInvalidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", "", false );
}
@@ -409,12 +409,12 @@
public void testAddValidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = p.getProperty( "MSN_NOTIFIER_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
+ String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addMsnNotifier( TEST_PROJ_GRP_NAME, null, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD, MSN_NOTIFIER_ADDRESS, true );
}
@@ -423,12 +423,12 @@
public void testEditValidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = p.getProperty( "MSN_NOTIFIER_PASSWORD" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
+ String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
@@ -445,11 +445,11 @@
public void testEditInvalidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = p.getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = p.getProperty( "MSN_NOTIFIER_LOGIN" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -459,9 +459,9 @@
public void testAddInvalidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addMsnNotifier( TEST_PROJ_GRP_NAME, null, "", "", "", false );
}
@@ -469,10 +469,10 @@
public void testAddValidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addWagonNotifierPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, true );
}
@@ -481,10 +481,10 @@
public void testEditValidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
String newId = "newId";
String newUrl = WAGON_NOTIFIER_URL;
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
@@ -498,10 +498,10 @@
public void testEditInvalidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
editWagonNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, "", "", false );
}
@@ -509,8 +509,8 @@
public void testAddInvalidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
addWagonNotifierPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", false );
}
@@ -518,11 +518,11 @@
public void testAddValidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addWagonNotifierPage( TEST_PROJ_GRP_NAME, null, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, true );
}
@@ -531,11 +531,11 @@
public void testEditValidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
String newId = "newId";
String newUrl = WAGON_NOTIFIER_URL;
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
@@ -549,11 +549,11 @@
public void testEditInvalidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = p.getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = p.getProperty( "WAGON_SERVER_ID" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
+ String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -563,9 +563,9 @@
public void testAddInvalidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
addWagonNotifierPage( TEST_PROJ_GRP_NAME, null, "", "", false );
}
@@ -574,9 +574,9 @@
public void testDeleteGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
clickLinkWithText( "Notifiers" );
assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
@@ -591,8 +591,8 @@
public void testDeleteProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
// Delete
clickLinkWithXPath( "(//a[contains(@href,'deleteProjectNotifier') and contains(@href,'mail')])//img" );
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
index cf5911a..c8e45dd 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
@@ -20,11 +20,12 @@
*/
import org.apache.continuum.web.test.parent.AbstractContinuumTest;
+import org.apache.continuum.web.test.parent.AbstractSeleniumTest;
import org.testng.annotations.Test;
/**
* Based on ProjectGroupTest of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -36,9 +37,9 @@
public void testAddProjectGroup()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, true );
showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
@@ -47,9 +48,9 @@
public void testAddProjectGroup2()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
addProjectGroup( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION, true );
showProjectGroup( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
@@ -59,14 +60,16 @@
public void testMoveProject()
throws Exception
{
- String TEST_PROJ_GRP_NAME = p.getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = p.getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String DEFAULT_PROJ_GRP_NAME = p.getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String DEFAULT_PROJ_GRP_ID = p.getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String DEFAULT_PROJ_GRP_DESCRIPTION = p.getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
+ String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
+ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+ String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+ String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+ String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ // TODO: need to wait for checkout to complete. Can we add a special IT type of project that doesn't require checkout?
+ // currently we get away with it due to the usualy duration between the dependant test and this test
// move the project of the test project group to the default project group
moveProjectToProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME,
DEFAULT_PROJ_GRP_NAME );
@@ -102,9 +105,9 @@
final String sNewProjectName = "New Project Group Name";
final String sNewProjectDescription = "New Project Group Description";
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
editProjectGroup( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION, sNewProjectName,
sNewProjectDescription );
@@ -120,9 +123,9 @@
throws Exception
{
- String TEST2_PROJ_GRP_NAME = p.getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = p.getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = p.getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
+ String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
+ String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
+ String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
editProjectGroup( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION, " ",
TEST2_PROJ_GRP_DESCRIPTION );
assertTextPresent( "Project Group Name cannot contain spaces only" );
@@ -132,11 +135,90 @@
public void testProjectGroupAllBuildSuccess()
throws Exception
{
- String M2_PROJ_GRP_NAME = p.getProperty( "M2_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_ID = p.getProperty( "M2_PROJ_GRP_ID" );
- String M2_PROJ_GRP_DESCRIPTION = p.getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME );
clickButtonWithValue( "Release" );
assertReleaseSuccess();
}
+
+ @Test( dependsOnMethods = { "testAddProjectGroup" } )
+ public void testDeleteProjectGroup()
+ throws Exception
+ {
+ String TEST_GRP_NAME = getProperty( "TEST_DELETE_GRP_NAME" );
+ String TEST_GRP_ID = getProperty( "TEST_DELETE_GRP_ID" );
+ String TEST_GRP_DESCRIPTION = getProperty( "TEST_DELETE_GRP_DESCRIPTION" );
+
+ // delete group - delete icon
+ addProjectGroup( TEST_GRP_NAME, TEST_GRP_ID, TEST_GRP_DESCRIPTION, true );
+ assertLinkPresent( TEST_GRP_NAME );
+ clickLinkWithXPath( "//tbody/tr['0']/td['4']/a/img[@alt='Delete Group']" );
+ assertTextPresent( "Project Group Removal" );
+ clickButtonWithValue( "Delete" );
+ assertProjectGroupsSummaryPage();
+ assertLinkNotPresent( TEST_GRP_NAME );
+
+ // delete group - "Delete Group" button
+ addProjectGroup( TEST_GRP_NAME, TEST_GRP_ID, TEST_GRP_DESCRIPTION, true );
+ assertLinkPresent( TEST_GRP_NAME );
+ removeProjectGroup( TEST_GRP_NAME );
+ assertLinkNotPresent( TEST_GRP_NAME );
+ assertProjectGroupsSummaryPage();
+ assertLinkNotPresent( TEST_GRP_NAME );
+ }
+
+ public void testProjectGroupMembers()
+ throws Exception
+ {
+ String GRP_NAME_ONE = getProperty( "TEST_PROJ_GRP_NAME_ONE" );
+ String GRP_ID_ONE = getProperty( "TEST_PROJ_GRP_ID_ONE" );
+ String GRP_DESCRIPTION_ONE = getProperty( "TEST_PROJ_GRP_DESCRIPTION_ONE" );
+ String GRP_NAME_TWO = getProperty( "TEST_PROJ_GRP_NAME_TWO" );
+ String GRP_ID_TWO = getProperty( "TEST_PROJ_GRP_ID_TWO" );
+ String GRP_DESCRIPTION_TWO = getProperty( "TEST_PROJ_GRP_DESCRIPTION_TWO" );
+ String GRP_NAME_THREE = getProperty( "TEST_PROJ_GRP_NAME_THREE" );
+ String GRP_ID_THREE = getProperty( "TEST_PROJ_GRP_ID_THREE" );
+ String GRP_DESCRIPTION_THREE = getProperty( "TEST_PROJ_GRP_DESCRIPTION_THREE" );
+
+ addProjectGroup( GRP_NAME_ONE, GRP_ID_ONE, GRP_DESCRIPTION_ONE, true );
+ assertLinkPresent( GRP_NAME_ONE );
+
+ addProjectGroup( GRP_NAME_TWO, GRP_ID_TWO, GRP_DESCRIPTION_TWO, true );
+ assertLinkPresent( GRP_NAME_TWO );
+
+ addProjectGroup( GRP_NAME_THREE, GRP_ID_THREE, GRP_DESCRIPTION_THREE, true );
+ assertLinkPresent( GRP_NAME_THREE );
+
+ createAndAddUserAsDeveloperToGroup( "username1", "user1", "user1@something.com", "password123", GRP_NAME_ONE );
+ createAndAddUserAsDeveloperToGroup( "username2", "user2", "user2@something.com", "password123", GRP_NAME_ONE );
+ createAndAddUserAsDeveloperToGroup( "username3", "user3", "user3@something.com", "password123", GRP_NAME_TWO );
+ createAndAddUserAsDeveloperToGroup( "username4", "user4", "user4@something.com", "password123", GRP_NAME_THREE );
+
+ showMembers( GRP_NAME_ONE, GRP_ID_ONE, GRP_DESCRIPTION_ONE );
+ assertUserPresent( "username1", "user1", "user1@something.com" );
+ assertUserPresent( "username2", "user2", "user2@something.com" );
+ assertUserNotPresent( "username3", "user3", "user3@something.com" );
+ assertUserNotPresent( "username4", "user4", "user4@something.com" );
+
+ showMembers( GRP_NAME_TWO, GRP_ID_TWO, GRP_DESCRIPTION_TWO );
+ assertUserNotPresent( "username1", "user1", "user1@something.com" );
+ assertUserNotPresent( "username2", "user2", "user2@something.com" );
+ assertUserPresent( "username3", "user3", "user3@something.com" );
+ assertUserNotPresent( "username4", "user4", "user4@something.com" );
+
+ showMembers( GRP_NAME_THREE, GRP_ID_THREE, GRP_DESCRIPTION_THREE );
+ assertUserNotPresent( "username1", "user1", "user1@something.com" );
+ assertUserNotPresent( "username2", "user2", "user2@something.com" );
+ assertUserNotPresent( "username3", "user3", "user3@something.com" );
+ assertUserPresent( "username4", "user4", "user4@something.com" );
+
+ removeProjectGroup( GRP_NAME_ONE );
+ assertLinkNotPresent( GRP_NAME_ONE );
+ removeProjectGroup( GRP_NAME_TWO );
+ assertLinkNotPresent( GRP_NAME_TWO );
+ removeProjectGroup( GRP_NAME_THREE );
+ assertLinkNotPresent( GRP_NAME_THREE );
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/PurgeTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/PurgeTest.java
index 16354b2..26b785e 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/PurgeTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/PurgeTest.java
@@ -32,16 +32,16 @@
{
public void testAddRepositoryPurge()
{
- String PURGE_REPOSITORY_DESCRIPTION = p.getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
- String PURGE_REPOSITORY_DAYS = p.getProperty( "PURGE_REPOSITORY_DAYS" );
- String PURGE_REPOSITORY_RETETION = p.getProperty( "PURGE_REPOSITORY_RETETION" );
+ String PURGE_REPOSITORY_DESCRIPTION = getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
+ String PURGE_REPOSITORY_DAYS = getProperty( "PURGE_REPOSITORY_DAYS" );
+ String PURGE_REPOSITORY_RETETION = getProperty( "PURGE_REPOSITORY_RETETION" );
goToAddRepositoryPurge();
addEditRepositoryPurge( PURGE_REPOSITORY_DAYS, PURGE_REPOSITORY_RETETION, PURGE_REPOSITORY_DESCRIPTION, true );
}
public void testAddInvalidRepositoryPurge()
{
- String PURGE_REPOSITORY_DESCRIPTION = p.getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
+ String PURGE_REPOSITORY_DESCRIPTION = getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
goToAddRepositoryPurge();
addEditRepositoryPurge( "", "", PURGE_REPOSITORY_DESCRIPTION, false );
assertTextPresent( "Retention Count must be greater than 0." );
@@ -50,9 +50,9 @@
@Test( dependsOnMethods = { "testAddRepositoryPurge" } )
public void testEditRepositoryPurge()
{
- String PURGE_REPOSITORY_DESCRIPTION = p.getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
- String PURGE_REPOSITORY_DAYS = p.getProperty( "PURGE_REPOSITORY_DAYS" );
- String PURGE_REPOSITORY_RETETION = p.getProperty( "PURGE_REPOSITORY_RETETION" );
+ String PURGE_REPOSITORY_DESCRIPTION = getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
+ String PURGE_REPOSITORY_DAYS = getProperty( "PURGE_REPOSITORY_DAYS" );
+ String PURGE_REPOSITORY_RETETION = getProperty( "PURGE_REPOSITORY_RETETION" );
String newDescription = "new_description";
String newDays = "45";
String newRetention = "4";
@@ -65,22 +65,22 @@
@Test( dependsOnMethods = { "testEditRepositoryPurge" } )
public void testDeleteRepositoryPurge()
{
- String PURGE_REPOSITORY_DESCRIPTION = p.getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
+ String PURGE_REPOSITORY_DESCRIPTION = getProperty( "PURGE_REPOSITORY_DESCRIPTION" );
removeRepositoryPurge( PURGE_REPOSITORY_DESCRIPTION );
}
public void testAddDirectoryPurge()
{
- String PURGE_DIRECTORY_DESCRIPTION = p.getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
- String PURGE_DIRECTORY_DAYS = p.getProperty( "PURGE_DIRECTORY_DAYS" );
- String PURGE_DIRECTORY_RETETION = p.getProperty( "PURGE_DIRECTORY_RETETION" );
+ String PURGE_DIRECTORY_DESCRIPTION = getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
+ String PURGE_DIRECTORY_DAYS = getProperty( "PURGE_DIRECTORY_DAYS" );
+ String PURGE_DIRECTORY_RETETION = getProperty( "PURGE_DIRECTORY_RETETION" );
goToAddDirectoryPurge();
addEditDirectoryPurge( PURGE_DIRECTORY_DAYS, PURGE_DIRECTORY_RETETION, PURGE_DIRECTORY_DESCRIPTION, true );
}
public void testAddInvalidDirectoryPurge()
{
- String PURGE_DIRECTORY_DESCRIPTION = p.getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
+ String PURGE_DIRECTORY_DESCRIPTION = getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
goToAddDirectoryPurge();
addEditDirectoryPurge( "", "", PURGE_DIRECTORY_DESCRIPTION, false );
assertTextPresent( "Retention Count must be greater than 0." );
@@ -89,9 +89,9 @@
@Test( dependsOnMethods = { "testAddDirectoryPurge" } )
public void testEditDirectoryPurge()
{
- String PURGE_DIRECTORY_DESCRIPTION = p.getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
- String PURGE_DIRECTORY_DAYS = p.getProperty( "PURGE_DIRECTORY_DAYS" );
- String PURGE_DIRECTORY_RETETION = p.getProperty( "PURGE_DIRECTORY_RETETION" );
+ String PURGE_DIRECTORY_DESCRIPTION = getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
+ String PURGE_DIRECTORY_DAYS = getProperty( "PURGE_DIRECTORY_DAYS" );
+ String PURGE_DIRECTORY_RETETION = getProperty( "PURGE_DIRECTORY_RETETION" );
String newDescription = "new_description";
String newDays = "45";
String newRetention = "4";
@@ -104,7 +104,7 @@
@Test( dependsOnMethods = { "testEditDirectoryPurge" } )
public void testDeleteDirectoryPurge()
{
- String PURGE_DIRECTORY_DESCRIPTION = p.getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
+ String PURGE_DIRECTORY_DESCRIPTION = getProperty( "PURGE_DIRECTORY_DESCRIPTION" );
removeDirectoryPurge( PURGE_DIRECTORY_DESCRIPTION );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
index edd12a6..7ffba61 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
@@ -21,11 +21,15 @@
import org.apache.continuum.web.test.parent.AbstractBuildQueueTest;
import org.testng.annotations.Test;
+import org.apache.continuum.web.test.ScheduleTest;
+
/**
* @author José Morales Martínez
* @version $Id$
*/
+
+
@Test( groups = { "queue" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
public class QueueTest
extends AbstractBuildQueueTest
@@ -34,11 +38,55 @@
public void testAddBuildQueue()
{
setMaxBuildQueue( 2 );
- String BUILD_QUEUE_NAME = p.getProperty( "BUILD_QUEUE_NAME" );
+ String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
addBuildQueue( BUILD_QUEUE_NAME, true );
}
- @Test( dependsOnMethods = { "testAddBuildQueue" } )
+ @Test( dependsOnMethods = { "testAddBuildQueue" } ) //"testDeleteBuildQueue" } )
+ public void testQueuePageWithoutBuild()
+ {
+ clickAndWait( "link=Queues" );
+ assertPage( "Continuum - Build Queue" );
+ assertTextPresent( "Nothing is building" );
+ assertTextNotPresent( "Project Name* Build Definition" );
+ assertTextPresent( "Current Build" );
+ assertTextPresent( "Build Queue" );
+ assertTextPresent( "Current Checkout" );
+ assertTextPresent( "Checkout Queue " );
+ assertTextPresent( "Current Prepare Build" );
+ assertTextPresent( "Prepare Build Queue" );
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildQueue", "testAddSchedule" } )
+ public void testAddBuildQueueToSchedule()
+ {
+ ScheduleTest sched = new ScheduleTest();
+
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+ String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+ String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
+
+ String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
+
+
+ sched.goToEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
+ SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
+ SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD );
+ getSelenium().addSelection("saveSchedule_availableBuildQueuesIds", "label="+BUILD_QUEUE_NAME);
+ getSelenium().click("//input[@value='->']");
+ submit();
+
+ }
+
+ @Test( dependsOnMethods = { "testAddBuildQueue" } )
public void testAddNotAllowedBuildQueue()
{
setMaxBuildQueue( 1 );
@@ -51,11 +99,12 @@
public void testAddAlreadyExistBuildQueue()
{
setMaxBuildQueue( 3 );
- String BUILD_QUEUE_NAME = p.getProperty( "BUILD_QUEUE_NAME" );
+ String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
addBuildQueue( BUILD_QUEUE_NAME, false );
assertTextPresent( "Build queue name already exists." );
}
+ @Test( dependsOnMethods = { "testAddAlreadyExistBuildQueue" } )
public void testAddEmptyBuildQueue()
{
setMaxBuildQueue( 3 );
@@ -63,22 +112,69 @@
assertTextPresent( "You must define a name" );
}
- @Test( dependsOnMethods = { "testAddBuildQueue", "testAddAlreadyExistBuildQueue" } )
+ @Test( dependsOnMethods = { "testAddBuildQueueToSchedule" } )
public void testDeleteBuildQueue()
{
goToBuildQueuePage();
- String BUILD_QUEUE_NAME = p.getProperty( "BUILD_QUEUE_NAME" );
+ String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
removeBuildQueue( BUILD_QUEUE_NAME );
+ assertTextNotPresent( BUILD_QUEUE_NAME );
}
- public void testQueuePage()
+ @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
+ public void testQueuePageWithProjectCurrentlyBuilding()
+ throws Exception
{
- clickLinkWithText( "Queues" );
+ //build a project
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+ buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME );
+ String location = getSelenium().getLocation();
+
+ //check queue page while building
+ getSelenium().open( "/continuum/admin/displayQueues!display.action" );
assertPage( "Continuum - Build Queue" );
assertTextPresent( "Current Build" );
- assertTextPresent( "Continuum - Build Queue" );
+ assertTextPresent( "Build Queue" );
assertTextPresent( "Current Checkout" );
- assertTextPresent( "Checkout Queue" );
- assertButtonWithValuePresent( "Cancel Entries" );
+ assertTextPresent( "Checkout Queue " );
+ assertTextPresent( "Current Prepare Build" );
+ assertTextPresent( "Prepare Build Queue" );
+ assertElementPresent("//table[@id='ec_table']/tbody/tr/td[4]");
+ assertTextPresent( M2_PROJ_GRP_NAME );
+ getSelenium().open( location );
+ waitPage();
+ waitForElementPresent( "//img[@alt='Success']" );
}
-}
+
+ @Test( dependsOnMethods = { "testQueuePageWithProjectCurrentlyBuilding", "testAddBuildAgent" } )
+ public void testQueuePageWithProjectCurrentlyBuildingInDistributedBuilds()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+ String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
+
+ try
+ {
+ enableDistributedBuilds();
+ buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME );
+
+ //check queue page while building
+ getSelenium().open( "/continuum/admin/displayQueues!display.action" );
+ assertPage( "Continuum - View Distributed Builds" );
+ assertTextPresent( "Current Build" );
+ assertTextPresent( "Build Queue" );
+ assertTextPresent( "Current Prepare Build" );
+ assertTextPresent( "Prepare Build Queue" );
+ assertTextPresent( M2_PROJ_GRP_NAME );
+ assertTextPresent( "Build Agent URL" );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ }
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
new file mode 100644
index 0000000..c58959a
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
@@ -0,0 +1,332 @@
+package org.apache.continuum.web.test;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import org.apache.continuum.web.test.parent.AbstractReleaseTest;
+import org.testng.annotations.Test;
+
+@Test( groups = { "release" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
+public class ReleaseTest
+ extends AbstractReleaseTest
+{
+ @Test( dependsOnMethods = { "testProjectGroupAllBuildSuccessWithDistributedBuilds" } )
+ public void testReleasePrepareProjectWithInvalidUsernamePasswordInDistributedBuilds()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+
+ String M2_PROJ_USERNAME = "invalid";
+ String M2_PROJ_PASSWORD = "invalid";
+ String M2_PROJ_TAGBASE = getProperty( "M2_DELETE_PROJ_TAGBASE" );
+ String M2_PROJ_TAG = getProperty( "M2_DELETE_PROJ_TAG" );
+ String M2_PROJ_RELEASE_VERSION = getProperty( "M2_DELETE_PROJ_RELEASE_VERSION" );
+ String M2_PROJ_DEVELOPMENT_VERSION = getProperty( "M2_DELETE_PROJ_DEVELOPMENT_VERSION" );
+
+ init();
+
+ try
+ {
+ enableDistributedBuilds();
+
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ createBuildEnvAndBuildagentGroup();
+
+ showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePrepareProject( M2_PROJ_USERNAME, M2_PROJ_PASSWORD, M2_PROJ_TAGBASE, M2_PROJ_TAG,
+ M2_PROJ_RELEASE_VERSION, M2_PROJ_DEVELOPMENT_VERSION, M2_PROJECT_BUILD_ENV, false );
+ assertPreparedReleasesFileCreated();
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ /*
+ * Test release prepare with no build agent configured in the selected build environment.
+ */
+ @Test( dependsOnMethods = { "testReleasePrepareProjectWithInvalidUsernamePasswordInDistributedBuilds" } )
+ public void testReleasePrepareProjectWithNoBuildagentInBuildEnvironment()
+ throws Exception
+ {
+ String M2_PROJECT_POM_URL = getProperty( "M2_RELEASE_POM_URL" );
+ String M2_PROJECT_NAME = getProperty( "M2_RELEASE_PROJECT_NAME" );
+ String M2_PROJECT_GROUP_NAME = getProperty( "M2_RELEASE_GRP_NAME" );
+ String M2_PROJECT_GROUP_ID = getProperty( "M2_RELEASE_GRP_ID" );
+ String M2_PROJECT_DESCRIPTION = getProperty( "M2_RELEASE_GRP_DESCRIPTION" );
+ String M2_PROJECT_TAGBASE = getProperty( "M2_RELEASE_TAGBASE_URL" );
+ String M2_PROJECT_TAG = getProperty( "M2_RELEASE_TAG" );
+ String M2_PROJECT_RELEASE_VERSION = getProperty( "M2_RELEASE_RELEASE_VERSION" );
+ String M2_PROJECT_DEVELOPMENT_VERSION = getProperty( "M2_RELEASE_DEVELOPMENT_VERSION" );
+ String ERROR_TEXT = getProperty( "M2_RELEASE_NO_AGENT_MESSAGE" );
+
+ addProjectGroup( M2_PROJECT_GROUP_NAME, M2_PROJECT_GROUP_ID, M2_PROJECT_DESCRIPTION, true );
+ addMavenTwoProject( M2_PROJECT_POM_URL, "", "", M2_PROJECT_GROUP_NAME, true );
+
+ init();
+
+ try
+ {
+ enableDistributedBuilds();
+
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ createBuildEnvAndBuildagentGroup();
+ detachBuildagentFromGroup();
+
+ buildProjectGroup( M2_PROJECT_GROUP_NAME, M2_PROJECT_GROUP_ID, M2_PROJECT_DESCRIPTION, M2_PROJECT_NAME );
+
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePrepareProject( "", "", M2_PROJECT_TAGBASE, M2_PROJECT_TAG, M2_PROJECT_RELEASE_VERSION,
+ M2_PROJECT_DEVELOPMENT_VERSION, M2_PROJECT_BUILD_ENV );
+
+ assertTextPresent( "Release Error" );
+ assertTextPresent( ERROR_TEXT );
+ }
+ finally
+ {
+ attachBuildagentInGroup();
+ disableDistributedBuilds();
+ }
+ }
+
+ /*
+ * Test release prepare with no build agent group in the selected build environment.
+ */
+ @Test( dependsOnMethods = { "testReleasePrepareProjectWithNoBuildagentInBuildEnvironment" } )
+ public void testReleasePrepareProjectWithNoBuildagentGroupInBuildEnvironment()
+ throws Exception
+ {
+ String M2_PROJECT_NAME = getProperty( "M2_RELEASE_PROJECT_NAME" );
+ String M2_PROJECT_GROUP_NAME = getProperty( "M2_RELEASE_GRP_NAME" );
+ String M2_PROJECT_GROUP_ID = getProperty( "M2_RELEASE_GRP_ID" );
+ String M2_PROJECT_DESCRIPTION = getProperty( "M2_RELEASE_GRP_DESCRIPTION" );
+ String M2_PROJECT_TAGBASE = getProperty( "M2_RELEASE_TAGBASE_URL" );
+ String M2_PROJECT_TAG = getProperty( "M2_RELEASE_TAG" );
+ String M2_PROJECT_RELEASE_VERSION = getProperty( "M2_RELEASE_RELEASE_VERSION" );
+ String M2_PROJECT_DEVELOPMENT_VERSION = getProperty( "M2_RELEASE_DEVELOPMENT_VERSION" );
+ String ERROR_TEXT = getProperty( "M2_RELEASE_NO_AGENT_MESSAGE" );
+
+ init();
+
+ try
+ {
+ enableDistributedBuilds();
+
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ createBuildEnvAndBuildagentGroup();
+ removeBuildagentGroupFromBuildEnv();
+
+ showProjectGroup( M2_PROJECT_GROUP_NAME, M2_PROJECT_GROUP_ID, M2_PROJECT_GROUP_ID );
+
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePrepareProject( "", "", M2_PROJECT_TAGBASE, M2_PROJECT_TAG, M2_PROJECT_RELEASE_VERSION,
+ M2_PROJECT_DEVELOPMENT_VERSION, M2_PROJECT_BUILD_ENV );
+
+ assertTextPresent( "Release Error" );
+ assertTextPresent( ERROR_TEXT );
+ }
+ finally
+ {
+ attachBuildagentGroupToBuildEnv();
+ disableDistributedBuilds();
+ }
+ }
+
+ /*
+ * Test release prepare with no build environment selected.
+ */
+ @Test( dependsOnMethods = { "testReleasePrepareProjectWithNoBuildagentGroupInBuildEnvironment" } )
+ public void testReleasePrepareProjectWithNoBuildEnvironment()
+ throws Exception
+ {
+ String M2_PROJECT_NAME = getProperty( "M2_RELEASE_PROJECT_NAME" );
+ String M2_PROJECT_GROUP_NAME = getProperty( "M2_RELEASE_GRP_NAME" );
+ String M2_PROJECT_GROUP_ID = getProperty( "M2_RELEASE_GRP_ID" );
+ String M2_PROJECT_DESCRIPTION = getProperty( "M2_RELEASE_GRP_DESCRIPTION" );
+ String M2_PROJECT_TAGBASE = getProperty( "M2_RELEASE_TAGBASE_URL" );
+ String M2_PROJECT_TAG = getProperty( "M2_RELEASE_TAG" );
+ String M2_PROJECT_RELEASE_VERSION = getProperty( "M2_RELEASE_RELEASE_VERSION" );
+ String M2_PROJECT_DEVELOPMENT_VERSION = getProperty( "M2_RELEASE_DEVELOPMENT_VERSION" );
+ String ERROR_TEXT = getProperty( "M2_RELEASE_NO_AGENT_MESSAGE" );
+
+ init();
+
+ try
+ {
+ enableDistributedBuilds();
+
+ showProjectGroup( M2_PROJECT_GROUP_NAME, M2_PROJECT_GROUP_ID, M2_PROJECT_GROUP_ID );
+
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePrepareProject( "", "", M2_PROJECT_TAGBASE, M2_PROJECT_TAG, M2_PROJECT_RELEASE_VERSION,
+ M2_PROJECT_DEVELOPMENT_VERSION, "" );
+
+ assertTextPresent( "Release Error" );
+ assertTextPresent( ERROR_TEXT );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ @Test( dependsOnMethods = { "testReleasePrepareProjectWithNoBuildEnvironment" } )
+ public void testReleasePerformUsingProvideParamtersWithDistributedBuilds()
+ throws Exception
+ {
+ String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+ String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+
+ String M2_PROJ_USERNAME = "invalid";
+ String M2_PROJ_PASSWORD = "invalid";
+ String M2_PROJ_TAGBASE = getProperty( "M2_DELETE_PROJ_TAGBASE_PERFORM" );
+ String M2_PROJ_TAG = getProperty( "M2_DELETE_PROJ_TAG" );
+ String M2_PROJ_SCM_URL = getProperty( "M2_DELETE_PROJ_GRP_SCM_ROOT_URL" );
+
+ init();
+
+ try
+ {
+ enableDistributedBuilds();
+
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ createBuildEnvAndBuildagentGroup();
+
+ showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePerformProjectWithProvideParameters( M2_PROJ_USERNAME, M2_PROJ_PASSWORD, M2_PROJ_TAGBASE, M2_PROJ_TAG,
+ M2_PROJ_SCM_URL, M2_PROJECT_BUILD_ENV, false );
+ assertPreparedReleasesFileCreated();
+
+ removeProjectGroup( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ }
+ finally
+ {
+ disableDistributedBuilds();
+ }
+ }
+
+ private void init()
+ {
+ File file = new File( "target/conf/prepared-releases.xml" );
+
+ if ( file.exists() )
+ {
+ file.delete();
+ }
+ }
+
+ private void createBuildEnvAndBuildagentGroup()
+ throws Exception
+ {
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ String M2_PROJECT_AGENT_GROUP = getProperty( "M2_RELEASE_AGENT_GROUP" );
+
+ // add build agent group no agents
+ goToBuildAgentPage();
+ if ( !isTextPresent( M2_PROJECT_AGENT_GROUP ) )
+ {
+ clickAndWait( "//input[@id='editBuildAgentGroup_0']" );
+ setFieldValue( "saveBuildAgentGroup_buildAgentGroup_name", M2_PROJECT_AGENT_GROUP );
+ clickButtonWithValue( "Save" );
+ }
+
+ // add build environment with build agent group
+ clickLinkWithText( "Build Environments" );
+ if ( !isTextPresent( M2_PROJECT_BUILD_ENV ) )
+ {
+ clickAndWait( "//input[@id='addBuildEnv_0']" );
+ setFieldValue( "saveBuildEnv_profile_name", M2_PROJECT_BUILD_ENV );
+ clickButtonWithValue( "Save" );
+ attachBuildagentGroupToBuildEnv();
+ }
+
+ // attach build agent in build agent group created
+ attachBuildagentInGroup();
+ }
+
+ private void attachBuildagentGroupToBuildEnv()
+ {
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+ String M2_PROJECT_AGENT_GROUP = getProperty( "M2_RELEASE_AGENT_GROUP" );
+
+ clickLinkWithText( "Build Environments" );
+ String xPath = "//preceding::td[text()='" + M2_PROJECT_BUILD_ENV + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+ selectValue( "profile.buildAgentGroup", M2_PROJECT_AGENT_GROUP );
+ clickButtonWithValue( "Save" );
+ }
+
+ private void removeBuildagentGroupFromBuildEnv()
+ {
+ String M2_PROJECT_BUILD_ENV = getProperty( "M2_RELEASE_BUILD_ENV" );
+
+ clickLinkWithText( "Build Environments" );
+ String xPath = "//preceding::td[text()='" + M2_PROJECT_BUILD_ENV + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+ selectValue( "profile.buildAgentGroup", "" );
+ clickButtonWithValue( "Save" );
+ }
+
+ private void attachBuildagentInGroup()
+ throws Exception
+ {
+ String M2_PROJECT_AGENT_GROUP = getProperty( "M2_RELEASE_AGENT_GROUP" );
+ String buildAgent = getProperty( "BUILD_AGENT_NAME2" );
+
+ clickLinkWithText( "Build Agents" );
+ String xPath = "//preceding::td[text()='" + M2_PROJECT_AGENT_GROUP + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+
+ if ( isElementPresent( "xpath=//select[@id='saveBuildAgentGroup_buildAgentIds']/option[@value='" + buildAgent + "']" ) )
+ {
+ selectValue( "buildAgentIds", buildAgent );
+ clickLinkWithXPath( "//input[@value='->']", false );
+ submit();
+ }
+ }
+
+ private void detachBuildagentFromGroup()
+ throws Exception
+ {
+ String M2_PROJECT_AGENT_GROUP = getProperty( "M2_RELEASE_AGENT_GROUP" );
+ String buildAgent = getProperty( "BUILD_AGENT_NAME2" );
+
+ clickLinkWithText( "Build Agents" );
+ String xPath = "//preceding::td[text()='" + M2_PROJECT_AGENT_GROUP + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+
+ if ( isElementPresent( "xpath=//select[@id='saveBuildAgentGroup_selectedBuildAgentIds']/option[@value='" + buildAgent + "']" ) )
+ {
+ selectValue( "selectedBuildAgentIds", buildAgent );
+ clickLinkWithXPath( "//input[@value='<-']", false );
+ submit();
+ }
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
index 6453f9b..d42f38f 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
@@ -30,29 +30,50 @@
public class ScheduleTest
extends AbstractScheduleTest
{
- public void testAddSchedule()
+ public void testAddScheduleNoBuildQueueToBeUsed()
{
- String SCHEDULE_NAME = p.getProperty( "SCHEDULE_NAME" );
- String SCHEDULE_DESCRIPTION = p.getProperty( "SCHEDULE_DESCRIPTION" );
- String SCHEDULE_EXPR_SECOND = p.getProperty( "SCHEDULE_EXPR_SECOND" );
- String SCHEDULE_EXPR_MINUTE = p.getProperty( "SCHEDULE_EXPR_MINUTE" );
- String SCHEDULE_EXPR_HOUR = p.getProperty( "SCHEDULE_EXPR_HOUR" );
- String SCHEDULE_EXPR_DAY_MONTH = p.getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
- String SCHEDULE_EXPR_MONTH = p.getProperty( "SCHEDULE_EXPR_MONTH" );
- String SCHEDULE_EXPR_DAY_WEEK = p.getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
- String SCHEDULE_EXPR_YEAR = p.getProperty( "SCHEDULE_EXPR_YEAR" );
- String SCHEDULE_MAX_TIME = p.getProperty( "SCHEDULE_MAX_TIME" );
- String SCHEDULE_PERIOD = p.getProperty( "SCHEDULE_PERIOD" );
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+ String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+ String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
goToAddSchedule();
addEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
- SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true );
+ SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, false, false );
+ assertTextPresent( "Used Build Queues cannot be empty" );
+ }
+
+ @Test( dependsOnMethods = { "testAddScheduleNoBuildQueueToBeUsed" } )
+ public void testAddSchedule()
+ {
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+ String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+ String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
+ goToAddSchedule();
+ addEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
+ SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
+ SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true, true );
}
public void testAddInvalidSchedule()
{
goToAddSchedule();
- addEditSchedule( "", "", "", "", "", "", "", "", "", "", "", false );
+ addEditSchedule( "", "", "", "", "", "", "", "", "", "", "", true, false );
assertTextPresent( "Invalid cron expression value(s)" );
assertTextPresent( "Name is required and cannot contain spaces only" );
assertTextPresent( "Description is required and cannot contain spaces only" );
@@ -61,38 +82,38 @@
@Test( dependsOnMethods = { "testAddSchedule" } )
public void testAddDuplicatedSchedule()
{
- String SCHEDULE_NAME = p.getProperty( "SCHEDULE_NAME" );
- String SCHEDULE_DESCRIPTION = p.getProperty( "SCHEDULE_DESCRIPTION" );
- String SCHEDULE_EXPR_SECOND = p.getProperty( "SCHEDULE_EXPR_SECOND" );
- String SCHEDULE_EXPR_MINUTE = p.getProperty( "SCHEDULE_EXPR_MINUTE" );
- String SCHEDULE_EXPR_HOUR = p.getProperty( "SCHEDULE_EXPR_HOUR" );
- String SCHEDULE_EXPR_DAY_MONTH = p.getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
- String SCHEDULE_EXPR_MONTH = p.getProperty( "SCHEDULE_EXPR_MONTH" );
- String SCHEDULE_EXPR_DAY_WEEK = p.getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
- String SCHEDULE_EXPR_YEAR = p.getProperty( "SCHEDULE_EXPR_YEAR" );
- String SCHEDULE_MAX_TIME = p.getProperty( "SCHEDULE_MAX_TIME" );
- String SCHEDULE_PERIOD = p.getProperty( "SCHEDULE_PERIOD" );
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+ String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+ String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
goToAddSchedule();
addEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
- SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, false );
+ SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true, false );
assertTextPresent( "A Schedule with the same name already exists" );
}
@Test( dependsOnMethods = { "testAddDuplicatedSchedule" } )
public void testEditSchedule()
{
- String SCHEDULE_NAME = p.getProperty( "SCHEDULE_NAME" );
- String SCHEDULE_DESCRIPTION = p.getProperty( "SCHEDULE_DESCRIPTION" );
- String SCHEDULE_EXPR_SECOND = p.getProperty( "SCHEDULE_EXPR_SECOND" );
- String SCHEDULE_EXPR_MINUTE = p.getProperty( "SCHEDULE_EXPR_MINUTE" );
- String SCHEDULE_EXPR_HOUR = p.getProperty( "SCHEDULE_EXPR_HOUR" );
- String SCHEDULE_EXPR_DAY_MONTH = p.getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
- String SCHEDULE_EXPR_MONTH = p.getProperty( "SCHEDULE_EXPR_MONTH" );
- String SCHEDULE_EXPR_DAY_WEEK = p.getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
- String SCHEDULE_EXPR_YEAR = p.getProperty( "SCHEDULE_EXPR_YEAR" );
- String SCHEDULE_MAX_TIME = p.getProperty( "SCHEDULE_MAX_TIME" );
- String SCHEDULE_PERIOD = p.getProperty( "SCHEDULE_PERIOD" );
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
+ String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
+ String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
String name = "new_name";
String description = "new_description";
String second = "1";
@@ -107,17 +128,17 @@
goToEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD );
- addEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek, year, maxTime, period, true );
+ addEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek, year, maxTime, period, false, true );
goToEditSchedule( name, description, second, minute, hour, dayMonth, month, dayWeek, year, maxTime, period );
addEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH, SCHEDULE_EXPR_DAY_WEEK,
- SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true );
+ SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, false, true );
}
@Test( dependsOnMethods = { "testEditSchedule" } )
public void testDeleteSchedule()
{
- String SCHEDULE_NAME = p.getProperty( "SCHEDULE_NAME" );
+ String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
removeSchedule( SCHEDULE_NAME );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
new file mode 100644
index 0000000..8c1f602
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SetupSelenium.java
@@ -0,0 +1,111 @@
+package org.apache.continuum.web.test;
+
+/*
+ * 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.
+ */
+
+import org.apache.continuum.web.test.parent.AbstractContinuumTest;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Optional;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+/**
+ * Based on SetupSelenium of Wendy Smoak test.
+ *
+ * @author José Morales Martínez
+ * @version $Id$
+ */
+@Test( groups = { "setup" }, alwaysRun = true )
+public class SetupSelenium
+ extends AbstractContinuumTest
+{
+ @Override
+ @AfterTest
+ public void close()
+ throws Exception
+ {
+ super.close();
+ }
+
+ @Override
+ @BeforeSuite
+ public void open()
+ throws Exception
+ {
+ super.open();
+ }
+
+ @BeforeTest
+ @Parameters( { "baseUrl", "browser", "seleniumHost", "seleniumPort" } )
+ public void initializeContinuum( String baseUrl, String browser, @Optional( "localhost" ) String seleniumHost,
+ @Optional( "4444" ) int seleniumPort )
+ throws Exception
+ {
+ super.open( baseUrl, browser, seleniumHost, seleniumPort );
+ Assert.assertNotNull( getSelenium(), "Selenium is not initialized" );
+ getSelenium().open( baseUrl );
+ String title = getSelenium().getTitle();
+ if ( title.equals( "Create Admin User" ) )
+ {
+ assertCreateAdmin();
+ String fullname = getProperty( "ADMIN_FULLNAME" );
+ String username = getProperty( "ADMIN_USERNAME" );
+ String mail = getProperty( "ADMIN_MAIL" );
+ String password = getProperty( "ADMIN_PASSWORD" );
+ submitAdminData( fullname, mail, password );
+ assertAutenticatedPage( username );
+ assertEditConfigurationPage();
+ postAdminUserCreation();
+ disableDefaultSchedule();
+ clickLinkWithText( "Logout" );
+ }
+ }
+
+ private void postAdminUserCreation()
+ {
+ if ( getTitle().endsWith( "Continuum - Configuration" ) )
+ {
+ String workingDir = getFieldValue( "configuration_workingDirectory" );
+ String buildOutputDir = getFieldValue( "configuration_buildOutputDirectory" );
+ String releaseOutputDir = getFieldValue( "configuration_releaseOutputDirectory" );
+ String locationDir = "target/data";
+ String data = "data";
+ setFieldValue( "workingDirectory", workingDir.replaceFirst( data, locationDir ) );
+ setFieldValue( "buildOutputDirectory", buildOutputDir.replaceFirst( data, locationDir ) );
+ setFieldValue( "releaseOutputDirectory", releaseOutputDir.replaceFirst( data, locationDir ) );
+ setFieldValue( "baseUrl", baseUrl );
+ submit();
+ }
+ }
+
+ private void disableDefaultSchedule()
+ {
+ clickLinkWithText( "Schedules" );
+ String xPath = "//preceding::td[text()='DEFAULT_SCHEDULE']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+ if ( isChecked( "saveSchedule_active" ) )
+ {
+ uncheckField( "saveSchedule_active" );
+ }
+ clickButtonWithValue( "Save" );
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
index fcd3958..e6e4af6 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
@@ -24,7 +24,7 @@
/**
* Based on AddShellProjectTestCase of Emmanuel Venisse.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -35,19 +35,19 @@
public void testAddShellProject()
throws Exception
{
- String SHELL_NAME = p.getProperty( "SHELL_NAME" );
- String SHELL_DESCRIPTION = p.getProperty( "SHELL_DESCRIPTION" );
- String SHELL_VERSION = p.getProperty( "SHELL_VERSION" );
- String SHELL_TAG = p.getProperty( "SHELL_TAG" );
- String SHELL_SCM_URL = p.getProperty( "SHELL_SCM_URL" );
- String SHELL_SCM_USERNAME = p.getProperty( "SHELL_SCM_USERNAME" );
- String SHELL_SCM_PASSWORD = p.getProperty( "SHELL_SCM_PASSWORD" );
- String DEFAULT_PROJ_GRP_NAME = p.getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String DEFAULT_PROJ_GRP_ID = p.getProperty( "DEFAULT_PROJ_GRP_ID" );
- String DEFAULT_PROJ_GRP_DESCRIPTION = p.getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" );
+ String SHELL_NAME = getProperty( "SHELL_NAME" );
+ String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION" );
+ String SHELL_VERSION = getProperty( "SHELL_VERSION" );
+ String SHELL_TAG = getProperty( "SHELL_TAG" );
+ String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL" );
+ String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME" );
+ String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" );
+ String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+ String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_ID" );
+ String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" );
goToAddShellProjectPage();
addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
- SHELL_SCM_PASSWORD, SHELL_TAG, false, DEFAULT_PROJ_GRP_NAME, null, true );
+ SHELL_SCM_PASSWORD, SHELL_TAG, false, DEFAULT_PROJ_GRP_NAME, null, true, "shell" );
assertProjectGroupSummaryPage( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION );
}
@@ -62,19 +62,19 @@
}
@Test( dependsOnMethods = { "testAddShellProject" } )
- public void testAddDupliedShellProject()
+ public void testAddDuplicateShellProject()
throws Exception
{
- String SHELL_NAME = p.getProperty( "SHELL_NAME" );
- String SHELL_DESCRIPTION = p.getProperty( "SHELL_DESCRIPTION" );
- String SHELL_VERSION = p.getProperty( "SHELL_VERSION" );
- String SHELL_TAG = p.getProperty( "SHELL_TAG" );
- String SHELL_SCM_URL = p.getProperty( "SHELL_SCM_URL" );
- String SHELL_SCM_USERNAME = p.getProperty( "SHELL_SCM_USERNAME" );
- String SHELL_SCM_PASSWORD = p.getProperty( "SHELL_SCM_PASSWORD" );
+ String SHELL_NAME = getProperty( "SHELL_NAME" );
+ String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION" );
+ String SHELL_VERSION = getProperty( "SHELL_VERSION" );
+ String SHELL_TAG = getProperty( "SHELL_TAG" );
+ String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL" );
+ String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME" );
+ String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" );
goToAddShellProjectPage();
addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
- SHELL_SCM_PASSWORD, SHELL_TAG, false, null, null, false );
+ SHELL_SCM_PASSWORD, SHELL_TAG, false, null, null, false, "shell" );
assertTextPresent( "Project name already exist" );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java
new file mode 100644
index 0000000..811e6ed
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java
@@ -0,0 +1,618 @@
+package org.apache.continuum.web.test;
+
+import org.apache.continuum.web.test.parent.AbstractUserRolesManagementTest;
+import org.testng.annotations.Test;
+
+@Test( groups = { "userroles" }, dependsOnMethods = { "testWithCorrectUsernamePassword" }, sequential = true )
+public class UserRolesManagementTest
+ extends AbstractUserRolesManagementTest
+{
+ public void testBasicAddDeleteUser()
+ {
+ username = getProperty( "GUEST_USERNAME" );
+ fullname = getProperty( "GUEST_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ deleteUser( username, fullname, getUserEmail() );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ /*
+ * GUEST USER ROLE
+ * Guest Role could only view the About Page. Project Groups should not be shown when clicking
+ * Show Project Group link.
+ */
+ @Test( dependsOnMethods = { "testBasicAddDeleteUser" } )
+ public void testAddUserWithGuestRole()
+ {
+ username = getProperty( "GUEST_USERNAME" );
+ fullname = getProperty( "GUEST_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ //checkUserRoleWithValue( fullname );
+ clickLinkWithLocator( "addRolesToUser_addNDSelectedRoles", false );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ //assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+ }
+
+ @Test( dependsOnMethods = { "testAddUserWithGuestRole" } )
+ public void testGuestUserRoleFunction()
+ {
+ username = getProperty( "GUEST_USERNAME" );
+ fullname = getProperty( "GUEST_FULLNAME" );
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ goToAboutPage();
+ clickLinkWithText( "Show Project Groups" );
+ assertTextPresent( "Project Groups list is empty" );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+
+ /*
+ * REGISTERED USER ROLE
+ * Registered User Role could only view the About Page. Project Groups should not be shown when clicking
+ * Show Project Group link.
+ */
+ @Test( dependsOnMethods = { "testBasicAddDeleteUser" , "testGuestUserRoleFunction" } )
+ public void testAddUserWithRegisteredUserRole()
+ {
+ username = getProperty( "REGISTERED_USERNAME" );
+ fullname = getProperty( "REGISTERED_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+
+ clickLinkWithText( "Logout" );
+ // assertTextPresent("You are already logged in.");
+ }
+
+ @Test( dependsOnMethods = { "testAddUserWithRegisteredUserRole" } )
+ public void testRegisteredRoleFunction()
+ {
+ username = getProperty( "REGISTERED_USERNAME" );
+ fullname = getProperty( "REGISTERED_FULLNAME" );
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ goToAboutPage();
+ clickLinkWithText( "Show Project Groups" );
+ assertTextPresent( "Project Groups list is empty." );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ /*
+ * SYSTEM ADMINISTRATOR ROLE
+ * Has access to all functions in the application.
+ *
+ * The following tests only asserts elements that could be shown
+ * when system admin user is logged in since the user that is used
+ * to test the other functionalities is a system admin user.
+ */
+ @Test( dependsOnMethods = { "testBasicAddDeleteUser" , "testRegisteredRoleFunction" } )
+ public void testAddUserWithSystemAdminRole()
+ {
+ username = getProperty( "SYSAD_USERNAME" );
+ fullname = getProperty( "SYSAD_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+
+ clickLinkWithText( "Logout" );
+ }
+
+ @Test( dependsOnMethods = { "testAddUserWithSystemAdminRole" } )
+ public void testSystemAdminRoleFunction()
+ {
+ username = getProperty( "SYSAD_USERNAME" );
+ fullname = getProperty( "SYSAD_FULLNAME" );
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Show Project Groups" );
+ assertTextNotPresent( "Project Groups list is empty." );
+ assertLinkPresent( "Default Project Group" );
+
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ /*
+ * USER ADMIN ROLE
+ * User Admin role could only add/edit/delete users and can view user Roles. Cannot view Project Groups
+ * but can assign a User to a project.
+ *
+ */
+ @Test( dependsOnMethods = { "testBasicAddDeleteUser" , "testSystemAdminRoleFunction" } )
+ public void testAddUserWithUserAdminRole()
+ {
+ username = getProperty( "USERADMIN_USERNAME" );
+ fullname = getProperty( "USERADMIN_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+
+ clickLinkWithText( "Logout" );
+ }
+
+ @Test( dependsOnMethods = { "testAddUserWithUserAdminRole" } )
+ public void testUserAdminFunction()
+ {
+ username = getProperty( "USERADMIN_USERNAME" );
+ fullname = getProperty( "USERADMIN_FULLNAME" );
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Show Project Groups" );
+ assertTextPresent( "Project Groups list is empty." );
+ // add user
+ clickLinkWithText( "Users" );
+ clickButtonWithValue( "Create New User" );
+ assertCreateUserPage();
+ setFieldValue( "user.username", "guest0" );
+ setFieldValue( "user.fullName", "guest0" );
+ setFieldValue( "user.email", "guest0@guest0.com" );
+ setFieldValue( "user.password", "pass" );
+ setFieldValue( "user.confirmPassword", "pass" );
+ submit();
+ assertUserRolesPage( );
+ clickButtonWithValue( "Submit" );
+ selectValue( "name=ec_rd", "50" );
+ waitPage();
+ // delete user
+ deleteUser( "guest0", "guest0", "guest0@guest0.com" );
+ // TODO edit user
+
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ /*
+ * CONTINUUM GROUP PROJECT ADMIN
+ * - Can Add/Edit/Delete Project Group, can Add/Edit/Delete projects, can assign Users
+ * roles to existing projects, can add/edit/delete schedules, can view existing roles for the
+ * projects, can build/release projects
+ * - Cannot add users, --- --- ---
+ */
+ @Test( dependsOnMethods = { "testBasicAddDeleteUser" , "testUserAdminFunction" } )
+ public void testAddUserWithContinuumGroupProjectAdminRole()
+ {
+ username = getProperty( "GROUPPROJECTADMIN_USERNAME" );
+ fullname = getProperty( "GROUPPROJECTADMIN_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+
+ // enable distributed build
+ clickLinkWithText( "Configuration" );
+ clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
+ clickButtonWithValue( "Save" );
+
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+
+ assertProjectAdministratorAccess();
+
+ clickLinkWithText( "Logout" );
+
+ login( getAdminUsername(), getAdminPassword() );
+ // disable distributed build
+ clickLinkWithText( "Configuration" );
+ clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
+ clickButtonWithValue( "Save" );
+
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertProjectAdministratorAccess();
+
+ clickLinkWithText( "Logout" );
+ }
+
+ @Test( dependsOnMethods = { "testAddUserWithContinuumGroupProjectAdminRole" } )
+ public void testContinuumGroupProjectAdmin_AddProjectGroup() throws Exception
+ {
+ username = getProperty( "GROUPPROJECTADMIN_USERNAME" );
+ fullname = getProperty( "GROUPPROJECTADMIN_FULLNAME" );
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Show Project Groups" );
+ assertTextNotPresent( "Project Groups list is empty." );
+ // test add project group
+ clickButtonWithValue( "Add Project Group" );
+ setFieldValue( "name", "Test Group" );
+ setFieldValue( "groupId", "Test Group" );
+ setFieldValue( "description", "testing project group" );
+ submit();
+ }
+
+ @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AddProjectGroup" } )
+ public void testContinuumGroupProjectAdmin_AddProjectToProjectGroup() throws Exception
+ {
+ clickLinkWithText( "Test Group" );
+ clickButtonWithValue( "Add" );
+ assertAddMavenTwoProjectPage();
+ setFieldValue( "m2PomUrl", getProperty( "M2_POM_URL" ) );
+ clickButtonWithValue( "Add" );
+ waitAddProject( "Continuum - Project Group" );
+ assertTextPresent( "ContinuumBuildQueueTestData" );
+ waitForProjectCheckout();
+ }
+
+ @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AddProjectToProjectGroup" } )
+ public void testContinuumGroupProjectAdmin_BuildProject() throws Exception
+ {
+ buildProjectGroup( "Test Group", "Test Group", "testing project group", "ContinuumBuildQueueTestData" );
+ }
+
+ @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_BuildProject" } )
+ public void testContinuumGroupProjectAdmin_AssignUserToAGroup()
+ {
+ clickLinkWithText( "Users" );
+ clickLinkWithText( "guest1" );
+ clickLinkWithText( "Edit Roles" );
+ checkUserRoleWithValue( "Guest" );
+ checkResourceRoleWithValue( "Project Developer - Test Group" );
+ submit();
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ /*
+ * Uncomment the lines below to release a Project provided that you add
+ * the values under RELEASE A PROJECT in testng.properties file (project's pom url, access to project to be released.)
+
+ @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AssignUserToAGroup" } )
+ public void testContinuumGroupProjectAdmin_ReleaseProject() throws Exception
+ {
+ String projectUrl = getProperty( "PROJECT_URL_TO_BE_RELEASED" );
+ String projectName = getProperty( "PROJECT_NAME_TO_BE_RELEASED" );
+ String projectUsername = getProperty( "PROJECT_USERNAME" );
+ String projectPassword = getProperty( "PROJECT_USERNAME" );
+ // add a project group
+ clickLinkWithText( "Show Project Groups" );
+ clickButtonWithValue( "Add Project Group" );
+ setFieldValue( "name", "Project Group" );
+ setFieldValue( "groupId", "Project Group" );
+ setFieldValue( "description", "project group for projects to be released" );
+ submit();
+ // add a project to a project group
+ clickLinkWithText( "Project Group" );
+ clickButtonWithValue( "Add" );
+ assertAddMavenTwoProjectPage();
+ setFieldValue( "m2PomUrl", projectUrl );
+ // set username and password here
+ setFieldValue( "scmUsername", projectUsername );
+ setFieldValue( "scmPassword", projectPassword );
+ clickButtonWithValue( "Add" );
+ String title;
+ boolean success = true;
+ if ( success )
+ {
+ title = "Continuum - Project Group";
+ }
+ else
+ {
+ title = "Continuum - Add Maven 2 Project";
+ }
+ waitAddProject( title );
+ // build the project added in the project group
+ buildProjectGroup( "Project Group", "Project Group", "project group for projects to be released", projectName );
+ // release the project
+ clickButtonWithValue( "Release" );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+ */
+
+ @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AssignUserToAGroup" } )
+ public void testUserWithContinuumGroupProjectDeveloperRole()
+ {
+ username = getProperty( "GROUPPROJECTDEVELOPER_USERNAME" );
+ fullname = getProperty( "GROUPPROJECTDEVELOPER_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumGroupProjectDeveloperRole" } )
+ public void testUserWithContinuumGroupProjectUserRole()
+ {
+ username = getProperty( "GROUPPROJECTUSER_USERNAME" );
+ fullname = getProperty( "GROUPPROJECTUSER_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumGroupProjectUserRole" } )
+ public void testUserWithContinuumManageBuildEnvironmentRole()
+ {
+ username = getProperty( "MANAGEBUILDENVIRONMENT_USERNAME" );
+ fullname = getProperty( "MANAGEBUILDENVIRONMENT_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageBuildEnvironmentRole" } )
+ public void testUserWithContinuumManageBuildTemplatesRole()
+ {
+ username = getProperty( "MANAGEBUILDTEMPLATES_USERNAME" );
+ fullname = getProperty( "MANAGEBUILDTEMPLATES_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageBuildTemplatesRole" } )
+ public void testUserWithContinuumManageInstallationsRole()
+ {
+ username = getProperty( "MANAGEINSTALLATIONS_USERNAME" );
+ fullname = getProperty( "MANAGEINSTALLATIONS_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageInstallationsRole" } )
+ public void testUserWithContinuumManageLocalRepoRole()
+ {
+ username = getProperty( "MANAGELOCALREPOS_USERNAME" );
+ fullname = getProperty( "MANAGELOCALREPOS_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageLocalRepoRole" } )
+ public void testUserWithContinuumManagePurgingRole()
+ {
+ username = getProperty( "MANAGEPURGING_USERNAME" );
+ fullname = getProperty( "MANAGEPURGING_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManagePurgingRole" } )
+ public void testUserWithContinuumManageQueuesRole()
+ {
+ username = getProperty( "MANAGEQUEUES_USERNAME" );
+ fullname = getProperty( "MANAGEQUEUES_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageQueuesRole" } )
+ public void testUserWithContinuumManageSchedulingRole()
+ {
+ username = getProperty( "MANAGESCHEDULING_USERNAME" );
+ fullname = getProperty( "MANAGESCHEDULING_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkUserRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithContinuumManageSchedulingRole" } )
+ public void testUserWithProjectAdminDefaultProjectGroup()
+ {
+ username = getProperty( "PROJECTADMINISTRATOR_DEFAULTPROJECTGROUP_USERNAME" );
+ fullname = getProperty( "PROJECTADMINISTRATOR_DEFAULTPROJECTGROUP_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkResourceRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithProjectAdminDefaultProjectGroup" } )
+ public void testUserWithProjectDevDefaultProjectGroup()
+ {
+ username = getProperty( "PROJECTDEVELOPER_DEFAULTPROJECTGROUP_USERNAME" );
+ fullname = getProperty( "PROJECTDEVELOPER_DEFAULTPROJECTGROUP_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkResourceRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+ @Test( dependsOnMethods = { "testUserWithProjectDevDefaultProjectGroup" } )
+ public void testUserWithProjectUserDefaultProjectGroup()
+ {
+ username = getProperty( "PROJECTUSER_DEFAULTPROJECTGROUP_USERNAME" );
+ fullname = getProperty( "PROJECTUSER_DEFAULTPROJECTGROUP_FULLNAME" );
+
+ createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
+ assertCreatedUserInfo( username );
+ checkResourceRoleWithValue( fullname );
+ clickButtonWithValue( "Submit" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRolePassword() );
+ changePassword( getUserRolePassword(), getUserRoleNewPassword() );
+ assertTextPresent( "Password successfully changed" );
+ clickLinkWithText( "Logout" );
+
+ login( username, getUserRoleNewPassword() );
+ assertLeftNavMenuWithRole( fullname );
+ clickLinkWithText( "Logout" );
+ login( getAdminUsername(), getAdminPassword() );
+ }
+
+}
diff --git a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/XPathExpressionUtil.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/XPathExpressionUtil.java
similarity index 99%
rename from continuum-webapp-test/src/test/it/org/apache/continuum/web/test/XPathExpressionUtil.java
rename to continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/XPathExpressionUtil.java
index c821539..d2f3cf3 100644
--- a/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/XPathExpressionUtil.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/XPathExpressionUtil.java
@@ -242,4 +242,4 @@
{
return new String( axis + "==" + "'" + matchedString + "'" );
}
-}
+}
\ No newline at end of file
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
new file mode 100644
index 0000000..c906627
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
@@ -0,0 +1,136 @@
+package org.apache.continuum.web.test.listener;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.regex.Pattern;
+
+import org.apache.continuum.web.test.parent.AbstractSeleniumTest;
+import org.apache.commons.io.FileUtils;
+import org.testng.ITestResult;
+import org.testng.TestListenerAdapter;
+import com.thoughtworks.selenium.Selenium;
+
+public class CaptureScreenShotsListener
+ extends TestListenerAdapter
+{
+ @Override
+ public void onTestSkipped( ITestResult tr )
+ {
+ System.out.println( "Test " + tr.getName() + " -> Skipped" );
+ super.onTestSkipped( tr );
+ }
+
+ @Override
+ public void onTestFailure( ITestResult tr )
+ {
+ captureError( tr );
+ System.out.println( "Test " + tr.getName() + " -> Failed" );
+ super.onTestFailure( tr );
+ }
+
+ @Override
+ public void onTestSuccess( ITestResult tr )
+ {
+ System.out.println( "Test " + tr.getName() + " -> Success" );
+ super.onTestFailure( tr );
+ }
+
+ private void captureError( ITestResult tr )
+ {
+ captureScreenshotAndSource( tr.getTestClass().getName(), tr.getThrowable() );
+ }
+
+ private static void captureScreenshotAndSource( String cName, Throwable throwable )
+ {
+ Selenium selenium = AbstractSeleniumTest.getSelenium();
+ String locator = "link=Show/hide Stack Trace";
+ if ( selenium.isElementPresent( locator ) )
+ {
+ selenium.click( locator );
+ }
+
+ SimpleDateFormat sdf = new SimpleDateFormat( "yyyy.MM.dd-HH_mm_ss" );
+ String time = sdf.format( new Date() );
+ File targetPath = new File( "target", "screenshots" );
+ StackTraceElement stackTrace[] = throwable.getStackTrace();
+ int index = getStackTraceIndexOfCallingClass( cName, stackTrace );
+ String methodName = stackTrace[index].getMethodName();
+ int lNumber = stackTrace[index].getLineNumber();
+ String lineNumber = Integer.toString( lNumber );
+ String className = cName.substring( cName.lastIndexOf( '.' ) + 1 );
+ targetPath.mkdirs();
+ String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time;
+ try
+ {
+ selenium.windowMaximize();
+ File fileName = getFileName( targetPath, fileBaseName, ".png" );
+ selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "" );
+ }
+ catch ( RuntimeException e )
+ {
+ System.out.println( "Error when take screenshot of error: " + e.getMessage() );
+ }
+ try
+ {
+ File fileName = getFileName( targetPath, fileBaseName, ".html" );
+ FileUtils.writeStringToFile( fileName, selenium.getHtmlSource() );
+ }
+ catch ( IOException ioe )
+ {
+ System.out.println( "Error writing HTML of error: " + ioe.getMessage() );
+ }
+ }
+
+ private static File getFileName( File targetPath, String fileBaseName, String ext )
+ {
+ File fileName = new File( targetPath, fileBaseName + ext );
+ int count = 0;
+ while ( fileName.exists() )
+ {
+ count++;
+ fileName = new File( targetPath, fileBaseName + "_" + count + ext );
+ }
+ return fileName;
+ }
+
+ private static int getStackTraceIndexOfCallingClass( String nameOfClass, StackTraceElement stackTrace[] )
+ {
+ boolean match;
+ int i = 0;
+ do
+ {
+ String className = stackTrace[i].getClassName();
+ match = Pattern.matches( nameOfClass, className );
+ i++;
+ }
+ while ( !match );
+ i--;
+ return i;
+ }
+
+ public static void captureScreenshotAndSource( String name )
+ {
+ captureScreenshotAndSource( name, new Exception() );
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
new file mode 100644
index 0000000..bed4a11
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
@@ -0,0 +1,210 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * 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.
+ */
+
+public abstract class AbstractBuildAgentsTest
+ extends AbstractContinuumTest
+{
+ public void goToAddBuildAgent()
+ {
+ goToBuildAgentPage();
+ assertBuildAgentPage();
+ clickAndWait("editBuildAgent_0"); //add button
+ assertAddEditBuildAgentPage();
+ }
+
+ public void assertAddEditBuildAgentPage()
+ {
+ assertPage( "Continuum - Add/Edit Build Agent" );
+ assertTextPresent( "Add/Edit Build Agent" );
+ assertTextPresent( "Build Agent URL*:" );
+ assertTextPresent( "Description:" );
+ assertTextPresent( "Enabled" );
+ assertElementPresent( "saveBuildAgent_buildAgent_url" );
+ assertElementPresent( "saveBuildAgent_buildAgent_description");
+ assertButtonWithValuePresent( "Save" );
+ assertButtonWithValuePresent( "Cancel" );
+ }
+
+ public void removeBuildAgent( String agentName )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'deleteBuildAgent.action') and contains(@href, '" + agentName + "')])//img" );
+ assertPage("Continuum - Delete Build Agent");
+ assertTextPresent( "Delete Build Agent" );
+ assertTextPresent( "Are you sure you want to delete build agent " + agentName + " ?" );
+ assertButtonWithValuePresent( "Delete" );
+ assertButtonWithValuePresent( "Cancel" );
+ clickButtonWithValue( "Delete" );
+ assertBuildAgentPage();
+ }
+
+ public void addBuildAgent( String agentURL, String description, boolean success, boolean enabled, boolean pingOk )
+ {
+ setFieldValue( "saveBuildAgent_buildAgent_url", agentURL );
+ setFieldValue("saveBuildAgent_buildAgent_description", description );
+
+ if ( enabled )
+ {
+ checkField("saveBuildAgent_buildAgent_enabled");
+ }
+
+ submit();
+
+ if ( success )
+ {
+ assertBuildAgentPage();
+ assertElementPresent( "link=" + agentURL );
+ clickLinkWithText( agentURL );
+
+ if ( pingOk )
+ {
+ assertTextPresent( "true" );
+ }
+ else
+ {
+ assertTextPresent( "false" );
+ }
+ }
+ else
+ {
+ assertAddEditBuildAgentPage();
+ }
+ }
+
+ public void goToEditBuildAgent( String name, String description )
+ {
+ goToBuildAgentPage();
+ clickImgWithAlt( "Edit" );
+ assertAddEditBuildAgentPage();
+ assertFieldValue( name, "saveBuildAgent_buildAgent_url" );
+ assertFieldValue( description, "saveBuildAgent_buildAgent_description" );
+ }
+
+ public void addEditBuildAgent( String agentName, String newDesc )
+ {
+ assertFieldValue( agentName, "saveBuildAgent_buildAgent_url" );
+ setFieldValue( "saveBuildAgent_buildAgent_description", newDesc );
+ submit();
+ assertBuildAgentPage();
+ assertTextPresent( newDesc );
+ }
+
+ public void enableDisableBuildAgent( String agentName, boolean enable )
+ {
+ assertFieldValue( agentName, "saveBuildAgent_buildAgent_url" );
+
+ if ( enable )
+ {
+ checkField( "saveBuildAgent_buildAgent_enabled" );
+ }
+ else
+ {
+ uncheckField( "saveBuildAgent_buildAgent_enabled" );
+ }
+ submit();
+ assertBuildAgentPage();
+ assertTextPresent( new Boolean( enable ).toString() );
+ }
+
+ public void goToAddBuildAgentGroup()
+ {
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+
+ goToBuildAgentPage();
+ clickAndWait("editBuildAgentGroup_0"); //add button
+ String[] options =
+ new String[] { "--- Available Build Agents ---", BUILD_AGENT_NAME2, BUILD_AGENT_NAME3 };
+ assertAddEditBuildAgentGroupPage( options, null );
+ }
+
+ public void addEditBuildAgentGroup( String name, String[] addBuildAgents, String[] removeBuildAgents,
+ boolean success ) throws Exception
+ {
+ setFieldValue( "saveBuildAgentGroup_buildAgentGroup_name", name );
+ if ( addBuildAgents != null && addBuildAgents.length > 0 )
+ {
+ for ( String ba : addBuildAgents )
+ {
+ selectValue( "buildAgentIds", ba );
+ clickButtonWithValue( "->", false );
+ }
+ }
+ if ( removeBuildAgents != null && removeBuildAgents.length > 0 )
+ {
+ for ( String ba : removeBuildAgents )
+ {
+ selectValue( "selectedBuildAgentIds", ba );
+ clickButtonWithValue( "<-", false );
+ }
+ }
+ submit();
+ if ( success )
+ {
+ assertBuildAgentPage();
+ }
+ else
+ {
+ assertAddEditBuildAgentGroupPage( null, null );
+ }
+ }
+
+ public void assertAddEditBuildAgentGroupPage( String[] availableBuildAgents, String[] usedBuildAgents )
+ {
+ assertPage( "Continuum - Add/Edit Build Agent Group" );
+ assertTextPresent( "Add/Edit Build Agent Group" );
+ assertTextPresent( "Name*:" );
+ assertTextPresent( "Configure the used Build Agents:" );
+ assertElementPresent( "buildAgentGroup.name" );
+ if ( availableBuildAgents != null && availableBuildAgents.length > 0 )
+ {
+ assertOptionPresent( "buildAgentIds", availableBuildAgents );
+ }
+ if ( usedBuildAgents != null && usedBuildAgents.length > 0 )
+ {
+ assertOptionPresent( "selectedBuildAgentIds", usedBuildAgents );
+ }
+
+ assertButtonWithValuePresent( "Save" );
+ assertButtonWithValuePresent( "Cancel" );
+ }
+
+ public void goToEditBuildAgentGroup( String name, String[] buildAgents )
+ {
+ goToBuildAgentPage();
+ String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+ assertAddEditBuildAgentGroupPage( null, buildAgents );
+ assertFieldValue( name, "buildAgentGroup.name" );
+ }
+
+ public void removeBuildAgentGroup( String name )
+ {
+ goToBuildAgentPage();
+ clickLinkWithXPath( "(//a[contains(@href,'deleteBuildAgentGroup.action') and contains(@href, '" + name + "')])//img" );
+ assertPage("Continuum - Delete Build Agent Group");
+ assertTextPresent( "Delete Build Agent" );
+ assertTextPresent( "Are you sure you want to delete build agent group " + name + " ?" );
+ assertButtonWithValuePresent( "Delete" );
+ assertButtonWithValuePresent( "Cancel" );
+ clickButtonWithValue( "Delete" );
+ assertBuildAgentPage();
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildEnvironmentTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildEnvironmentTest.java
index 3afa049..0f843f5 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildEnvironmentTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildEnvironmentTest.java
@@ -24,7 +24,7 @@
* @version $Id$
*/
public abstract class AbstractBuildEnvironmentTest
- extends AbstractSeleniumTest
+ extends AbstractContinuumTest
{
public void goToBuildEnvironmentPage()
{
@@ -71,6 +71,13 @@
editBuildEnvironment( name, installations, success );
}
+ public void addBuildEnvironmentWithBuildAgentGroup( String name, String[] installations, String buildAgentGroupName, boolean success )
+ {
+ setFieldValue( "profile.name", name );
+ submit();
+ editBuildEnvironmentWithBuildAgentGroup( name, installations, buildAgentGroupName, success );
+ }
+
public void editBuildEnvironment( String name, String[] installations, boolean success )
{
setFieldValue( "profile.name", name );
@@ -90,6 +97,26 @@
}
}
+ public void editBuildEnvironmentWithBuildAgentGroup( String name, String[] installations, String buildAgentGroupName, boolean success )
+ {
+ setFieldValue( "profile.name", name );
+ selectValue( "profile.buildAgentGroup", buildAgentGroupName );
+ for ( String i : installations )
+ {
+ selectValue( "installationId", i );
+ clickButtonWithValue( "Add" );
+ }
+ submit();
+ if ( success )
+ {
+ assertBuildEnvironmentPage();
+ }
+ else
+ {
+ assertAddBuildEnvironmentPage();
+ }
+ }
+
public void goToEditBuildEnvironment( String name )
{
goToBuildEnvironmentPage();
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildQueueTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildQueueTest.java
index bb44941..2e92230 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildQueueTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildQueueTest.java
@@ -1,5 +1,7 @@
package org.apache.continuum.web.test.parent;
+import org.testng.Assert;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -64,22 +66,32 @@
assertButtonWithValuePresent( "Cancel" );
}
- public void addBuildQueue( String name, boolean success )
- {
- goToBuildQueuePage();
- assertBuildQueuePage();
- submit();
- assertAddBuildQueuePage();
- setFieldValue( "name", name );
- submit();
- if ( success )
- {
- assertBuildQueuePage();
- assertTextPresent( name );
- }
- else
- {
- assertAddBuildQueuePage();
- }
- }
+ public void addBuildQueue( String name, boolean success )
+ {
+ goToBuildQueuePage();
+ assertBuildQueuePage();
+ submit();
+ assertAddBuildQueuePage();
+ setFieldValue( "name", name );
+ submit();
+ if ( success )
+ {
+ assertBuildQueuePage();
+ assertTextPresent( name );
+ }
+ else
+ {
+ assertAddBuildQueuePage();
+ }
+ }
+
+ public void buildProjectForQueuePageTest( String projectGroupName, String groupId, String description, String projectName )
+ throws Exception
+ {
+ showProjectGroup( projectGroupName, groupId, description );
+ clickButtonWithValue( "Build all projects" );
+ waitForElementPresent( "//img[@alt='Building']" );
+ }
+
+
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
index 8181bf9..f4e7c78 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
@@ -19,11 +19,15 @@
* under the License.
*/
+import org.apache.continuum.web.test.ConfigurationTest;
+import org.apache.continuum.web.test.listener.CaptureScreenShotsListener;
import org.testng.Assert;
+import java.io.File;
+
/**
* Based on AbstractContinuumTestCase of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -50,7 +54,7 @@
assertButtonWithValuePresent( "Create Admin" );
}
- public void submitAdminData( String fullname, String email, String password )
+ public void submitAdminData(String fullname,String email,String password )
{
setFieldValue( "user.fullName", fullname );
setFieldValue( "user.email", email );
@@ -64,8 +68,8 @@
// ////////////////////////////////////
public void goToAboutPage()
{
+ getSelenium().open( baseUrl );
clickLinkWithText( "About" );
-
assertAboutPage();
}
@@ -82,6 +86,7 @@
public void goToLoginPage()
{
+ getSelenium().deleteAllVisibleCookies();
getSelenium().open( baseUrl );
clickLinkWithText( "Login" );
assertLoginPage();
@@ -104,7 +109,7 @@
assertTextPresent( "Forgot your Password? Request a password reset." );
}
- public void submitUserData( String username, String password, boolean rememberme, boolean success )
+ public void submitUserData(String username,String password,boolean rememberme,boolean success )
{
setFieldValue( "username", username );
@@ -124,7 +129,7 @@
}
}
- public void assertAutenticatedPage( String username )
+ public void assertAutenticatedPage(String username )
{
assertTextPresent( "Current User" );
assertTextPresent( "Edit Details" );
@@ -133,6 +138,38 @@
assertTextPresent( username );
}
+ public void assertChangePasswordPage()
+ {
+ assertPage( "Change Password" );
+ assertTextPresent( "Change Password" );
+ assertTextPresent( "Existing Password*:" );
+ assertElementPresent( "existingPassword" );
+ assertTextPresent( "New Password*:" );
+ assertElementPresent( "newPassword" );
+ assertTextPresent( "Confirm New Password*:" );
+ assertElementPresent( "newPasswordConfirm" );
+ }
+
+ public void assertUserEditPage( String username, String name, String email )
+ {
+ assertPage( "[Admin] User Edit" );
+ assertTextPresent( "[Admin] User Edit" );
+ assertTextPresent( "Username" );
+ assertTextPresent( username );
+ assertTextPresent( "Full Name*:" );
+ assertFieldValue( name, "userEditForm_user_fullName" );
+ assertTextPresent( "Email Address*:" );
+ assertFieldValue( email, "userEditForm_user_email" );
+ assertTextPresent( "Password*:" );
+ assertFieldValue( "", "userEditForm_user_password" );
+ assertTextPresent( "Confirm Password*:" );
+ assertElementPresent( "userEditForm_user_confirmPassword" );
+ assertTextPresent( "Account Creation:" );
+ assertTextPresent( "Last Password Change:" );
+ assertTextPresent( "Effective Roles" );
+ assertLinkPresent( "Edit Roles" );
+ }
+
// ////////////////////////////////////
// Configuration
// ////////////////////////////////////
@@ -163,7 +200,7 @@
// Build Queue
// ////////////////////////////////////
- public void setMaxBuildQueue( int maxBuildQueue )
+ public void setMaxBuildQueue(int maxBuildQueue )
{
clickLinkWithText( "Configuration" );
setFieldValue( "numberOfAllowedBuildsinParallel", String.valueOf( maxBuildQueue ) );
@@ -176,7 +213,8 @@
public void goToProjectGroupsSummaryPage()
throws Exception
{
- clickLinkWithText( "Show Project Groups" );
+ getSelenium().open( "/continuum/groupSummary.action" );
+ waitPage();
assertProjectGroupsSummaryPage();
}
@@ -201,7 +239,7 @@
// ////////////////////////////////////
// Project Group
// ////////////////////////////////////
- public void showProjectGroup( String name, String groupId, String description )
+ public void showProjectGroup(String name,String groupId,String description )
throws Exception
{
goToProjectGroupsSummaryPage();
@@ -213,7 +251,7 @@
assertProjectGroupSummaryPage( name, groupId, description );
}
- public void assertProjectGroupSummaryPage( String name, String groupId, String description )
+ public void assertProjectGroupSummaryPage(String name,String groupId,String description )
{
assertPage( "Continuum - Project Group" );
assertTextPresent( "Project Group Name" );
@@ -230,6 +268,7 @@
// assertElementPresent( "remove" );
assertTextPresent( "Project Group Scm Root" );
+ assertTextPresent( "Scm Root URL" );
if ( isTextPresent( "Member Projects" ) )
{
@@ -243,7 +282,7 @@
}
}
- public void addProjectGroup( String name, String groupId, String description, boolean success )
+ public void addProjectGroup(String name,String groupId,String description,boolean success )
throws Exception
{
goToProjectGroupsSummaryPage();
@@ -280,7 +319,7 @@
assertElementPresent( "description" );
}
- public void removeProjectGroup( String name, String groupId, String description )
+ public void removeProjectGroup(String name,String groupId,String description )
throws Exception
{
showProjectGroup( name, groupId, description );
@@ -293,8 +332,19 @@
clickButtonWithValue( "Save" );
assertProjectGroupsSummaryPage();
}
+
+ public void removeProjectGroup( String groupName )
+ throws Exception
+ {
+ goToProjectGroupsSummaryPage();
+ clickLinkWithText( groupName );
+ clickButtonWithValue( "Delete Group" );
+ assertTextPresent( "Project Group Removal" );
+ clickButtonWithValue( "Delete" );
+ assertProjectGroupsSummaryPage();
+ }
- public void editProjectGroup( String name, String groupId, String description, String newName, String newDescription )
+ public void editProjectGroup(String name,String groupId,String description,String newName,String newDescription )
throws Exception
{
showProjectGroup( name, groupId, description );
@@ -305,7 +355,7 @@
clickButtonWithValue( "Save" );
}
- public void assertEditGroupPage( String groupId )
+ public void assertEditGroupPage(String groupId )
throws Exception
{
assertPage( "Continuum - Update Project Group" );
@@ -320,29 +370,32 @@
assertElementPresent( "Cancel" );
}
- public void buildProjectGroup( String projectGroupName, String groupId, String description, String projectName )
+ public void buildProjectGroup(String projectGroupName,String groupId,String description,String projectName )
throws Exception
{
- int currentIt = 1;
- int maxIt = 10;
showProjectGroup( projectGroupName, groupId, description );
+ waitForProjectUpdate();
clickButtonWithValue( "Build all projects" );
- while ( isElementPresent( "//img[@alt='Building']" ) || isElementPresent( "//img[@alt='Updating']" ) )
+
+ // wait for project to finish building
+ waitForProjectBuild();
+
+ // wait for the success status of project
+ if ( !isElementPresent( "//a/img[@alt='Success']" ) )
{
- Thread.sleep( 10000 );
- getSelenium().refresh();
- waitPage();
- if ( currentIt > maxIt )
- {
- Assert.fail( "Timeout, Can't build project group" );
- }
- currentIt++;
+ waitForElementPresent( "//a/img[@alt='Success']" );
}
- Thread.sleep( 10000 );
+
+ // wait for the projectName link
+ if ( !isLinkPresent( projectName ) )
+ {
+ waitForElementPresent( "link=" + projectName );
+ }
+
clickLinkWithText( projectName );
clickLinkWithText( "Builds" );
clickLinkWithText( "Result" );
- assertTextPresent( "BUILD SUCCESSFUL" );
+ assertTextPresent( "BUILD SUCCESS" );
clickLinkWithText( "Project Group Summary" );
}
@@ -356,8 +409,8 @@
assertButtonWithValuePresent( "Submit" );
}
- public void addValidM2ProjectFromProjectGroup( String projectGroupName, String groupId, String description,
- String m2PomUrl )
+ public void addValidM2ProjectFromProjectGroup(String projectGroupName,String groupId,String description,
+ String m2PomUrl )
throws Exception
{
showProjectGroup( projectGroupName, groupId, description );
@@ -370,7 +423,7 @@
assertProjectGroupsSummaryPage();
}
- public void goToGroupBuildDefinitionPage( String projectGroupName, String groupId, String description )
+ public void goToGroupBuildDefinitionPage(String projectGroupName,String groupId,String description )
throws Exception
{
showProjectGroup( projectGroupName, groupId, description );
@@ -378,12 +431,12 @@
assertGroupBuildDefinitionPage( projectGroupName );
}
- public void assertGroupBuildDefinitionPage( String projectGroupName )
+ public void assertGroupBuildDefinitionPage(String projectGroupName )
{
assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group" );
}
- public void assertDeleteBuildDefinitionPage( String description, String goals )
+ public void assertDeleteBuildDefinitionPage(String description,String goals )
{
assertTextPresent( "Are you sure you want to delete the build definition with description \"" + description
+ "\", goals \"" + goals + "\" and id" );
@@ -415,9 +468,9 @@
assertElementPresent( "profileId" );
}
- public void addEditGroupBuildDefinition( String groupName, String buildFile, String goals, String arguments,
- String description, boolean buildFresh, boolean alwaysBuild,
- boolean isDefault )
+ public void addEditGroupBuildDefinition(String groupName,String buildFile,String goals,String arguments,
+ String description,boolean buildFresh,boolean alwaysBuild,
+ boolean isDefault )
{
assertAddEditBuildDefinitionPage();
// Enter values into Add Build Definition fields, and submit
@@ -454,7 +507,10 @@
uncheckField( "alwaysBuild" );
}
+ selectValue( "scheduleId", "DEFAULT_SCHEDULE" );
+
submit();
+
if ( groupName != null )
{
assertGroupBuildDefinitionPage( groupName );
@@ -468,7 +524,7 @@
// ////////////////////////////////////
// General Project Pages
// ////////////////////////////////////
- public void goToEditProjectPage( String projectGroupName, String projectName )
+ public void goToEditProjectPage(String projectGroupName,String projectName )
{
clickLinkWithText( "Show Project Groups" );
clickLinkWithText( projectGroupName );
@@ -497,7 +553,7 @@
assertElementPresent( "scmTag" );
}
- public void goToProjectInformationPage( String projectGroupName, String projectName )
+ public void goToProjectInformationPage(String projectGroupName,String projectName )
{
clickLinkWithText( "Show Project Groups" );
clickLinkWithText( projectGroupName );
@@ -518,12 +574,19 @@
assertTextPresent( "Developers" );
}
- public void moveProjectToProjectGroup( String groupName, String groupId, String groupDescription,
- String projectName, String newProjectGroup )
+ public void moveProjectToProjectGroup(String groupName,String groupId,String groupDescription,
+ String projectName,String newProjectGroup )
throws Exception
{
showProjectGroup( groupName, groupId, groupDescription );
- clickButtonWithValue( "Edit" );
+
+ // wait for project not being used
+ waitForProjectBuild();
+
+ String id = getFieldValue( "name=projectGroupId" );
+ String url = baseUrl + "/editProjectGroup.action?projectGroupId=" + id;
+ getSelenium().open( url );
+ waitPage();
assertTextPresent( "Move to Group" );
String xPath = "//preceding::th/label[contains(text(),'" + projectName + "')]//following::select";
@@ -556,8 +619,8 @@
assertElementPresent( "selectedProjectGroup" );
}
- public void addMavenTwoProject( String pomUrl, String username, String password, String projectGroup,
- boolean success )
+ public void addMavenTwoProject(String pomUrl,String username,String password,String projectGroup,
+ boolean success )
throws Exception
{
goToAddMavenTwoProjectPage();
@@ -586,11 +649,11 @@
/**
* submit the page
- *
+ *
* @param m2PomUrl
* @param validPom
*/
- public void submitAddMavenTwoProjectPage( String m2PomUrl, boolean validPom )
+ public void submitAddMavenTwoProjectPage(String m2PomUrl,boolean validPom )
throws Exception
{
addMavenTwoProject( m2PomUrl, "", "", null, validPom );
@@ -634,8 +697,8 @@
assertButtonWithValuePresent( "Cancel" );
}
- public void addMavenOneProject( String pomUrl, String username, String password, String projectGroup,
- String buildTemplate, boolean success )
+ public void addMavenOneProject(String pomUrl,String username,String password,String projectGroup,
+ String buildTemplate,boolean success )
throws Exception
{
setFieldValue( "m1PomUrl", pomUrl );
@@ -679,7 +742,7 @@
assertAddProjectPage( "shell" );
}
- public void assertAddProjectPage( String type )
+ public void assertAddProjectPage(String type )
{
String title = type.substring( 0, 1 ).toUpperCase() + type.substring( 1 ).toLowerCase();
assertPage( "Continuum - Add " + title + " Project" );
@@ -712,9 +775,9 @@
assertButtonWithValuePresent( "Cancel" );
}
- public void addProject( String name, String description, String version, String scmUrl, String scmUser,
- String scmPassword, String scmTag, boolean useCache, String projectGroup,
- String buildTemplate, boolean success )
+ public void addProject(String name,String description,String version,String scmUrl,String scmUser,
+ String scmPassword,String scmTag,boolean useCache,String projectGroup,
+ String buildTemplate,boolean success,String type )
throws Exception
{
setFieldValue( "projectName", name );
@@ -738,25 +801,270 @@
}
submit();
String title;
+ type = type.substring( 0, 1 ).toUpperCase() + type.substring( 1 ).toLowerCase();
if ( success )
{
title = "Continuum - Project Group";
}
else
{
- title = "Continuum - Add ";
+ title = "Continuum - Add " + type + " Project";
}
waitAddProject( title );
}
- private void waitAddProject( String title )
+ public void waitAddProject( String title )
throws Exception
{
- Thread.sleep( 100 );
- String condition = "selenium.browserbot.getCurrentWindow().document.title != ''";
- getSelenium().waitForCondition( condition, maxWaitTimeInMs );
- Thread.sleep( 1000 );
- String t = getTitle();
- Assert.assertTrue( t.contains( title ) );
+ // the "adding project" interstitial page has an empty title, so we wait for a real title to appear
+
+ if ( browser.equals( "*iexplore" ) )
+ {
+ int currentIt = 1;
+ int maxIt = 20;
+
+ // there's a problem with ie using waitForCondition
+ while( getTitle().equals( "" ) && currentIt <= maxIt )
+ {
+ waitPage();
+ currentIt++;
+ }
+ }
+ else
+ {
+ String condition = "selenium.browserbot.getCurrentWindow().document.title.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\") != '' && selenium.browserbot.getCurrentWindow().document.getElementById('footer') != null";
+ waitForCondition( condition );
+ }
+
+ Assert.assertEquals( getTitle(), title );
+ }
+
+ public void createAndAddUserAsDeveloperToGroup( String username, String name, String email, String password, String groupName )
+ {
+ clickLinkWithText( "Users" );
+ assertPage( "[Admin] User List" );
+ assertTextNotPresent( username );
+ clickButtonWithValue( "Create New User" );
+ assertPage( "[Admin] User Create" );
+ setFieldValue( "user.fullName", name );
+ setFieldValue( "user.username", username );
+ setFieldValue( "user.email", email );
+ setFieldValue( "user.password", password );
+ setFieldValue( "user.confirmPassword", password );
+ clickButtonWithValue( "Create User" );
+ assertPage( "[Admin] User Edit" );
+ assignContinuumResourceRoleToUser( "Project Developer", groupName );
+ clickButtonWithValue( "Submit" );
+ assertPage( "[Admin] User List" );
+ assertTextPresent( username );
+ assertTextPresent( name );
+ assertTextPresent( email );
+ }
+
+ public void showMembers( String name, String groupId, String description )
+ throws Exception
+ {
+ showProjectGroup( name, groupId, description );
+ clickLinkWithText( "Members" );
+ assertTextPresent( "Member Projects of " + name + " group" );
+ assertTextPresent( "Users" );
+ }
+
+ public void assertUserPresent( String username, String name, String email )
+ {
+ assertTextPresent( username );
+ assertTextPresent( name );
+ assertTextPresent( email );
+ }
+
+ public void assertUserNotPresent( String username, String name, String email )
+ {
+ assertTextNotPresent( username );
+ assertTextNotPresent( name );
+ assertTextNotPresent( email );
+ }
+
+ public void waitForProjectCheckout()
+ throws Exception
+ {
+ // wait for project to finish checking out
+ waitForElementPresent( "//img[@alt='Checking Out']", false );
+ }
+
+ public void waitForProjectUpdate()
+ throws Exception
+ {
+ if ( isElementPresent( "//img[@alt='Checking Out']" ) )
+ {
+ waitForProjectCheckout();
+ }
+
+ // wait for project to finish updating
+ waitForElementPresent( "//img[@alt='Updating']", false );
+ }
+
+ public void waitForProjectBuild()
+ throws Exception
+ {
+ if ( isElementPresent( "//img[@alt='Checking Out']" ) || isElementPresent( "//img[@alt='Updating']" ) )
+ {
+ waitForProjectUpdate();
+ }
+
+ // wait for project to finish building
+ waitForElementPresent( "//img[@alt='Building']", false );
+ }
+
+ public void createNewUser( String username, String name, String email, String password )
+ {
+ clickLinkWithText( "Users" );
+ assertPage( "[Admin] User List" );
+ assertTextNotPresent( username );
+ clickButtonWithValue( "Create New User" );
+ assertPage( "[Admin] User Create" );
+ setFieldValue( "user.fullName", name );
+ setFieldValue( "user.username", username );
+ setFieldValue( "user.email", email );
+ setFieldValue( "user.password", password );
+ setFieldValue( "user.confirmPassword", password );
+ clickButtonWithValue( "Create User" );
+ assertPage( "[Admin] User Edit" );
+ }
+
+ public void assignContinuumRoleToUser( String role )
+ {
+ clickLinkWithXPath( "//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='" + role + "']", false );
+ }
+
+ public void assignContinuumResourceRoleToUser( String resourceRole, String groupName )
+ {
+ clickLinkWithXPath( "//input[@name='addDSelectedRoles' and @value='" + resourceRole + " - " + groupName + "']", false );
+ }
+
+ public void assertUserCreatedPage()
+ {
+ assertPage( "[Admin] User List" );
+ assertTextPresent( "[Admin] List of Users in Role: Any" );
+ assertLinkPresent( "admin" );
+ assertLinkPresent( "guest" );
+ }
+
+ public void removeDefaultBuildDefinitionFromTemplate( String type )
+ {
+ goToEditBuildDefinitionTemplate( type );
+ clickLinkWithXPath( "//input[@value='<-']", false );
+ submit();
+ }
+
+ public void addDefaultBuildDefinitionFromTemplate( String type )
+ {
+ goToEditBuildDefinitionTemplate( type );
+
+ if ( "maven2".equals( type ) )
+ {
+ selectForOption( "saveBuildDefinitionTemplate_buildDefinitionIds", "Default Maven 2 Build Definition" );
+ }
+ else if ( "maven1".equals( type ) )
+ {
+
+ }
+ else if ( "ant".equals( type ) )
+ {
+
+ }
+ else
+ {
+
+ }
+
+ clickLinkWithXPath( "//input[@value='->']", false );
+ submit();
+ }
+
+ public void goToEditBuildDefinitionTemplate( String type )
+ {
+ clickLinkWithText( "Build Definition Templates" );
+
+ assertBuildDefinitionTemplatesPage();
+
+ if ( "maven2".equals( type ) )
+ {
+ clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr[3]/td[2]/a/img", true );
+ }
+ else if ( "maven1".equals( type ) )
+ {
+ clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr[2]/td[2]/a/img", true );
+ }
+ else if ( "ant".equals( type ) )
+ {
+ clickLinkWithXPath( "//img[@alt='Edit']", true );
+ }
+ else
+ {
+ clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr[4]/td[2]/a/img", true );
+ }
+
+ assertPage( "Continuum - Build Definition Template" );
+ }
+
+ public void assertBuildDefinitionTemplatesPage()
+ {
+ assertPage( "Continuum - Build Definition Templates" );
+ assertTextPresent( "Default Ant Template" );
+ assertTextPresent( "Default Maven 1 Template" );
+ assertTextPresent( "Default Maven 2 Template" );
+ assertTextPresent( "Default Shell Template" );
+ assertTextPresent( "Available Build Definitions" );
+ assertTextPresent( "Default Ant Build Definition" );
+ assertTextPresent( "Default Maven 1 Build Definition" );
+ assertTextPresent( "Default Maven 2 Build Definition" );
+ assertTextPresent( "Default Shell Build Definition" );
+ }
+
+ // ////////////////////////////////////
+ // Distributed Builds
+ // ////////////////////////////////////
+
+ public void enableDistributedBuilds()
+ {
+ ConfigurationTest config = new ConfigurationTest();
+ config.goToConfigurationPage();
+ setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+ if ( !isChecked( "configuration_distributedBuildEnabled" ) )
+ {
+ checkField( "configuration_distributedBuildEnabled" );
+ }
+ clickAndWait( "configuration_" );
+ assertTextPresent( "true" );
+ assertTextPresent( "Distributed Builds" );
+ assertElementPresent( "link=Build Agents" );
+ }
+
+ public void disableDistributedBuilds()
+ {
+ ConfigurationTest config = new ConfigurationTest();
+ config.goToConfigurationPage();
+ setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+ if ( isChecked( "configuration_distributedBuildEnabled" ) )
+ {
+ uncheckField( "configuration_distributedBuildEnabled" );
+ }
+ submit();
+ assertTextPresent( "false" );
+ assertElementNotPresent( "link=Build Agents" );
+ }
+
+ public void goToBuildAgentPage()
+ {
+ clickAndWait("link=Build Agents");
+ assertPage("Continuum - Build Agents");
+ }
+
+ public void assertBuildAgentPage()
+ {
+ assertPage("Continuum - Build Agents");
+ assertTextPresent("Build Agents");
+ assertTextPresent("Build Agent Groups");
+ assertButtonWithValuePresent( "Add" );
}
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java
new file mode 100644
index 0000000..9c652d9
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java
@@ -0,0 +1,186 @@
+package org.apache.continuum.web.test.parent;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import org.testng.Assert;
+
+/*
+ * 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.
+ */
+
+public abstract class AbstractReleaseTest
+ extends AbstractContinuumTest
+{
+ public void releasePrepareProject( String username, String password, String tagBase, String tag, String releaseVersion, String developmentVersion, String buildEnv, boolean success )
+ throws Exception
+ {
+ goToReleasePreparePage();
+ setFieldValue( "scmUsername", username );
+ setFieldValue( "scmPassword", password );
+ setFieldValue( "scmTag", tag );
+ setFieldValue( "scmTagBase", tagBase );
+ setFieldValue( "prepareGoals", "clean" );
+ selectValue( "profileId", buildEnv );
+ setFieldValue( "relVersions", releaseVersion );
+ setFieldValue( "devVersions", developmentVersion );
+ submit();
+
+ assertRelease( success );
+ }
+
+ public void releasePerformProjectWithProvideParameters( String username, String password, String tagBase, String tag, String scmUrl, String buildEnv, boolean success )
+ throws Exception
+ {
+ goToReleasePerformProvideParametersPage();
+ setFieldValue( "scmUrl", scmUrl );
+ setFieldValue( "scmUsername", username );
+ setFieldValue( "scmPassword", password );
+ setFieldValue( "scmTag", tag );
+ setFieldValue( "scmTagBase", tagBase );
+ setFieldValue( "goals", "clean deploy" );
+ selectValue( "profileId", buildEnv );
+ submit();
+
+ assertRelease( success );
+ }
+
+ public void releasePrepareProject( String username, String password, String tagBase, String tag,
+ String releaseVersion, String developmentVersion, String buildEnv )
+ throws Exception
+ {
+ goToReleasePreparePage();
+ setFieldValue( "scmUsername", username );
+ setFieldValue( "scmPassword", password );
+ setFieldValue( "scmTag", tag );
+ setFieldValue( "scmTagBase", tagBase );
+ setFieldValue( "prepareGoals", "clean" );
+ selectValue( "profileId", buildEnv );
+ setFieldValue( "relVersions", releaseVersion );
+ setFieldValue( "devVersions", developmentVersion );
+ submit();
+ }
+
+ public void goToReleasePreparePage()
+ {
+ clickLinkWithLocator( "goal", false );
+ submit();
+ assertReleasePreparePage();
+ }
+
+ public void goToReleasePerformProvideParametersPage()
+ {
+ clickLinkWithLocator( "//input[@name='goal' and @value='perform']", false );
+ submit();
+ assertReleasePerformProvideParametersPage();
+ }
+
+ public void assertReleasePreparePage()
+ {
+ assertPage( "Continuum - Release Project" );
+ assertTextPresent( "Prepare Project for Release" );
+ assertTextPresent( "Release Prepare Parameters" );
+ assertTextPresent( "SCM Username" );
+ assertTextPresent( "SCM Password" );
+ assertTextPresent( "SCM Tag" );
+ assertTextPresent( "SCM Tag Base" );
+ assertTextPresent( "SCM Comment Prefix" );
+ assertTextPresent( "Preparation Goals" );
+ assertTextPresent( "Arguments" );
+ assertTextPresent( "Build Environment" );
+ assertTextPresent( "Release Version" );
+ assertTextPresent( "Next Development Version" );
+ assertButtonWithValuePresent( "Submit" );
+ }
+
+ public void assertReleasePerformProvideParametersPage()
+ {
+ assertPage( "Continuum - Perform Project Release" );
+ assertTextPresent( "Perform Project Release" );
+ assertTextPresent( "Release Perform Parameters" );
+ assertTextPresent( "SCM Connection URL" );
+ assertTextPresent( "SCM Username" );
+ assertTextPresent( "SCM Password" );
+ assertTextPresent( "SCM Tag" );
+ assertTextPresent( "SCM Tag Base" );
+ assertTextPresent( "Perform Goals" );
+ assertTextPresent( "Arguments" );
+ assertTextPresent( "Build Environment" );
+ assertButtonWithValuePresent( "Submit" );
+ }
+
+ public void assertRelease( boolean success )
+ throws Exception
+ {
+ String doneButtonLocator = "//input[@id='releaseCleanup_0']";
+ String errorTextLocator = "//h3[text()='Release Error']";
+
+ // condition for release is complete; "Done" button or "Release Error" in page is present
+ if ( browser.equals( "*iexplore" ) )
+ {
+ int currentIt = 0;
+ int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
+ String pageLoadTimeInMs = getProperty( "PAGE_LOAD_TIME_IN_MS" );
+
+ while ( ( isElementPresent( doneButtonLocator ) || isElementPresent( errorTextLocator ) ) && currentIt < maxIt )
+ {
+ getSelenium().waitForPageToLoad( pageLoadTimeInMs );
+ currentIt++;
+ }
+ }
+ else
+ {
+ String condition = "( selenium.isElementPresent(\"" + doneButtonLocator + "\") || " +
+ "selenium.isElementPresent(\"" + errorTextLocator + "\") )";
+ waitForCondition( condition );
+ }
+
+ assertButtonWithValuePresent( "Rollback changes" );
+
+ if ( success )
+ {
+ assertImgWithAltNotPresent( "Error" );
+ }
+ else
+ {
+ assertImgWithAlt( "Error" );
+ }
+ }
+
+ public void assertPreparedReleasesFileCreated()
+ throws Exception
+ {
+ File file = new File( "target/conf/prepared-releases.xml" );
+ Assert.assertTrue( file.exists(), "prepared-releases.xml was not created" );
+
+ FileInputStream fis = new FileInputStream( file );
+ BufferedReader reader = new BufferedReader( new InputStreamReader( fis ) );
+
+ String BUILD_AGENT_URL = getProperty( "BUILD_AGENT_NAME2" );
+ String strLine;
+ StringBuffer str = new StringBuffer();
+ while( ( strLine = reader.readLine() ) != null )
+ {
+ str.append( strLine );
+ }
+
+ Assert.assertTrue( str.toString().contains( "<buildAgentUrl>" + BUILD_AGENT_URL + "</buildAgentUrl>" ), "prepared-releases.xml was not populated" );
+ }
+}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
index 7c95836..2e0c9af 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
@@ -84,8 +84,8 @@
assertTextPresent( "Quiet Period (seconds):" );
assertElementPresent( "delay" );
assertTextPresent( "Add Build Queue" );
- assertElementPresent( "availableBuildQueues" );
- assertElementPresent( "selectedBuildQueues" );
+ assertElementPresent( "availableBuildQueuesIds" );
+ assertElementPresent( "selectedBuildQueuesIds" );
assertElementPresent( "active" );
assertTextPresent( "Enable/Disable the schedule" );
assertButtonWithValuePresent( "Save" );
@@ -94,20 +94,41 @@
public void addEditSchedule( String name, String description, String second, String minute, String hour,
String dayMonth, String month, String dayWeek, String year, String maxTime,
- String period, boolean success )
+ String period, boolean buildQueue, boolean success )
{
- setFieldValue( "name", name );
- setFieldValue( "description", description );
- setFieldValue( "second", second );
- setFieldValue( "minute", minute );
- setFieldValue( "hour", hour );
- setFieldValue( "dayOfMonth", dayMonth );
- setFieldValue( "month", month );
- setFieldValue( "dayOfWeek", dayWeek );
- setFieldValue( "year", year );
- setFieldValue( "maxJobExecutionTime", maxTime );
- setFieldValue( "delay", period );
- submit();
+ if ( buildQueue )
+ {
+ setFieldValue( "name", name );
+ setFieldValue( "description", description );
+ setFieldValue( "second", second );
+ setFieldValue( "minute", minute );
+ setFieldValue( "hour", hour );
+ setFieldValue( "dayOfMonth", dayMonth );
+ setFieldValue( "month", month );
+ setFieldValue( "dayOfWeek", dayWeek );
+ setFieldValue( "year", year );
+ setFieldValue( "maxJobExecutionTime", maxTime );
+ setFieldValue( "delay", period );
+ getSelenium().addSelection("saveSchedule_availableBuildQueuesIds", "label=DEFAULT_BUILD_QUEUE");
+ getSelenium().click("//input[@value='->']");
+ submit();
+ }
+ else
+ {
+ setFieldValue( "name", name );
+ setFieldValue( "description", description );
+ setFieldValue( "second", second );
+ setFieldValue( "minute", minute );
+ setFieldValue( "hour", hour );
+ setFieldValue( "dayOfMonth", dayMonth );
+ setFieldValue( "month", month );
+ setFieldValue( "dayOfWeek", dayWeek );
+ setFieldValue( "year", year );
+ setFieldValue( "maxJobExecutionTime", maxTime );
+ setFieldValue( "delay", period );
+ submit();
+ }
+
if ( success )
{
assertSchedulePage();
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
index abd50f1..207ea56 100644
--- a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
@@ -19,21 +19,24 @@
* under the License.
*/
+import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.Selenium;
+import org.apache.commons.io.IOUtils;
+import org.testng.Assert;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Map.Entry;
-
-import org.testng.Assert;
-
-import com.thoughtworks.selenium.DefaultSelenium;
-import com.thoughtworks.selenium.Selenium;
+import java.util.Properties;
/**
* Based on AbstractSeleniumTestCase of Emmanuel Venisse test.
- *
+ *
* @author José Morales Martínez
* @version $Id$
*/
@@ -41,41 +44,85 @@
{
public static String baseUrl;
+ public static String browser;
+
public static String maxWaitTimeInMs;
- private static ThreadLocal<Selenium> selenium;
+ private static ThreadLocal<Selenium> selenium = new ThreadLocal<Selenium>();
- public static Properties p;
+ private static Properties p;
+
+ private final static String PROPERTIES_SEPARATOR = "=";
+
+ private static String maxProjectWaitTimeInMs;
/**
- * Initialize selenium an others properties. This method is called from BeforeSuite method of sub-class.
+ * Initialize properties.
*/
public void open()
throws Exception
{
+ InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties" );
p = new Properties();
- p.load( this.getClass().getClassLoader().getResourceAsStream( "testng.properties" ) );
+ p.load( input );
- baseUrl = p.getProperty( "BASE_URL" );
- maxWaitTimeInMs = p.getProperty( "MAX_WAIT_TIME_IN_MS" );
-
- String seleniumHost = p.getProperty( "SELENIUM_HOST" );
- int seleniumPort = Integer.parseInt( ( p.getProperty( "SELENIUM_PORT" ) ) );
- String seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" );
- final Selenium s = new DefaultSelenium( seleniumHost, seleniumPort, seleniumBrowser, baseUrl );
- selenium = new ThreadLocal<Selenium>()
- {
- protected Selenium initialValue()
- {
- return s;
- }
- };
- getSelenium().start();
+ maxWaitTimeInMs = getProperty( "MAX_WAIT_TIME_IN_MS" );
+ maxProjectWaitTimeInMs = getProperty( "MAX_PROJECT_WAIT_TIME_IN_MS" );
}
- protected static Selenium getSelenium()
+ /**
+ * Initialize selenium
+ */
+ public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort )
+ throws Exception
{
- return selenium.get();
+ this.baseUrl = baseUrl;
+
+ this.browser = browser;
+
+ if ( getSelenium() == null )
+ {
+ DefaultSelenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
+ s.start();
+ s.setTimeout( maxWaitTimeInMs );
+ selenium.set( s );
+ }
+ }
+
+ public static Selenium getSelenium()
+ {
+ return selenium == null ? null : selenium.get();
+ }
+
+ protected String getProperty( String key )
+ {
+ return p.getProperty( key );
+ }
+
+ // TODO: look into removing this, as the issue should be fixed by upgrading the resources plugin to v2.4+
+ protected String getEscapeProperty( String key )
+ {
+ InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties" );
+ String value = null;
+ List<String> lines;
+ try
+ {
+ lines = IOUtils.readLines( input );
+ }
+ catch ( IOException e )
+ {
+ lines = new ArrayList<String>();
+ }
+ for ( String l : lines )
+ {
+ if ( l != null && l.startsWith( key ) )
+ {
+ int indexSeparator = l.indexOf( PROPERTIES_SEPARATOR );
+ value = l.substring( indexSeparator + 1 ).trim();
+ break;
+ }
+ }
+ return value;
}
/**
@@ -84,7 +131,11 @@
public void close()
throws Exception
{
- getSelenium().stop();
+ if ( getSelenium() != null )
+ {
+ getSelenium().stop();
+ selenium.set( null );
+ }
}
// *******************************************************
@@ -139,7 +190,7 @@
public void assertLinkNotPresent( String text )
{
- Assert.assertFalse( isElementPresent( "link=" + text ), "The link '" + text + "' is present." );
+ Assert.assertFalse( isElementPresent( "link=" + text ), "The link '" + text + "' is present." );
}
public void assertImgWithAlt( String alt )
@@ -156,6 +207,11 @@
assertElementPresent( locator );
}
+ public void assertImgWithAltNotPresent( String alt )
+ {
+ assertElementNotPresent( "//img[@alt='" + alt + "']" );
+ }
+
public void assertCellValueFromTable( String expected, String tableElement, int row, int column )
{
Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );
@@ -202,6 +258,7 @@
String[] optionsPresent = getSelenium().getSelectOptions( selectField );
List<String> expected = Arrays.asList( options );
List<String> present = Arrays.asList( optionsPresent );
+
Assert.assertTrue( present.containsAll( expected ), "Options expected are not included in present options" );
}
@@ -209,6 +266,7 @@
{
assertElementPresent( fieldName );
String optionsPresent = getSelenium().getSelectedLabel( value );
+
Assert.assertEquals( optionsPresent, value );
}
@@ -304,7 +362,6 @@
public void clickLinkWithLocator( String locator, boolean wait )
{
- assertElementPresent( locator );
getSelenium().click( locator );
if ( wait )
{
@@ -353,4 +410,58 @@
{
Assert.assertFalse( getSelenium().isChecked( locator ) );
}
+
+ public void clickAndWait( String locator )
+ {
+ getSelenium().click( locator );
+ getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+ }
+
+ public void waitForElementPresent( String locator )
+ throws Exception
+ {
+ waitForElementPresent( locator, true );
+ }
+
+ /*
+ * This will wait for the condition to be met.
+ * * shouldBePresent - if the locator is expected or not (true or false respectively)
+ */
+ public void waitForElementPresent( String locator, boolean shouldBePresent )
+ throws Exception
+ {
+ if ( browser.equals( "*iexplore" ) )
+ {
+ int currentIt = 0;
+ int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
+ String pageLoadTimeInMs = getProperty( "PAGE_LOAD_TIME_IN_MS" );
+
+ while ( isElementPresent( locator ) != shouldBePresent && currentIt < maxIt )
+ {
+ getSelenium().waitForPageToLoad( pageLoadTimeInMs );
+ currentIt++;
+ }
+ }
+ else
+ {
+ String condition = "selenium.isElementPresent(\"" + locator + "\") == " + shouldBePresent;
+ waitForCondition( condition );
+ }
+ }
+
+ public void selectForOption( String locator, String text )
+ {
+ getSelenium().addSelection( locator, "label=" + text );
+ }
+
+ public void unselectForOption( String locator, String text )
+ {
+ getSelenium().removeSelection( locator, "label=" + text );
+ }
+
+ public void waitForCondition( String condition )
+ throws Exception
+ {
+ getSelenium().waitForCondition( condition, maxProjectWaitTimeInMs );
+ }
}
diff --git a/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
new file mode 100644
index 0000000..6f165a1
--- /dev/null
+++ b/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
@@ -0,0 +1,375 @@
+package org.apache.continuum.web.test.parent;
+
+import java.io.File;
+
+import org.apache.continuum.web.test.XPathExpressionUtil;
+
+public abstract class AbstractUserRolesManagementTest
+ extends AbstractContinuumTest
+{
+ protected String username;
+ protected String fullname;
+
+ public String getUserEmail()
+ {
+ String email = getProperty( "USERROLE_EMAIL" );
+ return email;
+ }
+
+ public String getUserRolePassword()
+ {
+ String password = getProperty( "USERROLE_PASSWORD" );
+ return password;
+ }
+
+ public String getUserRoleNewPassword()
+ {
+ String password_new = getProperty( "NEW_USERROLE_PASSWORD" );
+ return password_new;
+ }
+
+ public String getBasedir()
+ {
+ String basedir = System.getProperty( "basedir" );
+
+ if ( basedir == null )
+ {
+ basedir = new File( "" ).getAbsolutePath();
+ }
+
+ return basedir;
+ }
+
+ public String getAdminUsername()
+ {
+ String adminUsername = getProperty( "ADMIN_USERNAME" );
+ return adminUsername;
+ }
+
+ public String getAdminPassword()
+ {
+ String adminPassword = getProperty( "ADMIN_PASSWORD" );
+ return adminPassword;
+ }
+
+ ////////////////////////////
+ // Assertions
+ ////////////////////////////
+ public void assertCreateUserPage()
+ {
+ assertPage( "[Admin] User Create" );
+ assertTextPresent( "[Admin] User Create" );
+ assertTextPresent( "Username*:" );
+ assertElementPresent( "user.username" );
+ assertTextPresent( "Full Name*:");
+ assertElementPresent( "user.fullName" );
+ assertTextPresent( "Email Address*:" );
+ assertElementPresent( "user.email" );
+ assertTextPresent( "Password*:" );
+ assertElementPresent( "user.password" );
+ assertTextPresent( "Confirm Password*:" );
+ assertElementPresent( "user.confirmPassword" );
+ assertButtonWithValuePresent( "Create User" );
+ }
+
+ public void assertUserRolesPage()
+ {
+ assertPage( "[Admin] User Edit" );
+ assertTextPresent( "[Admin] User Roles" );
+ String userRoles = "Username,Full Name,Email,redback-xwork-integration-core,Redback XWork Integration Security Core,Guest,Registered User,System Administrator,User Administrator,Continuum Group Project Administrator,Continuum Group Project Developer,Continuum Group Project User,Continuum Manage Build Environments,Continuum Manage Build Templates,Continuum Manage Installations,Continuum Manage Local Repositories,Continuum Manage Purging,Continuum Manage Queues,Continuum Manage Scheduling,Project Administrator,Project Developer,Project User,Default Project Group";
+ String[] arrayUserRoles = userRoles.split( "," );
+ for ( String userroles : arrayUserRoles )
+ assertTextPresent( userroles );
+ }
+
+ public void assertCreatedUserInfo( String username )
+ {
+ selectValue( "name=ec_rd", "50" );
+ waitPage();
+ clickLinkWithText( username );
+ clickLinkWithText( "Edit Roles" );
+ }
+
+ public void assertUserRoleCheckBoxPresent( String value )
+ {
+ getSelenium().isElementPresent( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
+ }
+
+ public void assertResourceRolesCheckBoxPresent( String value )
+ {
+ getSelenium().isElementPresent( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
+ }
+
+ public void checkUserRoleWithValue( String value )
+ {
+ assertUserRoleCheckBoxPresent( value );
+ getSelenium().click( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
+ }
+
+ public void checkResourceRoleWithValue( String value )
+ {
+ assertResourceRolesCheckBoxPresent( value );
+ getSelenium().click( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
+ }
+
+ public void assertLeftNavMenuWithRole( String role )
+ {
+ if( role == "System Administrator" )
+ {
+ String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Local Repositories,Purge Configurations,Schedules,Installations,Build Environments,Queues,Build Definition Templates,Configuration,Appearance,Users,Roles,Build Queue";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "User Administrator" )
+ {
+ String navMenu = "About,Show Project Groups,Users,Roles";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Group Project Administrator" )
+ {
+ String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Schedules,Queues,Users,Roles";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Group Project Developer" )
+ {
+ String navMenu = "About,Show Project Groups,Queues";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Group Project User" )
+ {
+ String navMenu = "About,Show Project Groups,Queues";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Build Environments" )
+ {
+ String navMenu = "About,Show Project Groups,Build Environments";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Build Templates" )
+ {
+ String navMenu = "About,Show Project Groups,Build Definition Templates";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Installations" )
+ {
+ String navMenu = "About,Show Project Groups,Installations";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Local Repositories" )
+ {
+ String navMenu = "About,Show Project Groups,Local Repositories";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Purging" )
+ {
+ String navMenu = "About,Show Project Groups,Purge Configurations";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Queues" )
+ {
+ String navMenu = "About,Show Project Groups,Queues";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Continuum Manage Scheduling" )
+ {
+ String navMenu = "About,Show Project Groups,Schedules";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Project Administrator - Default Project Group" )
+ {
+ String navMenu = "About,Show Project Groups,Queues,Users,Roles";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else if( role == "Project Developer - Default Project Group" || role == "Project User - Default Project Group" )
+ {
+ String navMenu = "About,Show Project Groups,Queues";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ }
+ else
+ {
+ String navMenu = "About,Show Project Groups";
+ String[] arrayNavMenu = navMenu.split( "," );
+ for( String navmenu : arrayNavMenu )
+ assertLinkPresent( navmenu );
+ assertTextPresent( "Project Groups" );
+ //assertTextPresent( "Project Groups list is empty." );
+ }
+
+ }
+
+ public void assertDeleteUserPage( String username )
+ {
+ assertPage( "[Admin] User Delete" ); //TODO
+ assertTextPresent( "[Admin] User Delete" );
+ assertTextPresent( "The following user will be deleted:" );
+ assertTextPresent( "Username: " + username );
+ assertButtonWithValuePresent( "Delete User" );
+ }
+
+ public void assertProjectAdministratorAccess()
+ {
+ assertLinkPresent( "About" );
+ assertLinkPresent( "Show Project Groups" );
+ assertLinkPresent( "Maven 2.0.x Project" );
+ assertLinkPresent( "Maven 1.x Project" );
+ assertLinkPresent( "Ant Project" );
+ assertLinkPresent( "Shell Project" );
+ assertLinkPresent( "Schedules" );
+ assertLinkPresent( "Queues" );
+ assertLinkPresent( "Users" );
+ assertLinkPresent( "Roles" );
+ assertLinkNotPresent( "Local Repositories" );
+ assertLinkNotPresent( "Purge Configurations" );
+ assertLinkNotPresent( "Installations" );
+ assertLinkNotPresent( "Build Environments" );
+ assertLinkNotPresent( "Build Definition Templates" );
+ assertLinkNotPresent( "Configuration" );
+ assertLinkNotPresent( "Appearance" );
+ assertLinkNotPresent( "Build Queue" );
+ assertLinkNotPresent( "Build Agent" );
+ }
+
+ /////////////////////////////////////////
+ // User Roles Management
+ /////////////////////////////////////////
+ public void changePassword( String oldPassword, String newPassword )
+ {
+ assertPage( "Change Password" );
+ setFieldValue( "existingPassword", oldPassword );
+ setFieldValue( "newPassword", newPassword );
+ setFieldValue( "newPasswordConfirm", newPassword );
+ clickButtonWithValue( "Change Password" );
+ }
+
+ public void createUser( String userName, String fullName, String email, String password, boolean valid )
+ {
+ createUser( userName, fullName, email, password, password, valid );
+ }
+
+ private void createUser( String userName, String fullName, String emailAd, String password, String confirmPassword,
+ boolean valid )
+ {
+ login( getAdminUsername() , getAdminPassword() );
+ clickLinkWithText( "Users" );
+ clickButtonWithValue( "Create New User" );
+ assertCreateUserPage();
+ setFieldValue( "user.username", userName );
+ setFieldValue( "user.fullName", fullName );
+ setFieldValue( "user.email", emailAd );
+ setFieldValue( "user.password", password );
+ setFieldValue( "user.confirmPassword", confirmPassword );
+ submit();
+
+ assertUserRolesPage( );
+ clickButtonWithValue( "Submit" );
+
+ /*if (valid )
+ {
+ String[] columnValues = {userName, fullName, emailAd};
+ assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) );
+ }
+ else
+ {
+ assertCreateUserPage();
+ }*/
+ }
+
+
+ public void login( String username, String password )
+ {
+ login( username, password, true, "Login Page" );
+ }
+
+ public void login( String username, String password, boolean valid, String assertReturnPage )
+ {
+ if ( isLinkPresent( "Login" ) )
+ {
+ goToLoginPage();
+
+ submitLoginPage( username, password, false, valid, assertReturnPage );
+ }
+ }
+
+ public void submitLoginPage( String username, String password )
+ {
+ submitLoginPage( username, password, false, true, "Login Page" );
+ }
+
+ public void submitLoginPage( String username, String password, boolean validUsernamePassword )
+ {
+ submitLoginPage( username, password, false, validUsernamePassword, "Login Page" );
+ }
+
+ public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword,
+ String assertReturnPage )
+ {
+ assertLoginPage();
+ setFieldValue( "username", username );
+ setFieldValue( "password", password );
+ if ( rememberMe )
+ {
+ checkField( "rememberMe" );
+ }
+ clickButtonWithValue( "Login" );
+
+ if ( validUsernamePassword )
+ {
+ assertTextPresent( "Current User:" );
+ assertTextPresent( username );
+ assertLinkPresent( "Edit Details" );
+ assertLinkPresent( "Logout" );
+ }
+ else
+ {
+ if ( "Login Page".equals( assertReturnPage ) )
+ {
+ assertLoginPage();
+ }
+ else
+ {
+ assertPage( assertReturnPage );
+ }
+ }
+ }
+
+ public void deleteUser( String userName, String fullName, String emailAdd )
+ {
+ deleteUser( userName, fullName, emailAdd, false, false );
+ }
+
+ public void deleteUser( String userName, String fullName, String emailAd, boolean validated, boolean locked )
+ {
+ //clickLinkWithText( "userlist" );
+ clickLinkWithXPath( "//table[@id='ec_table']/tbody[2]/tr[3]/td[7]/a/img" );
+ assertDeleteUserPage( userName );
+ submit();
+ assertElementNotPresent( userName );
+ }
+}
diff --git a/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy b/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy
index 53a6c90..c0da5a3 100644
--- a/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy
+++ b/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy
@@ -1,172 +1,172 @@
-// ============================================================================
-// catalina.corepolicy - Security Policy Permissions for Tomcat 5
-//
-// This file contains a default set of security policies to be enforced (by the
-// JVM) when Catalina is executed with the "-security" option. In addition
-// to the permissions granted here, the following additional permissions are
-// granted to the codebase specific to each web application:
-//
-// * Read access to the document root directory
-//
-// $Id: catalina.policy 393732 2006-04-13 06:32:25Z pero $
-// ============================================================================
-
-
-// ========== SYSTEM CODE PERMISSIONS =========================================
-
-
-// These permissions apply to javac
-grant codeBase "file:${java.home}/lib/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions
-grant codeBase "file:${java.home}/jre/lib/ext/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/../lib/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions when
-// ${java.home} points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/lib/ext/-" {
- permission java.security.AllPermission;
-};
-
-
-// ========== CATALINA CODE PERMISSIONS =======================================
-
-
-// These permissions apply to the launcher code
-grant codeBase "file:${catalina.home}/bin/commons-launcher.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the daemon code
-grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the commons-logging API
-grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the server startup code
-grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the JMX server
-grant codeBase "file:${catalina.home}/bin/jmx.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to JULI
-grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the servlet API classes
-// and those that are shared across all class loaders
-// located in the "common" directory
-grant codeBase "file:${catalina.home}/common/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the container's core code, plus any additional
-// libraries installed in the "server" directory
-grant codeBase "file:${catalina.home}/server/-" {
- permission java.security.AllPermission;
-};
-
-// The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory
-grant codeBase "file:${catalina.home}/webapps/balancer/-" {
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*";
-};
-// ========== WEB APPLICATION PERMISSIONS =====================================
-
-
-// These permissions are granted by default to all web applications
-// In addition, a web application will be given a read FilePermission
-// and JndiPermission for all files and directories in its document root.
-grant {
- // Required for JNDI lookup of named JDBC DataSource's and
- // javamail named MimePart DataSource used to send mail
- permission java.util.PropertyPermission "java.home", "read";
- permission java.util.PropertyPermission "java.naming.*", "read";
- permission java.util.PropertyPermission "javax.sql.*", "read";
-
- // OS Specific properties to allow read access
- permission java.util.PropertyPermission "os.name", "read";
- permission java.util.PropertyPermission "os.version", "read";
- permission java.util.PropertyPermission "os.arch", "read";
- permission java.util.PropertyPermission "file.separator", "read";
- permission java.util.PropertyPermission "path.separator", "read";
- permission java.util.PropertyPermission "line.separator", "read";
-
- // JVM properties to allow read access
- permission java.util.PropertyPermission "java.version", "read";
- permission java.util.PropertyPermission "java.vendor", "read";
- permission java.util.PropertyPermission "java.vendor.url", "read";
- permission java.util.PropertyPermission "java.class.version", "read";
- permission java.util.PropertyPermission "java.specification.version", "read";
- permission java.util.PropertyPermission "java.specification.vendor", "read";
- permission java.util.PropertyPermission "java.specification.name", "read";
-
- permission java.util.PropertyPermission "java.vm.specification.version", "read";
- permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
- permission java.util.PropertyPermission "java.vm.specification.name", "read";
- permission java.util.PropertyPermission "java.vm.version", "read";
- permission java.util.PropertyPermission "java.vm.vendor", "read";
- permission java.util.PropertyPermission "java.vm.name", "read";
-
- // Required for OpenJMX
- permission java.lang.RuntimePermission "getAttribute";
-
- // Allow read of JAXP compliant XML parser debug
- permission java.util.PropertyPermission "jaxp.debug", "read";
-
- // Precompiled JSPs need access to this package.
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
-
-};
-
-
-// You can assign additional permissions to particular web applications by
-// adding additional "grant" entries here, based on the code base for that
-// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
-//
-// Different permissions can be granted to JSP pages, classes loaded from
-// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
-// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
-//
-// For instance, assume that the standard "examples" application
-// included a JDBC driver that needed to establish a network connection to the
-// corresponding database and used the scrape taglib to get the weather from
-// the NOAA web server. You might create a "grant" entries like this:
-//
-// The permissions granted to the context root directory apply to JSP pages.
-// grant codeBase "file:${catalina.home}/webapps/examples/-" {
-// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-//
-// The permissions granted to the context WEB-INF/classes directory
-// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
-// };
-//
-// The permission granted to your JDBC driver
-// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
-// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-// };
-// The permission granted to the scrape taglib
-// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
-// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-
+// ============================================================================
+// catalina.corepolicy - Security Policy Permissions for Tomcat 5
+//
+// This file contains a default set of security policies to be enforced (by the
+// JVM) when Catalina is executed with the "-security" option. In addition
+// to the permissions granted here, the following additional permissions are
+// granted to the codebase specific to each web application:
+//
+// * Read access to the document root directory
+//
+// $Id$
+// ============================================================================
+
+
+// ========== SYSTEM CODE PERMISSIONS =========================================
+
+
+// These permissions apply to javac
+grant codeBase "file:${java.home}/lib/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions
+grant codeBase "file:${java.home}/jre/lib/ext/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/../lib/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions when
+// ${java.home} points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/lib/ext/-" {
+ permission java.security.AllPermission;
+};
+
+
+// ========== CATALINA CODE PERMISSIONS =======================================
+
+
+// These permissions apply to the launcher code
+grant codeBase "file:${catalina.home}/bin/commons-launcher.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the daemon code
+grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the commons-logging API
+grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the server startup code
+grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the JMX server
+grant codeBase "file:${catalina.home}/bin/jmx.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to JULI
+grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the servlet API classes
+// and those that are shared across all class loaders
+// located in the "common" directory
+grant codeBase "file:${catalina.home}/common/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the container's core code, plus any additional
+// libraries installed in the "server" directory
+grant codeBase "file:${catalina.home}/server/-" {
+ permission java.security.AllPermission;
+};
+
+// The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory
+grant codeBase "file:${catalina.home}/webapps/balancer/-" {
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*";
+};
+// ========== WEB APPLICATION PERMISSIONS =====================================
+
+
+// These permissions are granted by default to all web applications
+// In addition, a web application will be given a read FilePermission
+// and JndiPermission for all files and directories in its document root.
+grant {
+ // Required for JNDI lookup of named JDBC DataSource's and
+ // javamail named MimePart DataSource used to send mail
+ permission java.util.PropertyPermission "java.home", "read";
+ permission java.util.PropertyPermission "java.naming.*", "read";
+ permission java.util.PropertyPermission "javax.sql.*", "read";
+
+ // OS Specific properties to allow read access
+ permission java.util.PropertyPermission "os.name", "read";
+ permission java.util.PropertyPermission "os.version", "read";
+ permission java.util.PropertyPermission "os.arch", "read";
+ permission java.util.PropertyPermission "file.separator", "read";
+ permission java.util.PropertyPermission "path.separator", "read";
+ permission java.util.PropertyPermission "line.separator", "read";
+
+ // JVM properties to allow read access
+ permission java.util.PropertyPermission "java.version", "read";
+ permission java.util.PropertyPermission "java.vendor", "read";
+ permission java.util.PropertyPermission "java.vendor.url", "read";
+ permission java.util.PropertyPermission "java.class.version", "read";
+ permission java.util.PropertyPermission "java.specification.version", "read";
+ permission java.util.PropertyPermission "java.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.specification.name", "read";
+
+ permission java.util.PropertyPermission "java.vm.specification.version", "read";
+ permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.specification.name", "read";
+ permission java.util.PropertyPermission "java.vm.version", "read";
+ permission java.util.PropertyPermission "java.vm.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.name", "read";
+
+ // Required for OpenJMX
+ permission java.lang.RuntimePermission "getAttribute";
+
+ // Allow read of JAXP compliant XML parser debug
+ permission java.util.PropertyPermission "jaxp.debug", "read";
+
+ // Precompiled JSPs need access to this package.
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
+
+};
+
+
+// You can assign additional permissions to particular web applications by
+// adding additional "grant" entries here, based on the code base for that
+// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
+//
+// Different permissions can be granted to JSP pages, classes loaded from
+// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
+// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
+//
+// For instance, assume that the standard "examples" application
+// included a JDBC driver that needed to establish a network connection to the
+// corresponding database and used the scrape taglib to get the weather from
+// the NOAA web server. You might create a "grant" entries like this:
+//
+// The permissions granted to the context root directory apply to JSP pages.
+// grant codeBase "file:${catalina.home}/webapps/examples/-" {
+// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+//
+// The permissions granted to the context WEB-INF/classes directory
+// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
+// };
+//
+// The permission granted to your JDBC driver
+// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
+// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+// };
+// The permission granted to the scrape taglib
+// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
+// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+
diff --git a/continuum-webapp-test/testng-pom.xml b/continuum-webapp-test/testng-pom.xml
deleted file mode 100644
index d3a0649..0000000
--- a/continuum-webapp-test/testng-pom.xml
+++ /dev/null
@@ -1,294 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <artifactId>continuum-webapp-test</artifactId>
- <name>Continuum Webapp Test</name>
- <packaging>pom</packaging>
-
- <build>
- <testSourceDirectory>src/test/testng</testSourceDirectory>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <verbose>true</verbose>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>testResources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start-server</goal>
- </goals>
- <configuration>
- <background>true</background>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <wait>false</wait>
- </configuration>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <container>
- <containerId>${container.name}</containerId>
- <zipUrlInstaller>
- <url>${container.url}</url>
- <installDir>${project.build.directory}/installs/${container.name}</installDir>
- </zipUrlInstaller>
- <log>${project.build.directory}/logs/${container.name}.log</log>
- <output>${project.build.directory}/logs/${container.name}.out</output>
- <timeout>600000</timeout>
- <systemProperties>
- <appserver.base>${project.build.directory}</appserver.base>
- <derby.system.home>${project.build.directory}</derby.system.home>
- </systemProperties>
- <dependencies>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </dependency>
- </dependencies>
- </container>
- <configuration>
- <home>${project.build.directory}/${container.name}</home>
- <type>standalone</type>
- <properties>
- <cargo.servlet.port>9595</cargo.servlet.port>
- <cargo.datasource.datasource.users>
- cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
- cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/users;create=true|
- cargo.datasource.jndi=jdbc/users|
- cargo.datasource.username=sa
- </cargo.datasource.datasource.users>
- <cargo.datasource.datasource.builds>
- cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
- cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/builds;create=true|
- cargo.datasource.jndi=jdbc/continuum|
- cargo.datasource.username=sa
- </cargo.datasource.datasource.builds>
- <cargo.resource.resource.mail>
- cargo.resource.name=mail/Session|
- cargo.resource.type=javax.mail.Session|
- cargo.resource.factory=org.apache.naming.factory.MailSessionFactory|
- cargo.resource.parameters=mail.smtp.host=localhost
- </cargo.resource.resource.mail>
- </properties>
- <deployables>
- <deployable>
- <groupId>${project.groupId}</groupId>
- <artifactId>continuum-webapp</artifactId>
- <type>war</type>
- <properties>
- <context>continuum</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/testng/config/testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.8</version>
- <scope>test</scope>
- <classifier>jdk15</classifier>
- </dependency>
-
- <!-- deployables -->
- <dependency>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum-webapp</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
-
- <!-- container dependencies -->
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.1.3.1</version>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.1</version>
- </dependency>
-
- <!-- dependencies below are for code in src/test/it -->
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.openqa.selenium.server</groupId>
- <artifactId>selenium-server</artifactId>
- <version>0.9.2</version>
- <exclusions>
- <exclusion>
- <groupId> commons-logging</groupId>
- <artifactId> commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openqa.selenium.client-drivers</groupId>
- <artifactId>selenium-java-client-driver</artifactId>
- <version>0.9.2</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId> commons-logging</groupId>
- <artifactId> commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>tomcat5x</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <container.name>tomcat5x</container.name>
- <container.url>http://apache.mirrors.redwire.net/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip
- </container.url>
- </properties>
- </profile>
- <profile>
- <id>firefox</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <browser>*firefox</browser>
- </properties>
- </profile>
- <profile>
- <id>iexplore</id>
- <properties>
- <browser>*iexplore</browser>
- </properties>
- </profile>
- <profile>
- <id>otherbrowser</id>
- <properties>
- <browser>*custom ${browserPath}</browser>
- </properties>
- </profile>
- </profiles>
-
-</project>
diff --git a/continuum-webapp/pom.xml b/continuum-webapp/pom.xml
index ba2cb4c..728c070 100644
--- a/continuum-webapp/pom.xml
+++ b/continuum-webapp/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-webapp</artifactId>
@@ -52,49 +52,12 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <!-- This configuration is added to cleanup from war:inplace -->
+ <artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/data</directory>
- </fileset>
- <fileset>
- <directory>${basedir}/src/main/webapp</directory>
- <includes>
- <!-- TODO: META-INF shouldn't be required, seems to be an issue with the current war plugin -->
- <include>META-INF</include>
- <include>images/redback</include>
- <!-- Images from other wars -->
- <include>template/</include>
- <!-- validation.js -->
- <include>template/redback</include>
- <!-- Templates from other wars -->
- <include>WEB-INF/classes</include>
- <!-- Classes and Resources from other wars -->
- <include>WEB-INF/lib</include>
- <!-- Dependencies from other wars -->
- <include>WEB-INF/database</include>
- <!-- Database location configured in application.xml -->
- <include>WEB-INF/logs</include>
- <!-- Log file location specified in application.xml -->
- <include>redback</include>
- <!-- plexus-redback css and javascript -->
- <include>css/redback</include>
- <include>WEB-INF/jsp/redback</include>
- <!-- plexus-redback jsps -->
- <include>WEB-INF/template/redback</include>
- <!-- plexus-security xwork templates -->
- <include>WEB-INF/build-output-directory</include>
- <!-- Directory created by jetty:run -->
- <include>WEB-INF/working-directory</include>
- <!-- Directory created by jetty:run -->
- <include>WEB-INF/logs</include>
- <!-- Directory created by jetty:run -->
- <include>WEB-INF/temp</include>
- <!-- Directory created by jetty:run -->
- </includes>
- </fileset>
+ </fileset>
</filesets>
</configuration>
</plugin>
@@ -105,49 +68,9 @@
<!-- Some versions of maven-war-plugin (snapshots) have this incorrectly defaulted to true.
Specifically setting this to false to avoid accidental jar file creation. -->
<archiveClasses>false</archiveClasses>
- <dependentWarExcludes>META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/**
- </dependentWarExcludes>
- </configuration>
- <!-- TODO: would be good to make the jetty plugin aware of these and remove the below -->
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <!-- Needed to get the plexus-security war overlay to do its thing before jetty:run -->
- <goal>inplace</goal>
- </goals>
- </execution>
- </executions>
+ <dependentWarExcludes>META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/**</dependentWarExcludes>
+ </configuration>
</plugin>
-
- <!--
- here an hack to prevent multiple struts core in classpath
- which prevent struts start
- and same struts.xml in the classpath too
- -->
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>cleanup-struts-jar-in-webapp</id>
- <phase>compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete includeemptydirs="true">
- <fileset dir="${basedir}/src/main/webapp/WEB-INF/lib" includes="**/struts2*.jar" />
- </delete>
- <delete includeemptydirs="true">
- <fileset dir="${basedir}/src/main/webapp/WEB-INF/classes" includes="**/struts.*" />
- </delete>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-maven-plugin</artifactId>
@@ -179,17 +102,9 @@
<execution>
<id>web summary model classes</id>
<configuration>
- <model>src/main/mdo/view-models.mdo</model>
- <version>1.0.0</version>
- </configuration>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- <execution>
- <id>session model classes</id>
- <configuration>
- <model>src/main/mdo/session-models.mdo</model>
+ <models>
+ <model>src/main/mdo/view-models.mdo</model>
+ </models>
<version>1.0.0</version>
</configuration>
<goals>
@@ -199,7 +114,9 @@
<execution>
<id>appearence model classes</id>
<configuration>
- <model>src/main/mdo/appearance-models.mdo</model>
+ <models>
+ <model>src/main/mdo/appearance-models.mdo</model>
+ </models>
<version>1.0.0</version>
</configuration>
<goals>
@@ -207,8 +124,11 @@
<goal>xpp3-reader</goal>
<goal>xpp3-writer</goal>
</goals>
- </execution>
+ </execution>
</executions>
+ <configuration>
+ <useJava5>true</useJava5>
+ </configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -233,13 +153,65 @@
-->
</configuration>
</plugin>
+
+ <!-- hack for jetty:run, continuum web config files are checked in /WEB-INF/ dir -->
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-web-config-files</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${basedir}/target/continuum/WEB-INF/" />
+ <copy todir="${basedir}/target/continuum/WEB-INF/">
+ <fileset dir="${basedir}/target" includes="classes/" excludes="**/struts.xml" />
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-redback-war</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>compile</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-struts2-content</artifactId>
+ <version>${redback.version}</version>
+ <type>war</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/redback</outputDirectory>
+ <excludes>**/struts-security.xml</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
+ <webAppConfig>
+ <contextPath>/</contextPath>
+ <baseResource implementation="org.mortbay.resource.ResourceCollection">
+ <resourcesAsCSV>src/main/webapp,target/continuum,target/redback</resourcesAsCSV>
+ </baseResource>
+ </webAppConfig>
<scanIntervalSeconds>10</scanIntervalSeconds>
- <contextPath>/</contextPath>
- <jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
+ <jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9090</port>
@@ -259,7 +231,7 @@
<name>derby.system.home</name>
<value>${project.build.directory}/appserver-base/logs</value>
</systemProperty>
- </systemProperties>
+ </systemProperties>
</configuration>
<dependencies>
<dependency>
@@ -391,10 +363,6 @@
<artifactId>maven-app-configuration-web</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.maven.release</groupId>
- <artifactId>maven-release-manager</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-builder</artifactId>
</dependency>
@@ -446,6 +414,10 @@
<scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>com.atlassian.xmlrpc</groupId>
<artifactId>atlassian-xmlrpc-binder-server-spring</artifactId>
<scope>runtime</scope>
@@ -489,7 +461,7 @@
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-svn-commons</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.maven.release</groupId>
<artifactId>maven-release-manager</artifactId>
@@ -594,6 +566,7 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/AbstractReleaseAction.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/AbstractReleaseAction.java
index f1b8ae3..661d428 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/action/AbstractReleaseAction.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/AbstractReleaseAction.java
@@ -24,6 +24,9 @@
import java.util.List;
import java.util.Map;
+import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.release.distributed.DistributedReleaseUtil;
import org.apache.maven.continuum.installation.InstallationService;
import org.apache.maven.continuum.model.system.Installation;
import org.apache.maven.continuum.model.system.Profile;
@@ -33,7 +36,7 @@
public class AbstractReleaseAction
extends ContinuumActionSupport
{
- protected Map<String, String> getEnvironments( Profile profile )
+ protected Map<String, String> getEnvironments( Profile profile, String defaultBuildagent )
{
if ( profile == null )
{
@@ -41,6 +44,35 @@
}
Map<String, String> envVars = new HashMap<String, String>();
+
+ if ( defaultBuildagent != null && defaultBuildagent.length() > 0 )
+ {
+ // get buildagent to be used from the buildagent group for distributed builds setup
+ BuildAgentGroupConfiguration group = getContinuum().getConfiguration().getBuildAgentGroup( profile.getBuildAgentGroup() );
+
+ if ( group != null )
+ {
+ List<BuildAgentConfiguration> agents = group.getBuildAgents();
+ if ( agents != null )
+ {
+ if ( isDefaultBuildAgentEnabledInGroup( defaultBuildagent, agents ) )
+ {
+ envVars.put( DistributedReleaseUtil.KEY_BUILD_AGENT_URL, defaultBuildagent );
+ }
+ else
+ {
+ for ( BuildAgentConfiguration agent : agents )
+ {
+ if ( agent.isEnabled() == true )
+ {
+ envVars.put( DistributedReleaseUtil.KEY_BUILD_AGENT_URL, agent.getUrl() );
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
String javaHome = getJavaHomeValue( profile );
if ( !StringUtils.isEmpty( javaHome ) )
@@ -61,6 +93,25 @@
}
return envVars;
}
+
+ private boolean isDefaultBuildAgentEnabledInGroup( String defaultBuildagent, List<BuildAgentConfiguration> agents )
+ {
+ boolean isInGroup = false;
+
+ for ( BuildAgentConfiguration agent : agents )
+ {
+ if ( agent.isEnabled() == true )
+ {
+ if ( defaultBuildagent.equals( agent.getUrl() ) )
+ {
+ isInGroup = true;
+ break;
+ }
+ }
+ }
+
+ return isInGroup;
+ }
private String getJavaHomeValue( Profile profile )
{
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
index 3f3c5b3..01314c0 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
@@ -61,6 +61,8 @@
private String projectName;
private String releaseGoal;
+
+ private String username;
public String list()
throws ContinuumException
@@ -142,6 +144,7 @@
releaseGoal = releaseResult.getReleaseGoal();
projectName = releaseResult.getProject().getName();
+ username = releaseResult.getUsername();
try
{
@@ -282,4 +285,14 @@
{
this.releaseGoal = releaseGoal;
}
+
+ public void setUsername( String username )
+ {
+ this.username = username;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
index cf5d0d8..4fdd861 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
@@ -22,6 +22,8 @@
import org.apache.continuum.configuration.BuildAgentConfiguration;
import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.system.Installation;
@@ -52,11 +54,6 @@
{
private static final Logger logger = LoggerFactory.getLogger( BuildAgentAction.class );
- /**
- * @plexus.requirement
- */
- private DistributedBuildManager distributedBuildManager;
-
private List<BuildAgentConfiguration> buildAgents;
private BuildAgentConfiguration buildAgent;
@@ -139,7 +136,7 @@
try
{
- installations = distributedBuildManager.getAvailableInstallations( buildAgent.getUrl() );
+ installations = getContinuum().getDistributedBuildManager().getAvailableInstallations( buildAgent.getUrl() );
}
catch ( ContinuumException e )
{
@@ -170,14 +167,21 @@
agent.setEnabled( buildAgent.isEnabled() );
configuration.updateBuildAgent( agent );
+ configuration.store();
found = true;
}
}
}
+ AuditLog event = new AuditLog( "Build Agent URL=" + buildAgent.getUrl(), AuditLogConstants.MODIFY_BUILD_AGENT );
+ event.setCategory( AuditLogConstants.BUILD_AGENT );
+ event.setCurrentUser( getPrincipal() );
+
if ( !found )
{
configuration.addBuildAgent( buildAgent );
+ configuration.store();
+ event.setAction( AuditLogConstants.ADD_BUILD_AGENT );
}
else
{
@@ -188,7 +192,8 @@
}
}
- distributedBuildManager.reload();
+ getContinuum().getDistributedBuildManager().reload();
+ event.log();
return SUCCESS;
}
@@ -201,33 +206,45 @@
return CONFIRM;
}
- if ( distributedBuildManager.isBuildAgentBusy( buildAgent.getUrl() ) )
+ if ( getContinuum().getDistributedBuildManager().isBuildAgentBusy( buildAgent.getUrl() ) )
{
message = getText( "buildAgent.error.delete.busy" );
return ERROR;
}
- else
- {
- distributedBuildManager.removeAgentFromTaskQueueExecutor( buildAgent.getUrl() );
- }
ConfigurationService configuration = getContinuum().getConfiguration();
- for ( BuildAgentGroupConfiguration buildAgentGroup : configuration.getBuildAgentGroups() )
- {
- if ( configuration.containsBuildAgentUrl( buildAgent.getUrl(), buildAgentGroup ) )
+ if ( configuration.getBuildAgentGroups() != null )
+ {
+ for ( BuildAgentGroupConfiguration buildAgentGroup : configuration.getBuildAgentGroups() )
{
- message = getText( "buildAgent.error.remove.in.use" );
- return ERROR;
+ if ( configuration.containsBuildAgentUrl( buildAgent.getUrl(), buildAgentGroup ) )
+ {
+ message = getText( "buildAgent.error.remove.in.use" );
+ return ERROR;
+ }
}
}
- for ( BuildAgentConfiguration agent : configuration.getBuildAgents() )
+ if ( configuration.getBuildAgents() != null )
{
- if ( buildAgent.getUrl().equals( agent.getUrl() ) )
+ for ( BuildAgentConfiguration agent : configuration.getBuildAgents() )
{
- configuration.removeBuildAgent( agent );
- return SUCCESS;
+ if ( buildAgent.getUrl().equals( agent.getUrl() ) )
+ {
+ getContinuum().getDistributedBuildManager().removeDistributedBuildQueueOfAgent( buildAgent.getUrl() );
+ configuration.removeBuildAgent( agent );
+ configuration.store();
+
+ AuditLog event = new AuditLog( "Build Agent URL=" + agent.getUrl(), AuditLogConstants.REMOVE_BUILD_AGENT );
+ event.setCategory( AuditLogConstants.BUILD_AGENT );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
+
+ getContinuum().getDistributedBuildManager().reload();
+
+ return SUCCESS;
+ }
}
}
@@ -260,6 +277,12 @@
if ( buildAgentGroup.getName().equals( group.getName() ) )
{
configuration.removeBuildAgentGroup( group );
+
+ AuditLog event = new AuditLog( "Build Agent Group=" + group.getName(), AuditLogConstants.REMOVE_BUILD_AGENT_GROUP );
+ event.setCategory( AuditLogConstants.BUILD_AGENT );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
+
return SUCCESS;
}
}
@@ -304,10 +327,15 @@
}
}
+ AuditLog event = new AuditLog( "Build Agent Group=" + buildAgentGroup.getName(), AuditLogConstants.MODIFY_BUILD_AGENT_GROUP );
+ event.setCategory( AuditLogConstants.BUILD_AGENT );
+ event.setCurrentUser( getPrincipal() );
+
if ( !found )
{
buildAgentGroup.setBuildAgents( selectedbuildAgents );
configuration.addBuildAgentGroup( buildAgentGroup );
+ event.setAction( AuditLogConstants.ADD_BUILD_AGENT_GROUP );
}
else
// found
@@ -324,7 +352,8 @@
}
}
- distributedBuildManager.reload();
+ getContinuum().getDistributedBuildManager().reload();
+ event.log();
return SUCCESS;
}
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/LocalRepositoryAction.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/LocalRepositoryAction.java
index 4b738a1..4c69a74 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/LocalRepositoryAction.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/LocalRepositoryAction.java
@@ -30,6 +30,8 @@
import org.apache.continuum.purge.PurgeConfigurationService;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.security.ContinuumRoleConstants;
import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
@@ -68,9 +70,7 @@
private List<String> layouts;
private Map<String, Boolean> defaultPurgeMap;
-
- private String message;
-
+
/**
* @plexus.requirement
*/
@@ -112,13 +112,6 @@
public String list()
throws Exception
{
- String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage" );
-
- if ( errorMessage != null )
- {
- addActionError( getText( errorMessage ) );
- }
-
repositories = repositoryService.getAllLocalRepositories();
defaultPurgeMap = new HashMap<String, Boolean>();
@@ -150,12 +143,12 @@
{
if ( repository.getId() != repo.getId() )
{
- if ( repository.getName().equals( repo.getName() ) )
+ if ( repository.getName().trim().equals( repo.getName() ) )
{
addActionError( getText( "repository.error.name.unique" ) );
}
- if ( repository.getLocation().equals( repo.getLocation() ) )
+ if ( repository.getLocation().trim().equals( repo.getLocation() ) )
{
addActionError( getText( "repository.error.location.unique" ) );
}
@@ -177,6 +170,10 @@
return INPUT;
}
+ // trim repository name and location before saving
+ repository.setName( repository.getName().trim() );
+ repository.setLocation( repository.getLocation().trim() );
+
if ( repository.getId() == 0 )
{
repository = repositoryService.addLocalRepository( repository );
@@ -209,29 +206,31 @@
throws Exception
{
TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();
+
+ repository = repositoryService.getLocalRepository( repository.getId() );
+
if ( taskQueueManager.isRepositoryInUse( repository.getId() ) )
{
- message = "repository.error.remove.in.use";
- return ERROR;
+ addActionError( getText( "repository.error.remove.in.use", "Unable to remove local repository because it is in use" ) );
}
-
- repository = repositoryService.getLocalRepository( repository.getId() );
-
+
if ( repository.getName().equals( "DEFAULT" ) )
{
- message = "repository.error.remove.default";
- return ERROR;
+ addActionError( getText( "repository.error.remove.default", "Unable to remove default local repository" ) );
}
-
- if ( confirmed )
+
+ if ( !hasActionErrors() )
{
- repositoryService.removeLocalRepository( repository.getId() );
+ if ( confirmed )
+ {
+ repositoryService.removeLocalRepository( repository.getId() );
+ }
+ else
+ {
+ return CONFIRM;
+ }
}
- else
- {
- return CONFIRM;
- }
-
+
return SUCCESS;
}
@@ -244,18 +243,24 @@
// check if repository is in use
if ( taskQueueManager.isRepositoryInUse( repository.getId() ) )
{
- message = "repository.error.purge.in.use";
- return ERROR;
+ addActionError( getText( "repository.error.purge.in.use", "Unable to purge repository because it is in use" ) );
}
-
- // get default purge configuration for repository
- RepositoryPurgeConfiguration purgeConfig = purgeConfigService.getDefaultPurgeConfigurationForRepository( repository.getId() );
-
- if ( purgeConfig != null )
+
+ if ( !hasActionErrors() )
{
- purgeManager.purgeRepository( purgeConfig );
- }
+ // get default purge configuration for repository
+ RepositoryPurgeConfiguration purgeConfig = purgeConfigService.getDefaultPurgeConfigurationForRepository( repository.getId() );
+ if ( purgeConfig != null )
+ {
+ purgeManager.purgeRepository( purgeConfig );
+
+ AuditLog event = new AuditLog( "Repository id=" + repository.getId(), AuditLogConstants.PURGE_LOCAL_REPOSITORY );
+ event.setCategory( AuditLogConstants.LOCAL_REPOSITORY );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
+ }
+ }
return SUCCESS;
}
@@ -323,17 +328,7 @@
{
this.defaultPurgeMap = defaultPurgeMap;
}
-
- public String getMessage()
- {
- return this.message;
- }
-
- public void setMessage( String message )
- {
- this.message = message;
- }
-
+
private void createDefaultPurgeConfiguration()
throws Exception
{
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
index 4d08da4..5308ffe 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
@@ -35,15 +35,19 @@
import org.apache.continuum.purge.PurgeConfigurationService;
import org.apache.continuum.repository.RepositoryService;
import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.maven.continuum.build.settings.SchedulesActivationException;
import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.Schedule;
import org.apache.maven.continuum.security.ContinuumRoleConstants;
import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
+import org.apache.maven.continuum.web.action.ScheduleAction;
import org.apache.struts2.ServletActionContext;
import org.codehaus.plexus.redback.rbac.Resource;
import org.codehaus.redback.integration.interceptor.SecureAction;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
import org.codehaus.redback.integration.interceptor.SecureActionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Maria Catherine Tan
@@ -55,6 +59,8 @@
extends ContinuumConfirmAction
implements Preparable, SecureAction
{
+ private static final Logger logger = LoggerFactory.getLogger( PurgeConfigurationAction.class );
+
private static final String PURGE_TYPE_REPOSITORY = "repository";
private static final String PURGE_TYPE_DIRECTORY = "directory";
@@ -117,6 +123,7 @@
*/
private RepositoryService repositoryService;
+ @Override
public void prepare()
throws Exception
{
@@ -153,6 +160,7 @@
directoryTypes.add( PURGE_DIRECTORY_BUILDOUTPUT );
}
+ @Override
public String input()
throws Exception
{
@@ -258,6 +266,11 @@
updateDefaultPurgeConfiguration();
}
+ if ( purgeConfig.isEnabled() && purgeConfig.getSchedule() != null )
+ {
+ getContinuum().activePurgeSchedule( purgeConfig.getSchedule() );
+ }
+
return SUCCESS;
}
@@ -379,11 +392,13 @@
this.enabled = enabled;
}
+ @Override
public boolean isConfirmed()
{
return this.confirmed;
}
+ @Override
public void setConfirmed( boolean confirmed )
{
this.confirmed = confirmed;
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java b/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java
new file mode 100644
index 0000000..394cad1
--- /dev/null
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/action/error/HttpError.java
@@ -0,0 +1,51 @@
+package org.apache.continuum.web.action.error;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+
+/**
+ * AboutAction:
+ *
+ * @author: Emmanuel Venisse <evenisse@apache.org>
+ * @version: $Id:$
+ * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="httpError"
+ */
+public class HttpError
+ extends ContinuumActionSupport
+{
+ private int errorCode;
+
+ public String execute()
+ throws Exception
+ {
+ return SUCCESS;
+ }
+
+ public int getErrorCode()
+ {
+ return errorCode;
+ }
+
+ public void setErrorCode( int errorCode )
+ {
+ this.errorCode = errorCode;
+ }
+}
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java b/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
index 12c0092..9d11c35 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
@@ -82,12 +82,5 @@
DistributedBuildManager distributedBuildManager = (DistributedBuildManager) wac.getBean( PlexusToSpringUtils
.buildSpringId( DistributedBuildManager.class ) );
-
- TaskQueueExecutor distributedBuildProjectOverall = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
- .buildSpringId( TaskQueueExecutor.class, "distributed-build-project-overall" ) );
-
- TaskQueueExecutor distributedBuildProjectDeferred = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
- .buildSpringId( TaskQueueExecutor.class, "distributed-build-project-deferred" ) );
}
-
}
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java b/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java
index c7d949c..21be799 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java
@@ -36,6 +36,14 @@
public static final String PROJECT_GROUP = "PROJECT_GROUP";
+ public static final String BUILD_RESULT = "BUILD_RESULT";
+
+ public static final String BUILD_QUEUE = "BUILD_QUEUE";
+
+ public static final String BUILD_AGENT = "BUILD_AGENT";
+
+ public static final String LOCAL_REPOSITORY = "LOCAL_REPOSITORY";
+
// events
public static final String FORCE_BUILD = "Forced Project Build";
@@ -51,6 +59,12 @@
public static final String ADD_M2_PROJECT = "Added M2 Project";
+ public static final String ADD_M2_PROJECT_FAILED = "Failed Adding M2 Project";
+
+ public static final String ADD_M1_PROJECT = "Added M1 Project";
+
+ public static final String ADD_M1_PROJECT_FAILED = "Failed Adding M1 Project";
+
public static final String ADD_PROJECT = "Added Project";
public static final String MODIFY_PROJECT = "Modified Project";
@@ -80,5 +94,25 @@
public static final String MODIFY_TEMPLATE = "Modified Build Definition Template";
public static final String REMOVE_TEMPLATE = "Removed Build Definition Template";
+
+ public static final String REMOVE_BUILD_RESULT = "Removed Build Result";
+
+ public static final String ADD_BUILD_QUEUE = "Added Build Queue";
+
+ public static final String REMOVE_BUILD_QUEUE = "Removed Build Queue";
+
+ public static final String PURGE_LOCAL_REPOSITORY = "Purged Local Repository";
+
+ public static final String ADD_BUILD_AGENT = "Added Build Agent";
+
+ public static final String ADD_BUILD_AGENT_GROUP = "Added Build Agent Group";
+
+ public static final String MODIFY_BUILD_AGENT = "Modified Build Agent";
+
+ public static final String MODIFY_BUILD_AGENT_GROUP = "Modified Build Agent Group";
+
+ public static final String REMOVE_BUILD_AGENT = "Removed Build Agent";
+
+ public static final String REMOVE_BUILD_AGENT_GROUP = "Removed Build Agent Group";
}
diff --git a/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java b/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java
index d84f92e..ee04feb 100644
--- a/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java
+++ b/continuum-webapp/src/main/java/org/apache/continuum/web/util/GenerateRecipentNotifier.java
@@ -62,6 +62,15 @@
}
}
}
+ if (StringUtils.isNotEmpty(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD))) {
+ if (Boolean.parseBoolean(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD))) {
+ if ("unknown".equals(recipent)) {
+ recipent = "project developers";
+ } else {
+ recipent += ", " + "project developers";
+ }
+ }
+ }
}
if ( "irc".equals( notifier.getType() ) )
{
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AboutAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AboutAction.java
index f59e848..0e210a2 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AboutAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AboutAction.java
@@ -23,7 +23,7 @@
* AboutAction:
*
* @author: Jesse McConnell <jmcconnell@apache.org>
- * @version: $ID:$
+ * @version: $Id$
* @plexus.component role="com.opensymphony.xwork2.Action"
* role-hint="about"
*/
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java
index 23fe71a..35e223b 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java
@@ -22,6 +22,7 @@
import java.util.Set;
import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.project.ContinuumProjectState;
@@ -41,7 +42,9 @@
protected boolean canRemoveBuildResult( BuildResult buildResult )
throws BuildManagerException
{
- Map<String, BuildProjectTask> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
+ BuildsManager buildsManager = getContinuum().getBuildsManager();
+
+ Map<String, BuildProjectTask> currentBuilds = buildsManager.getCurrentBuilds();
Set<String> keySet = currentBuilds.keySet();
for ( String key : keySet )
{
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
index f695d1f..4dcc8d1 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
@@ -21,6 +21,8 @@
import java.io.File;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -40,8 +42,21 @@
boolean scmUseCache )
throws ContinuumException
{
- return getContinuum().addMavenOneProject( pomUrl, selectedProjectGroup, checkProtocol, scmUseCache,
+ ContinuumProjectBuildingResult result = getContinuum().addMavenOneProject( pomUrl, selectedProjectGroup, checkProtocol, scmUseCache,
this.getBuildDefinitionTemplateId() );
+
+ AuditLog event = new AuditLog( hidePasswordInUrl( pomUrl ), AuditLogConstants.ADD_M1_PROJECT );
+ event.setCategory( AuditLogConstants.PROJECT );
+ event.setCurrentUser( getPrincipal() );
+
+ if ( result == null || result.hasErrors() )
+ {
+ event.setAction( AuditLogConstants.ADD_M1_PROJECT_FAILED );
+ }
+
+ event.log();
+
+ return result;
}
/**
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
index d3bcfa5..d06aafe 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
@@ -291,6 +291,22 @@
return INPUT;
}
+ protected String hidePasswordInUrl( String url )
+ {
+ int indexAt = url.indexOf( "@" );
+
+ if ( indexAt < 0 )
+ {
+ return url;
+ }
+
+ String s = url.substring( 0, indexAt );
+
+ int pos = s.lastIndexOf( ":" );
+
+ return s.substring( 0, pos + 1 ) + "*****" + url.substring( indexAt );
+ }
+
private void initializeProjectGroupName()
{
if ( disableGroupSelection && selectedProjectGroup != DEFINED_BY_POM_GROUP_ID )
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
index 249978e..35c49a6 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
@@ -53,8 +53,6 @@
public static final String FILE_SCHEME = "file:/";
private boolean nonRecursiveProject;
-
- private boolean checkoutInSingleDirectory;
protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup, boolean checkProtocol,
boolean scmUseCache )
@@ -106,26 +104,23 @@
}
}
- // force set checkoutInCingleDirectory to false if adding the project as non-recursive
- if( this.isNonRecursiveProject() )
- {
- this.setCheckoutInSingleDirectory( false );
- }
-
if ( result == null )
{
result = getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup, checkProtocol, scmUseCache,
!this.isNonRecursiveProject(),
- this.getBuildDefinitionTemplateId(), this.isCheckoutInSingleDirectory() );
+ this.getBuildDefinitionTemplateId() );
}
-
- String projectUrl = hidePasswordInUrl( pomUrl );
-
- AuditLog event = new AuditLog( projectUrl, AuditLogConstants.ADD_M2_PROJECT );
+
+ AuditLog event = new AuditLog( hidePasswordInUrl( pomUrl ), AuditLogConstants.ADD_M2_PROJECT );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
- event.log();
+ if ( result == null || result.hasErrors() )
+ {
+ event.setAction( AuditLogConstants.ADD_M2_PROJECT_FAILED );
+ }
+
+ event.log();
return result;
}
@@ -170,42 +165,4 @@
{
this.nonRecursiveProject = nonRecursiveProject;
}
-
- public boolean isCheckoutInSingleDirectory()
- {
- return checkoutInSingleDirectory;
- }
-
- public void setCheckoutInSingleDirectory( boolean checkoutInSingleDirectory )
- {
- this.checkoutInSingleDirectory = checkoutInSingleDirectory;
- }
-
- private String hidePasswordInUrl( String pomUrl )
- {
- String projectUrl = pomUrl;
-
- int idx = projectUrl.indexOf( "@" );
-
- if ( idx > 0 )
- {
- int pwdIndex = projectUrl.lastIndexOf( ":" );
-
- if ( ( pwdIndex > 0 ) && ( pwdIndex > projectUrl.indexOf( "://" ) ) )
- {
- String password = projectUrl.substring( pwdIndex, idx + 1 );
-
- String newPwd = "@";
-
- if ( ( password.length() ) > 2 )
- {
- newPwd = ":*****@";
- }
-
- projectUrl = projectUrl.replace( password, newPwd );
- }
- }
-
- return projectUrl;
- }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
index dec748a..98b7d2c 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
@@ -87,24 +87,26 @@
private List<BuildDefinitionTemplate> buildDefinitionTemplates;
+ private boolean emptyProjectGroups;
+
public void validate()
{
clearErrorsAndMessages();
try
{
- if ( !( projectName.trim().length() > 0 ) )
+ if ( ( projectName != null ) && !( projectName.trim().length() > 0 ) )
{
addActionError( getText( "addProject.name.required" ) );
}
- if ( !( projectVersion.trim().length() > 0 ) )
+ if ( ( projectVersion != null ) && !( projectVersion.trim().length() > 0 ) )
{
addActionError( getText( "addProject.version.required" ) );
}
- if ( !( projectScmUrl.trim().length() > 0 ) )
+ if ( ( projectScmUrl != null ) && !( projectScmUrl.trim().length() > 0 ) )
{
addActionError( getText( "addProject.scmUrl.required" ) );
}
- if ( selectedProjectGroup == 0 )
+ if ( isEmptyProjectGroups() )
{
addActionError( getText( "addProject.projectGroup.required" ) );
}
@@ -148,6 +150,7 @@
String projectNameTrim = projectName.trim();
String versionTrim = projectVersion.trim();
String scmTrim = projectScmUrl.trim();
+ //TODO: Instead of get all projects then test them, it would be better to check it directly in the DB
for ( Project project : getContinuum().getProjects() )
{
// CONTINUUM-1445
@@ -190,8 +193,8 @@
this.setProjectGroupId( this.getSelectedProjectGroup() );
return "projectGroupSummary";
}
-
- AuditLog event = new AuditLog( projectNameTrim, AuditLogConstants.ADD_PROJECT );
+
+ AuditLog event = new AuditLog( "Project id=" + project.getId(), AuditLogConstants.ADD_PROJECT );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
@@ -433,4 +436,14 @@
{
this.projectDescription = projectDescription;
}
+
+ public boolean isEmptyProjectGroups()
+ {
+ return emptyProjectGroups;
+ }
+
+ public void setEmptyProjectGroups( boolean emptyProjectGroups )
+ {
+ this.emptyProjectGroups = emptyProjectGroups;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
index 3f90151..a33b8b7 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
@@ -154,7 +154,7 @@
return ERROR;
}
- AuditLog event = new AuditLog( name, AuditLogConstants.ADD_PROJECT_GROUP );
+ AuditLog event = new AuditLog( "Project Group id=" + projectGroup.getId(), AuditLogConstants.ADD_PROJECT_GROUP );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
index 707f02a..5c87603 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
@@ -28,6 +28,7 @@
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
+import org.apache.maven.continuum.builddefinition.BuildDefinitionUpdatePolicyConstants;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
@@ -92,6 +93,10 @@
private String buildDefinitionType;
private boolean alwaysBuild;
+
+ private int updatePolicy = BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ALWAYS;
+
+ private Map<Integer, String> buildDefinitionUpdatePolicies;
/**
* @plexus.requirement
@@ -127,6 +132,15 @@
buildDefinitionTypes.add( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR );
buildDefinitionTypes.add( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
buildDefinitionTypes.add( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
+
+ buildDefinitionUpdatePolicies = new HashMap<Integer, String>();
+ String text = getText( "buildDefinition.updatePolicy.always" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ALWAYS, text );
+ text = getText( "buildDefinition.updatePolicy.never" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_NEVER, text );
+ text = getText( "buildDefinition.updatePolicy.newPom" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ONLY_FOR_NEW_POM,
+ text );
}
/**
@@ -184,6 +198,7 @@
description = buildDefinition.getDescription();
buildDefinitionType = buildDefinition.getType();
alwaysBuild = buildDefinition.isAlwaysBuild();
+ updatePolicy = buildDefinition.getUpdatePolicy();
}
else
{
@@ -315,7 +330,7 @@
return REQUIRES_AUTHORIZATION;
}
- String resource = getProjectGroupName() + ":" + goals + " " + arguments;
+ String resource = "Project id=" + projectId + ":" + goals + " " + arguments;
AuditLog event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
event.setCategory( AuditLogConstants.BUILD_DEFINITION );
event.setCurrentUser( getPrincipal() );
@@ -367,7 +382,7 @@
if ( projectId != 0 )
{
- String resource = getProjectGroupName() + ":" + goals + " " + arguments;
+ String resource = "Project id=" + projectId + ":" + goals + " " + arguments;
AuditLog event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
event.setCategory( AuditLogConstants.BUILD_DEFINITION );
event.setCurrentUser( getPrincipal() );
@@ -376,6 +391,11 @@
}
else
{
+ String resource = "Project Group id=" + projectGroupId + ":" + goals + " " + arguments;
+ AuditLog event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
+ event.setCategory( AuditLogConstants.BUILD_DEFINITION );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
return "success_group";
}
}
@@ -391,7 +411,7 @@
{
getContinuum().removeBuildDefinitionFromProject( projectId, buildDefinitionId );
- String resource = getProjectGroupName() + ":" + goals + " " + arguments;
+ String resource = "Project id=" + projectId + ":" + goals + " " + arguments;
AuditLog event = new AuditLog( resource, AuditLogConstants.REMOVE_GOAL );
event.setCategory( AuditLogConstants.BUILD_DEFINITION );
event.setCurrentUser( getPrincipal() );
@@ -425,7 +445,7 @@
{
getContinuum().removeBuildDefinitionFromProjectGroup( projectGroupId, buildDefinitionId );
- String resource = getProjectGroupName() + ":" + goals + " " + arguments;
+ String resource = "Project Group id=" + projectGroupId + ":" + goals + " " + arguments;
AuditLog event = new AuditLog( resource, AuditLogConstants.REMOVE_GOAL );
event.setCategory( AuditLogConstants.BUILD_DEFINITION );
event.setCurrentUser( getPrincipal() );
@@ -487,6 +507,7 @@
buildDefinition.setDescription( description );
buildDefinition.setType( buildDefinitionType );
buildDefinition.setAlwaysBuild( alwaysBuild );
+ buildDefinition.setUpdatePolicy( updatePolicy );
return buildDefinition;
}
@@ -705,4 +726,18 @@
this.groupBuildView = groupBuildView;
}
+ public int getUpdatePolicy()
+ {
+ return updatePolicy;
+ }
+
+ public void setUpdatePolicy( int updatePolicy )
+ {
+ this.updatePolicy = updatePolicy;
+ }
+
+ public Map<Integer, String> getBuildDefinitionUpdatePolicies()
+ {
+ return buildDefinitionUpdatePolicies;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
index 11aa3e6..1dff88f 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
@@ -20,7 +20,12 @@
*/
import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.continuum.web.util.AuditLog;
import org.apache.continuum.web.util.AuditLogConstants;
import org.codehaus.plexus.util.StringUtils;
@@ -56,30 +61,45 @@
{
return REQUIRES_AUTHORIZATION;
}
-
- if ( projectId > 0 )
- {
- if ( buildDefinitionId > 0 )
- {
- getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId );
- }
- else
- {
- getContinuum().buildProject( projectId );
- }
- }
- else
- {
- if ( buildDefinitionId > 0 )
- {
- getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId );
- }
- else
- {
- getContinuum().buildProjects();
- }
- }
+ BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );
+
+ try
+ {
+ if ( projectId > 0 )
+ {
+ if ( buildDefinitionId > 0 )
+ {
+ getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId, buildTrigger );
+ }
+ else
+ {
+ getContinuum().buildProject( projectId, buildTrigger.getUsername() );
+ }
+ }
+ else
+ {
+ if ( buildDefinitionId > 0 )
+ {
+ getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId, buildTrigger );
+ }
+ else
+ {
+ //TODO: Check if this code is called, I don't think
+ //If it is, it should used the projectId
+ getContinuum().buildProjects( buildTrigger.getUsername() );
+ }
+ }
+ }
+ catch ( NoBuildAgentException e )
+ {
+ addActionError( getText( "projectGroup.build.error.noBuildAgent" ) );
+ }
+ catch ( NoBuildAgentInGroupException e )
+ {
+ addActionError( getText( "projectGroup.build.error.noBuildAgentInGroup" ) );
+ }
+
AuditLog event = new AuditLog( AuditLogConstants.FORCE_BUILD );
event.setCurrentUser( getPrincipal() );
@@ -89,7 +109,7 @@
event.setCategory( AuditLogConstants.PROJECT );
event.log();
- if ( fromGroupPage )
+ if ( fromGroupPage || hasActionErrors() )
{
return "to_group_page";
}
@@ -103,6 +123,10 @@
event.setResource( "Project Group id=" + projectGroupId );
event.setCategory( AuditLogConstants.PROJECT_GROUP );
event.log();
+ if ( fromGroupPage )
+ {
+ return "to_group_page";
+ }
}
return SUCCESS;
@@ -169,7 +193,10 @@
}
else
{
- projectGroupName = getContinuum().getProjectGroupByProjectId( projectId ).getName();
+ ProjectGroup projectGroup = getContinuum().getProjectGroupByProjectId( projectId );
+
+ projectGroupName = projectGroup.getName();
+ projectGroupId = projectGroup.getId();
}
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
index f4c044d..a8c19d2 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
@@ -30,8 +30,12 @@
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.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
+import org.apache.continuum.buildmanager.BuildManagerException;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.configuration.ConfigurationException;
+import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.scm.ChangeSet;
@@ -90,9 +94,14 @@
// check if there are surefire results to display
project = getContinuum().getProject( getProjectId() );
- if ( getContinuum().getConfiguration().isDistributedBuildEnabled() &&
- project.getState() == ContinuumProjectState.BUILDING )
+ ConfigurationService configuration = getContinuum().getConfiguration();
+
+ // view build result of the current build from the distributed build agent
+ if ( configuration.isDistributedBuildEnabled() &&
+ project.getState() == ContinuumProjectState.BUILDING && getBuildId() == 0 )
{
+ // if the project is currently building in distributed build agent, the build result will be stored in the database after the build is finished.
+ // it's safe to assume that the build result will be null at this point
Map<String, Object> map = distributedBuildManager.getBuildResult( project.getId() );
if ( map == null )
@@ -107,6 +116,12 @@
buildResult = ContinuumBuildConstant.getBuildResult( map, null );
buildOutput = ContinuumBuildConstant.getBuildOutput( map );
+
+ if ( ServletActionContext.getRequest() != null )
+ {
+ state =
+ StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
+ }
}
changeSet = null;
@@ -120,15 +135,18 @@
// directory contains files ?
File surefireReportsDirectory =
- getContinuum().getConfiguration().getTestReportsDirectory( buildId, getProjectId() );
+ configuration.getTestReportsDirectory( buildId, getProjectId() );
File[] files = surefireReportsDirectory.listFiles();
hasSurefireResults = files != null && files.length > 0;
changeSet = getContinuum().getChangesSinceLastSuccess( getProjectId(), getBuildId() );
buildOutput = getBuildOutputText();
- state =
- StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
+ if ( ServletActionContext.getRequest() != null )
+ {
+ state =
+ StateGenerator.generate( buildResult.getState(), ServletActionContext.getRequest().getContextPath() );
+ }
this.setCanDelete( this.canRemoveBuildResult( buildResult ) );
}
@@ -149,7 +167,32 @@
}
if ( this.isConfirmed() )
{
- getContinuum().removeBuildResult( buildId );
+ try
+ {
+ if ( canRemoveBuildResult( getContinuum().getBuildResult( buildId ) ) )
+ {
+ getContinuum().removeBuildResult( buildId );
+ }
+ else
+ {
+ addActionError( getText( "buildResult.cannot.delete" ) );
+ }
+ }
+ catch ( ContinuumException e )
+ {
+ addActionError( getText( "buildResult.delete.error", "Unable to delete build result",
+ new Integer( buildId ).toString() ) );
+ }
+ catch ( BuildManagerException e )
+ {
+ throw new ContinuumException( e.getMessage(), e );
+ }
+
+ AuditLog event = new AuditLog( "Build Result id=" + buildId, AuditLogConstants.REMOVE_BUILD_RESULT );
+ event.setCategory( AuditLogConstants.BUILD_RESULT );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
+
return SUCCESS;
}
@@ -174,7 +217,8 @@
private String getBuildOutputText()
throws ConfigurationException, IOException
{
- File buildOutputFile = getContinuum().getConfiguration().getBuildOutputFile( getBuildId(), getProjectId() );
+ ConfigurationService configuration = getContinuum().getConfiguration();
+ File buildOutputFile = configuration.getBuildOutputFile( getBuildId(), getProjectId() );
if ( buildOutputFile.exists() )
{
@@ -244,4 +288,10 @@
{
return projectGroupId;
}
+
+ // for testing
+ public void setDistributedBuildManager( DistributedBuildManager distributedBuildManager )
+ {
+ this.distributedBuildManager = distributedBuildManager;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
index ad03880..99a3775 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
@@ -24,6 +24,8 @@
import java.util.List;
import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
@@ -99,11 +101,17 @@
logger.info( "Removing BuildResult with id=" + buildId );
getContinuum().removeBuildResult( buildId );
+
+ AuditLog event = new AuditLog( "Build Result id=" + buildId, AuditLogConstants.REMOVE_BUILD_RESULT );
+ event.setCategory( AuditLogConstants.BUILD_RESULT );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
}
catch ( ContinuumException e )
{
logger.error( "Error removing BuildResult with id=" + buildId );
- addActionError( getText( "Unable to remove BuildResult with id=" + buildId ) );
+ addActionError( getText( "buildResult.delete.error", "Unable to delete build result",
+ new Integer( buildId ).toString() ) );
}
}
}
@@ -127,6 +135,7 @@
else
{
this.addActionMessage( getResourceBundle().getString( "buildResult.cannot.delete" ) );
+ return SUCCESS;
}
}
catch ( BuildManagerException e )
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
index 5fbf440..9853c05 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
@@ -68,7 +68,7 @@
buildsManager.cancelBuild( projectId );
- AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.CANCEL_BUILD );
+ AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.CANCEL_BUILD );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
index 480c861..456f195 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
@@ -24,6 +24,8 @@
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -33,6 +35,8 @@
public class DeleteProjectAction
extends ContinuumActionSupport
{
+ private Logger logger = LoggerFactory.getLogger( this.getClass() );
+
private int projectId;
private String projectName;
@@ -58,7 +62,16 @@
event.setCategory( AuditLogConstants.PROJECT );
event.log();
- getContinuum().removeProject( projectId );
+ try
+ {
+ getContinuum().removeProject( projectId );
+ }
+ catch ( ContinuumException e )
+ {
+ logger.error( "Error removing project with id " + projectId, e );
+ addActionError( getText( "deleteProject.error", "Unable to delete project",
+ new Integer( projectId ).toString() ) );
+ }
return SUCCESS;
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
index 0df3345..0366123 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
@@ -22,9 +22,10 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
+import org.apache.continuum.model.project.ProjectGroupSummary;
import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectGroup;
import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
import org.apache.maven.continuum.web.model.GroupSummary;
@@ -50,14 +51,19 @@
{
groups = new ArrayList<GroupSummary>();
- Collection<ProjectGroup> projectGroups = getContinuum().getAllProjectGroupsWithProjects();
+ //TODO: Merge this two requests to one
+ Collection<ProjectGroup> projectGroups = getContinuum().getAllProjectGroups();
+ Map<Integer, ProjectGroupSummary> summaries = getContinuum().getProjectsSummaryByGroups();
for ( ProjectGroup projectGroup : projectGroups )
{
if ( isAuthorized( projectGroup.getName() ) )
{
- logger.debug( "GroupSummaryAction: building group " + projectGroup.getName() );
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug( "GroupSummaryAction: building group " + projectGroup.getName() );
+ }
GroupSummary groupModel = new GroupSummary();
groupModel.setId( projectGroup.getId() );
@@ -65,40 +71,23 @@
groupModel.setName( projectGroup.getName() );
groupModel.setDescription( projectGroup.getDescription() );
- //TODO: Create a summary jpox request so code will be more simple and performance will be better
- Collection<Project> projects = projectGroup.getProjects();
+ ProjectGroupSummary summary = summaries.get( projectGroup.getId() );
- groupModel.setNumProjects( projects.size() );
-
- int numSuccesses = 0;
- int numFailures = 0;
- int numErrors = 0;
-
- for ( Project project : projects )
+ if ( summary != null )
{
-
- if ( project.getState() == 2 )
- {
- numSuccesses++;
- }
- else if ( project.getState() == 3 )
- {
- numFailures++;
- }
- else if ( project.getState() == 4 )
- {
- numErrors++;
- }
+ groupModel.setNumProjects( summary.getNumberOfProjects() );
+ groupModel.setNumErrors( summary.getNumberOfErrors() );
+ groupModel.setNumFailures( summary.getNumberOfFailures() );
+ groupModel.setNumSuccesses( summary.getNumberOfSuccesses() );
}
//todo wire in the next scheduled build for the project group and a meaningful status message
//groupModel.setNextScheduledBuild( "unknown" );
//groupModel.setStatusMessage( "none" );
-
- groupModel.setNumSuccesses( numSuccesses );
- groupModel.setNumFailures( numFailures );
- groupModel.setNumErrors( numErrors );
- logger.debug( "GroupSummaryAction: adding group to groups list " + groupModel.getName() );
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug( "GroupSummaryAction: adding group to groups list " + groupModel.getName() );
+ }
groups.add( groupModel );
}
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
index 514a34d..f40467c 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
@@ -80,9 +80,8 @@
project.setScmTag( scmTag );
getContinuum().updateProject( project );
-
- String resource = project.getGroupId() + ":" + project.getArtifactId();
- AuditLog event = new AuditLog( resource, AuditLogConstants.MODIFY_PROJECT );
+
+ AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.MODIFY_PROJECT );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
index b3221a0..caa9c2a 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
@@ -30,10 +30,14 @@
import java.util.Map;
import org.apache.commons.collections.ComparatorUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.buildmanager.BuildManagerException;
import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.continuum.model.project.ProjectScmRoot;
import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.continuum.web.util.AuditLog;
import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
@@ -53,7 +57,6 @@
import org.codehaus.plexus.redback.role.RoleManager;
import org.codehaus.plexus.redback.role.RoleManagerException;
import org.codehaus.plexus.redback.users.User;
-import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -156,6 +159,12 @@
addActionError( authzE.getMessage() );
return REQUIRES_AUTHORIZATION;
}
+ catch ( ContinuumException e )
+ {
+ addActionError( getText( "projectGroup.invalid.id", "Invalid Project Group Id: " + projectGroupId,
+ Integer.toString( projectGroupId ) ) );
+ return "to_summary_page";
+ }
projectGroup = getContinuum().getProjectGroupWithProjects( projectGroupId );
@@ -296,7 +305,16 @@
if ( confirmed )
{
- getContinuum().removeProjectGroup( projectGroupId );
+ try
+ {
+ getContinuum().removeProjectGroup( projectGroupId );
+ }
+ catch ( ContinuumException e )
+ {
+ logger.error( "Error while removing project group with id " + projectGroupId, e );
+ addActionError( getText( "projectGroup.delete.error", "Unable to remove project group",
+ Integer.toString( projectGroupId ) ) );
+ }
}
else
{
@@ -304,7 +322,7 @@
return CONFIRM;
}
- AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.REMOVE_PROJECT_GROUP );
+ AuditLog event = new AuditLog( "Project Group id=" + projectGroupId, AuditLogConstants.REMOVE_PROJECT_GROUP );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
@@ -348,7 +366,7 @@
}
}
- for ( ProjectGroup pg : getContinuum().getAllProjectGroupsWithProjects() )
+ for ( ProjectGroup pg : getContinuum().getAllProjectGroups() )
{
if ( isAuthorized( projectGroup.getName() ) )
{
@@ -467,15 +485,12 @@
projectGroup.setDescription( description );
+ // [CONTINUUM-2228]. In select field can't select empty values.
if ( repositoryId > 0 )
{
LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
projectGroup.setLocalRepository( repository );
}
- else
- {
- projectGroup.setLocalRepository( null );
- }
getContinuum().updateProjectGroup( projectGroup );
@@ -527,7 +542,7 @@
}
}
- AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.MODIFY_PROJECT_GROUP );
+ AuditLog event = new AuditLog( "Project Group id=" + projectGroupId, AuditLogConstants.MODIFY_PROJECT_GROUP );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
@@ -547,17 +562,30 @@
addActionError( authzE.getMessage() );
return REQUIRES_AUTHORIZATION;
}
+
+ BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );
- if ( this.getBuildDefinitionId() == -1 )
+ try
{
- getContinuum().buildProjectGroup( projectGroupId );
+ if ( this.getBuildDefinitionId() == -1 )
+ {
+ getContinuum().buildProjectGroup( projectGroupId, buildTrigger );
+ }
+ else
+ {
+ getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId, buildTrigger );
+ }
}
- else
+ catch ( NoBuildAgentException e )
{
- getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId );
+ addActionError( getText( "projectGroup.build.error.noBuildAgent" ) );
+ }
+ catch ( NoBuildAgentInGroupException e )
+ {
+ addActionError( getText( "projectGroup.build.error.noBuildAgentInGroup" ) );
}
- AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.FORCE_BUILD );
+ AuditLog event = new AuditLog( "Project Group id=" + projectGroupId, AuditLogConstants.FORCE_BUILD );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
@@ -602,6 +630,9 @@
{
if ( p.getState() != ContinuumProjectState.OK )
{
+ logger.info(
+ "Attempt to release group '" + projectGroup.getName() + "' failed as project '" + p.getName() +
+ "' is in state " + p.getState() );
allBuildsOk = false;
}
@@ -613,6 +644,9 @@
}
else
{
+ logger.info( "Attempt to release group '" + projectGroup.getName() + "' failed as project '" +
+ p.getName() + "' and project '" + parent.getName() + "' are both parents" );
+
// currently, we have no provisions for releasing 2 or more parents
// at the same time, this will be implemented in the future
addActionError( getText( "projectGroup.release.error.severalParentProjects" ) );
@@ -622,6 +656,9 @@
if ( !"maven2".equals( p.getExecutorId() ) )
{
+ logger.info(
+ "Attempt to release group '" + projectGroup.getName() + "' failed as project '" + p.getName() +
+ "' is not a Maven 2 project (executor '" + p.getExecutorId() + "')" );
allMavenTwo = false;
}
}
@@ -677,7 +714,9 @@
List<String> roleNames = new ArrayList<String>();
for ( Role r : roles )
{
- if ( r.getName().indexOf( projectGroup.getName() ) > -1 )
+ String projectGroupName = StringUtils.substringAfter( r.getName(), "-" ).trim();
+
+ if ( projectGroupName.equals( group.getName() ) )
{
roleNames.add( r.getName() );
}
@@ -976,7 +1015,6 @@
public String getProjectGroupName()
throws ContinuumException
{
-
return getProjectGroup( projectGroupId ).getName();
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
index 58d3928..ba369a8 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
@@ -22,12 +22,16 @@
import java.util.ArrayList;
import java.util.List;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.web.util.AuditLog;
import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.dag.CycleDetectedException;
import org.slf4j.Logger;
@@ -99,7 +103,7 @@
try
{
- AuditLog event = new AuditLog( "Project id=" + selectedProject, AuditLogConstants.REMOVE_PROJECT );
+ AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.REMOVE_PROJECT );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
@@ -109,7 +113,8 @@
catch ( ContinuumException e )
{
logger.error( "Error removing Project with id=" + projectId );
- addActionError( getText( "Unable to remove Project with id=" + projectId ) );
+ addActionError( getText( "deleteProject.error", "Unable to delete project",
+ new Integer( projectId ).toString() ) );
}
}
}
@@ -152,19 +157,35 @@
int projectId = Integer.parseInt( pId );
Project p = getContinuum().getProjectWithAllDetails( projectId );
projectsList.add( p );
+
+ AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.FORCE_BUILD );
+ event.setCategory( AuditLogConstants.PROJECT );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
}
List<Project> sortedProjects = getContinuum().getProjectsInBuildOrder( projectsList );
- if ( this.getBuildDefinitionId() <= 0 )
+ try
{
- List<BuildDefinition> groupDefaultBDs =
- getContinuum().getDefaultBuildDefinitionsForProjectGroup( projectGroupId );
- getContinuum().buildProjectsWithBuildDefinition( sortedProjects, groupDefaultBDs );
+ if ( this.getBuildDefinitionId() <= 0 )
+ {
+ List<BuildDefinition> groupDefaultBDs =
+ getContinuum().getDefaultBuildDefinitionsForProjectGroup( projectGroupId );
+ getContinuum().buildProjectsWithBuildDefinition( sortedProjects, groupDefaultBDs );
+ }
+ else
+ {
+ getContinuum().buildProjectsWithBuildDefinition( sortedProjects, buildDefinitionId );
+ }
}
- else
+ catch ( NoBuildAgentException e )
{
- getContinuum().buildProjectsWithBuildDefinition( sortedProjects, buildDefinitionId );
+ addActionError( getText( "projectGroup.build.error.noBuildAgent" ) );
+ }
+ catch ( NoBuildAgentInGroupException e )
+ {
+ addActionError( getText( "projectGroup.build.error.noBuildAgentInGroup" ) );
}
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
index 7cee8a5..9c57b65 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
@@ -62,6 +62,8 @@
private String projectGroupName = "";
private ReleaseListenerSummary listenerSummary;
+
+ private String username = "";
public String execute()
throws Exception
@@ -94,13 +96,15 @@
List<String> args = new ArrayList<String>();
args.add( e.getMessage() );
- addActionError( getText( "releaseInProgress.error", args ) );
+ addActionError( getText( "distributedBuild.releaseInProgress.error", args ) );
return ERROR;
}
if ( map != null && !map.isEmpty() )
{
int state = DistributedReleaseUtil.getReleaseState( map );
+
+ username = DistributedReleaseUtil.getUsername( map );
if ( state == ContinuumReleaseManagerListener.LISTENING )
{
@@ -144,6 +148,8 @@
if ( listener != null )
{
+ username = listener.getUsername();
+
if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
{
status = "inProgress";
@@ -212,6 +218,8 @@
listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases( map ) );
listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress( map ) );
listenerSummary.setError( DistributedReleaseUtil.getReleaseError( map ) );
+
+ username = DistributedReleaseUtil.getUsername( map );
if ( state == ContinuumReleaseManagerListener.FINISHED )
{
@@ -250,6 +258,8 @@
listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
listenerSummary.setInProgress( listener.getInProgress() );
listenerSummary.setError( listener.getError() );
+
+ username = listener.getUsername();
if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
{
@@ -353,6 +363,7 @@
releaseResult.setProjectGroup( projectGroup );
releaseResult.setProject( project );
releaseResult.setReleaseGoal( releaseGoal );
+ releaseResult.setUsername( username );
String releaseName = "releases-" + result.getStartTime();
@@ -375,5 +386,16 @@
return releaseResult;
}
+
+ public String getProjectName()
+ throws ContinuumException
+ {
+ return getProjectGroupName();
+ }
+
+ public String getUsername()
+ {
+ return this.username;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
index ff92896..27a1642 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
@@ -234,6 +234,8 @@
Project project = getContinuum().getProject( projectId );
LocalRepository repository = project.getProjectGroup().getLocalRepository();
+
+ String username = getPrincipal();
if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
{
@@ -241,7 +243,7 @@
try
{
- releaseManager.releasePerform( projectId, releaseId, goals, arguments, useReleaseProfile, repository );
+ releaseManager.releasePerform( projectId, releaseId, goals, arguments, useReleaseProfile, repository, username );
}
catch ( BuildAgentConfigurationException e )
{
@@ -255,6 +257,8 @@
else
{
listener = new DefaultReleaseManagerListener();
+
+ listener.setUsername( username );
ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
@@ -266,11 +270,10 @@
releaseManager.perform( releaseId, performDirectory, goals, arguments, useReleaseProfile, listener,
repository );
}
-
- String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
- AuditLog event = new AuditLog( resource, AuditLogConstants.PERFORM_RELEASE );
+
+ AuditLog event = new AuditLog( "ReleaseId=" + releaseId, AuditLogConstants.PERFORM_RELEASE );
event.setCategory( AuditLogConstants.PROJECT );
- event.setCurrentUser( getPrincipal() );
+ event.setCurrentUser( username );
event.log();
return SUCCESS;
@@ -291,13 +294,13 @@
if ( profileId != -1 )
{
Profile profile = getContinuum().getProfileService().getProfile( profileId );
- environments = getEnvironments( profile );
+ environments = getEnvironments( profile, releaseManager.getDefaultBuildagent( projectId ) );
}
try
{
- releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile, repository, scmUrl,
- scmUsername, scmPassword, scmTag, scmTagBase, environments );
+ releaseId = releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile, repository, scmUrl,
+ scmUsername, scmPassword, scmTag, scmTagBase, environments, getPrincipal() );
}
catch ( BuildAgentConfigurationException e )
{
@@ -324,7 +327,7 @@
if ( profileId != -1 )
{
Profile profile = getContinuum().getProfileService().getProfile( profileId );
- descriptor.setEnvironments( getEnvironments( profile ) );
+ descriptor.setEnvironments( getEnvironments( profile, null ) );
}
do
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
index e6fcd82..cb1d77e 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
@@ -304,21 +304,25 @@
{
profile = getContinuum().getProfileService().getProfile( profileId );
}
+
+ String username = getPrincipal();
- Map<String, String> environments = getEnvironments( profile );
+ Map<String, String> environments = new HashMap<String, String>();
if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
{
DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
+
+ environments = getEnvironments( profile, distributedReleaseManager.getDefaultBuildagent( projectId ) );
try
{
releaseId = distributedReleaseManager.releasePrepare( project, getReleaseProperties(), getRelVersionMap(), getDevVersionMap(),
- environments );
+ environments, username );
if ( releaseId == null )
{
- addActionError( "" );
+ addActionError( "Failed to release project" );
return ERROR;
}
}
@@ -333,7 +337,11 @@
}
else
{
+ environments = getEnvironments( profile, null );
+
listener = new DefaultReleaseManagerListener();
+
+ listener.setUsername( username );
String workingDirectory = getContinuum().getWorkingDirectory( projectId ).getPath();
@@ -356,10 +364,9 @@
workingDirectory, environments, executable );
}
- String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
- AuditLog event = new AuditLog( resource, AuditLogConstants.PREPARE_RELEASE );
+ AuditLog event = new AuditLog( "Release id=" + releaseId, AuditLogConstants.PREPARE_RELEASE );
event.setCategory( AuditLogConstants.PROJECT );
- event.setCurrentUser( getPrincipal() );
+ event.setCurrentUser( username );
event.log();
return SUCCESS;
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
index 099f14c..e271b6a 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
@@ -90,9 +90,11 @@
ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+
+ listener.setUsername( getPrincipal() );
Project project = getContinuum().getProject( projectId );
-
+
releaseManager.rollback( releaseId, workingDirectoryService.getWorkingDirectory( project ).getPath(), listener );
//recurse until rollback is finished
@@ -108,8 +110,7 @@
}
}
- String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
- AuditLog event = new AuditLog( resource, AuditLogConstants.ROLLBACK_RELEASE );
+ AuditLog event = new AuditLog( "Release id=" + releaseId, AuditLogConstants.ROLLBACK_RELEASE );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
index c3f1c53..3961a95 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import org.apache.commons.lang.StringUtils;
@@ -79,9 +80,11 @@
private String year;
- private List<String> availableBuildQueues;
+ private List<BuildQueue> availableBuildQueues;
- private List<String> selectedBuildQueues = new ArrayList<String>();
+ private List<BuildQueue> selectedBuildQueues = new ArrayList<BuildQueue>();
+
+ private List<String> selectedBuildQueuesIds = new ArrayList<String>();
public void prepare()
throws Exception
@@ -94,27 +97,19 @@
private void populateBuildQueues()
throws ContinuumException
{
- List<BuildQueue> buildQueues;
if ( schedule != null )
{
- buildQueues = schedule.getBuildQueues();
- for ( BuildQueue buildQueue : buildQueues )
+ selectedBuildQueues = schedule.getBuildQueues();
+ for ( BuildQueue bq : selectedBuildQueues )
{
- selectedBuildQueues.add( buildQueue.getName() );
+ this.selectedBuildQueuesIds.add( Integer.toString( bq.getId() ) );
}
-
}
- availableBuildQueues = new ArrayList<String>();
-
- buildQueues = getContinuum().getAllBuildQueues();
- for ( BuildQueue buildQueue : buildQueues )
- {
- availableBuildQueues.add( buildQueue.getName() );
- }
+ availableBuildQueues = getContinuum().getAllBuildQueues();
// remove selected build queues from available build queues
- for ( String buildQueue : selectedBuildQueues )
+ for ( BuildQueue buildQueue : selectedBuildQueues )
{
if ( availableBuildQueues.contains( buildQueue ) )
{
@@ -222,23 +217,29 @@
{
logger.error( "Can't create schedule. No schedule name was supplied." );
addActionError( getText( "buildDefinition.noname.save.error.message" ) );
+ }
+ if ( !getContinuum().getConfiguration().isDistributedBuildEnabled()
+ && ( selectedBuildQueuesIds == null || selectedBuildQueuesIds.isEmpty() ) )
+ {
+ addActionError( getText( "schedule.buildqueues.empty.error" ) );
+ }
+ if ( hasErrors() )
+ {
return ERROR;
}
- else
+
+ try
{
- try
+ Schedule s = getContinuum().getScheduleByName( name );
+ if ( s != null && id != s.getId() )
{
- Schedule s = getContinuum().getScheduleByName( name );
- if ( s != null && id != s.getId() )
- {
- addActionError( getText( "schedule.name.already.exists" ) );
- return ERROR;
- }
+ addActionError( getText( "schedule.name.already.exists" ) );
+ return ERROR;
}
- catch ( ContinuumException e )
- {
- logger.debug( "Unexpected error getting schedule" );
- }
+ }
+ catch ( ContinuumException e )
+ {
+ logger.debug( "Unexpected error getting schedule" );
}
AuditLog event = new AuditLog( getName(), AuditLogConstants.ADD_SCHEDULE );
@@ -284,15 +285,14 @@
schedule.setDelay( delay );
schedule.setDescription( description );
schedule.setName( name );
- schedule.setMaxJobExecutionTime( maxJobExecutionTime );
-
- // remove old build queues
- schedule.setBuildQueues( null );
-
- for ( String name : selectedBuildQueues )
- {
- BuildQueue buildQueue = getContinuum().getBuildQueueByName( name );
- schedule.addBuildQueue( buildQueue );
+ schedule.setMaxJobExecutionTime(maxJobExecutionTime);
+ if (!getContinuum().getConfiguration().isDistributedBuildEnabled()) {
+ // if distributed build don't update schedules
+ schedule.setBuildQueues(null);
+ for (String id : selectedBuildQueuesIds) {
+ BuildQueue buildQueue = getContinuum().getBuildQueue(Integer.parseInt(id));
+ schedule.addBuildQueue(buildQueue);
+ }
}
return schedule;
@@ -529,23 +529,33 @@
year ).trim();
}
- public List<String> getAvailableBuildQueues()
+ public List<BuildQueue> getAvailableBuildQueues()
{
return availableBuildQueues;
}
- public void setAvailableBuildQueues( List<String> availableBuildQueues )
+ public void setAvailableBuildQueues( List<BuildQueue> availableBuildQueues )
{
this.availableBuildQueues = availableBuildQueues;
}
- public List<String> getSelectedBuildQueues()
+ public List<BuildQueue> getSelectedBuildQueues()
{
return selectedBuildQueues;
}
- public void setSelectedBuildQueues( List<String> selectedBuildQueues )
+ public void setSelectedBuildQueues( List<BuildQueue> selectedBuildQueues )
{
this.selectedBuildQueues = selectedBuildQueues;
}
+
+ public List<String> getSelectedBuildQueuesIds()
+ {
+ return selectedBuildQueuesIds;
+ }
+
+ public void setSelectedBuildQueuesIds( List<String> selectedBuildQueuesIds )
+ {
+ this.selectedBuildQueuesIds = selectedBuildQueuesIds;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
index ba6e92b..f4681ed 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
@@ -29,6 +29,7 @@
import org.apache.continuum.buildmanager.BuildManagerException;
import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.model.project.BuildResult;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.project.ContinuumProjectState;
@@ -112,7 +113,7 @@
try
{
- if ( parallelBuildsManager.isInAnyBuildQueue( project.getId() ) )
+ if ( parallelBuildsManager.isInAnyBuildQueue( project.getId() ) || parallelBuildsManager.isInPrepareBuildQueue( project.getId() ) )
{
model.setInBuildingQueue( true );
}
@@ -156,6 +157,14 @@
model.setLastBuildDateTime( latestBuild.getEndTime() );
model.setLastBuildDuration( latestBuild.getDurationTime() );
}
+
+ ConfigurationService configuration = getContinuum().getConfiguration();
+
+ if ( configuration.isDistributedBuildEnabled() &&
+ project.getState() == ContinuumProjectState.BUILDING )
+ {
+ model.setLatestBuildId( 0 );
+ }
}
summary.add( model );
@@ -230,4 +239,10 @@
{
this.groupSummary = groupSummary;
}
+
+ // test
+ public void setParallelBuildsManager( BuildsManager parallelBuildsManager )
+ {
+ this.parallelBuildsManager = parallelBuildsManager;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
index 9db3aac..99daf29 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
@@ -24,13 +24,16 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import org.apache.continuum.web.util.AuditLog;
import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
+import org.apache.maven.continuum.builddefinition.BuildDefinitionUpdatePolicyConstants;
import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
import org.apache.maven.continuum.model.project.BuildDefinition;
import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
@@ -72,10 +75,13 @@
private List<BuildDefinition> buildDefinitions;
+ private Map<Integer, String> buildDefinitionUpdatePolicies;
+
// -------------------------------------------------------
// Webwork Methods
// -------------------------------------------------------
+ @Override
public void prepare()
throws Exception
{
@@ -88,6 +94,14 @@
this.setSchedules( getContinuum().getSchedules() );
this.setProfiles( getContinuum().getProfileService().getAllProfiles() );
this.setBuildDefinitions( getContinuum().getBuildDefinitionService().getAllTemplates() );
+ buildDefinitionUpdatePolicies = new HashMap<Integer, String>();
+ String text = getText( "buildDefinition.updatePolicy.always" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ALWAYS, text );
+ text = getText( "buildDefinition.updatePolicy.never" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_NEVER, text );
+ text = getText( "buildDefinition.updatePolicy.newPom" );
+ buildDefinitionUpdatePolicies.put( BuildDefinitionUpdatePolicyConstants.UPDATE_DESCRIPTION_ONLY_FOR_NEW_POM,
+ text );
}
public String input()
@@ -136,6 +150,8 @@
{
List<BuildDefinition> selectedBuildDefinitions = getBuildDefinitionsFromSelectedBuildDefinitions();
+ BuildDefinitionTemplate result;
+
AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.ADD_TEMPLATE );
event.setCategory( AuditLogConstants.TEMPLATE );
event.setCurrentUser( getPrincipal() );
@@ -143,15 +159,24 @@
if ( this.buildDefinitionTemplate.getId() > 0 )
{
buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
- this.getContinuum().getBuildDefinitionService().updateBuildDefinitionTemplate( buildDefinitionTemplate );
+ result = this.getContinuum().getBuildDefinitionService().updateBuildDefinitionTemplate( buildDefinitionTemplate );
event.setAction( AuditLogConstants.MODIFY_TEMPLATE );
- event.log();
}
else
{
buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
this.buildDefinitionTemplate =
this.getContinuum().getBuildDefinitionService().addBuildDefinitionTemplate( buildDefinitionTemplate );
+ result = this.buildDefinitionTemplate;
+ }
+
+ if ( result == null )
+ {
+ addActionError( getText( "buildDefintionTemplate.name.exists" ) );
+ return INPUT;
+ }
+ else
+ {
event.log();
}
@@ -217,6 +242,7 @@
public String saveBuildDefinition()
throws Exception
{
+ Schedule schedule = null;
if ( buildDefinition.getProfile() != null )
{
Profile profile = getContinuum().getProfileService().getProfile( buildDefinition.getProfile().getId() );
@@ -233,7 +259,8 @@
{
if ( buildDefinition.getSchedule().getId() > 0 )
{
- buildDefinition.setSchedule( getContinuum().getSchedule( buildDefinition.getSchedule().getId() ) );
+ schedule = getContinuum().getSchedule( buildDefinition.getSchedule().getId() );
+ buildDefinition.setSchedule( schedule );
}
}
@@ -246,6 +273,11 @@
this.buildDefinition =
this.getContinuum().getBuildDefinitionService().addBuildDefinition( buildDefinition );
}
+
+ if ( schedule != null )
+ {
+ getContinuum().activeBuildDefinitionSchedule( schedule );
+ }
return SUCCESS;
}
@@ -383,4 +415,9 @@
this.selectedBuildDefinitionIds = selectedBuildDefinitionIds;
}
+ public Map<Integer, String> getBuildDefinitionUpdatePolicies()
+ {
+ return buildDefinitionUpdatePolicies;
+ }
+
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
index c5828c5..da17626 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
@@ -22,6 +22,8 @@
import java.util.List;
import org.apache.continuum.buildmanager.BuildManagerException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.model.project.BuildQueue;
import org.apache.maven.continuum.security.ContinuumRoleConstants;
@@ -98,6 +100,11 @@
BuildQueue addedBuildQueue = getContinuum().addBuildQueue( buildQueue );
getContinuum().getBuildsManager().addOverallBuildQueue( addedBuildQueue );
+
+ AuditLog event = new AuditLog( "Build Queue id=" + addedBuildQueue.getId(), AuditLogConstants.ADD_BUILD_QUEUE );
+ event.setCategory( AuditLogConstants.BUILD_QUEUE );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
}
else
{
@@ -145,6 +152,11 @@
getContinuum().removeBuildQueue( buildQueueToBeDeleted );
this.buildQueueList = getContinuum().getAllBuildQueues();
+
+ AuditLog event = new AuditLog( "Build Queue id=" + buildQueue.getId(), AuditLogConstants.REMOVE_BUILD_QUEUE );
+ event.setCategory( AuditLogConstants.BUILD_QUEUE );
+ event.setCurrentUser( getPrincipal() );
+ event.log();
}
else
{
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
index 37b1691..a69b760 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
@@ -77,8 +77,6 @@
private List<BuildAgentGroupConfiguration> buildAgentGroups;
- private String message;
-
public void prepare()
throws Exception
{
@@ -106,13 +104,6 @@
public String list()
throws Exception
{
- String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage" );
-
- if ( errorMessage != null )
- {
- addActionError( getText( errorMessage ) );
- }
-
this.profiles = profileService.getAllProfiles();
return SUCCESS;
}
@@ -188,13 +179,13 @@
{
profileService.deleteProfile( profile.getId() );
this.profiles = profileService.getAllProfiles();
- return SUCCESS;
}
catch ( ProfileException e )
{
- message = "profile.remove.error";
- return ERROR;
+ // display action error in default/success page -- CONTINUUM-2250
+ addActionError( getText( "profile.remove.error" ) );
}
+ return SUCCESS;
}
public String confirmDelete()
@@ -326,16 +317,6 @@
this.installationId = installationId;
}
- public String getMessage()
- {
- return message;
- }
-
- public void setMessage( String message )
- {
- this.message = message;
- }
-
public List<BuildAgentGroupConfiguration> getBuildAgentGroups()
{
return buildAgentGroups;
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
index d1e7334..1a34e97 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
@@ -20,7 +20,6 @@
*/
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -33,17 +32,19 @@
import org.apache.continuum.taskqueue.BuildProjectTask;
import org.apache.continuum.taskqueue.CheckOutTask;
import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.maven.continuum.model.project.Project;
import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.security.ContinuumRoleConstants;
import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.apache.maven.continuum.web.bean.BuildProjectQueue;
+import org.apache.maven.continuum.web.bean.CheckoutQueue;
import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
import org.apache.maven.continuum.web.model.DistributedBuildSummary;
+import org.apache.maven.continuum.web.model.PrepareBuildSummary;
import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.redback.integration.interceptor.SecureAction;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
import org.codehaus.redback.integration.interceptor.SecureActionException;
@@ -64,6 +65,8 @@
private static final String DISTRIBUTED_BUILD_SUCCESS = "distributed-build-success";
+ private List<String> selectedPrepareBuildTaskHashCodes;
+
private List<String> selectedBuildTaskHashCodes;
private List<String> selectedCheckOutTaskHashCodes;
@@ -76,30 +79,31 @@
private String projectName;
- private Map<String, BuildProjectTask> currentBuildProjectTasks = new HashMap<String, BuildProjectTask>();
+ private List<BuildProjectQueue> currentBuildProjectTasks = new ArrayList<BuildProjectQueue>();
- private Map<String, CheckOutTask> currentCheckoutTasks = new HashMap<String, CheckOutTask>();
+ private List<CheckoutQueue> currentCheckoutTasks = new ArrayList<CheckoutQueue>();
- private Map<String, List<BuildProjectTask>> buildsInQueue = new HashMap<String, List<BuildProjectTask>>();
+ private List<BuildProjectQueue> buildsInQueue = new ArrayList<BuildProjectQueue>();
- private Map<String, List<CheckOutTask>> checkoutsInQueue = new HashMap<String, List<CheckOutTask>>();
+ private List<CheckoutQueue> checkoutsInQueue = new ArrayList<CheckoutQueue>();
- /**
- * @plexus.requirement
- */
- DistributedBuildManager distributedBuildManager;
+ private List<PrepareBuildSummary> currentPrepareBuilds = new ArrayList<PrepareBuildSummary>();
- private List<DistributedBuildSummary> distributedBuildSummary;
+ private List<PrepareBuildSummary> prepareBuildQueues = new ArrayList<PrepareBuildSummary>();
- private List<PrepareBuildProjectsTask> distributedBuildQueues;
+ private List<PrepareBuildSummary> currentDistributedPrepareBuilds = new ArrayList<PrepareBuildSummary>();
+
+ private List<PrepareBuildSummary> distributedPrepareBuildQueues = new ArrayList<PrepareBuildSummary>();
+
+ private List<DistributedBuildSummary> currentDistributedBuilds = new ArrayList<DistributedBuildSummary>();
+
+ private List<DistributedBuildSummary> distributedBuildQueues = new ArrayList<DistributedBuildSummary>();
private String buildAgentUrl;
private int projectGroupId;
- private String scmRootAddress;
-
- private List<String> selectedDistributedBuildTaskHashCodes;
+ private int scmRootId;
// -----------------------------------------------------
// webwork
@@ -202,38 +206,89 @@
{
if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
{
- distributedBuildSummary = new ArrayList<DistributedBuildSummary>();
+ // current prepare build task
+ Map<String, PrepareBuildProjectsTask> currentPrepareBuildMap = getContinuum().getDistributedBuildManager().getProjectsCurrentlyPreparingBuild();
- Map<String, PrepareBuildProjectsTask> map = distributedBuildManager.getDistributedBuildProjects();
-
- for ( String url : map.keySet() )
+ for ( String url : currentPrepareBuildMap.keySet() )
{
- PrepareBuildProjectsTask task = map.get( url );
+ PrepareBuildProjectsTask task = currentPrepareBuildMap.get( url );
ProjectGroup projectGroup = getContinuum().getProjectGroup( task.getProjectGroupId() );
- DistributedBuildSummary summary = new DistributedBuildSummary();
- summary.setUrl( url );
+ PrepareBuildSummary summary = new PrepareBuildSummary();
+ summary.setBuildAgentUrl( url );
summary.setProjectGroupId( task.getProjectGroupId() );
summary.setProjectGroupName( projectGroup.getName() );
summary.setScmRootAddress( task.getScmRootAddress() );
+ summary.setScmRootId( task.getProjectScmRootId() );
- ProjectScmRoot scmRoot =
- getContinuum().getProjectScmRootByProjectGroupAndScmRootAddress( task.getProjectGroupId(),
- task.getScmRootAddress() );
- if ( scmRoot.getState() == ContinuumProjectState.UPDATING )
- {
- summary.setCancelEnabled( false );
- }
- else
- {
- summary.setCancelEnabled( true );
- }
-
- distributedBuildSummary.add( summary );
+ currentDistributedPrepareBuilds.add( summary );
}
- distributedBuildQueues = aggregateQueues();
+ // current builds
+ Map<String, BuildProjectTask> currentBuildMap = getContinuum().getDistributedBuildManager().getProjectsCurrentlyBuilding();
+
+ for ( String url : currentBuildMap.keySet() )
+ {
+ BuildProjectTask task = currentBuildMap.get( url );
+
+ Project project = getContinuum().getProject( task.getProjectId() );
+
+ DistributedBuildSummary summary = new DistributedBuildSummary();
+ summary.setProjectId( project.getId() );
+ summary.setProjectName( project.getName() );
+ summary.setProjectGroupName( project.getProjectGroup().getName() );
+ summary.setBuildDefinitionId( task.getBuildDefinitionId() );
+ summary.setBuildDefinitionLabel( task.getBuildDefinitionLabel() );
+ summary.setHashCode( task.getHashCode() );
+ summary.setBuildAgentUrl( url );
+
+ currentDistributedBuilds.add( summary );
+ }
+
+ // prepare build queues
+ Map<String, List<PrepareBuildProjectsTask>> prepareBuildMap = getContinuum().getDistributedBuildManager().getProjectsInPrepareBuildQueue();
+
+ for ( String url : prepareBuildMap.keySet() )
+ {
+ for ( PrepareBuildProjectsTask task : prepareBuildMap.get( url ) )
+ {
+ ProjectGroup projectGroup = getContinuum().getProjectGroup( task.getProjectGroupId() );
+
+ PrepareBuildSummary summary = new PrepareBuildSummary();
+ summary.setBuildAgentUrl( url );
+ summary.setProjectGroupId( task.getProjectGroupId() );
+ summary.setProjectGroupName( projectGroup.getName() );
+ summary.setScmRootAddress( task.getScmRootAddress() );
+ summary.setScmRootId( task.getProjectScmRootId() );
+ summary.setHashCode( task.getHashCode() );
+
+ distributedPrepareBuildQueues.add( summary );
+ }
+ }
+
+ // build queues
+ Map<String, List<BuildProjectTask>> buildMap = getContinuum().getDistributedBuildManager().getProjectsInBuildQueue();
+
+ for ( String url : buildMap.keySet() )
+ {
+ for ( BuildProjectTask task : buildMap.get( url ) )
+ {
+ DistributedBuildSummary summary = new DistributedBuildSummary();
+
+ Project project = getContinuum().getProject( task.getProjectId() );
+
+ summary.setProjectId( project.getId() );
+ summary.setProjectName( project.getName() );
+ summary.setProjectGroupName( project.getProjectGroup().getName() );
+ summary.setBuildDefinitionId( task.getBuildDefinitionId() );
+ summary.setBuildDefinitionLabel( task.getBuildDefinitionLabel() );
+ summary.setHashCode( task.getHashCode() );
+ summary.setBuildAgentUrl( url );
+
+ distributedBuildQueues.add( summary );
+ }
+ }
return DISTRIBUTED_BUILD_SUCCESS;
}
@@ -241,13 +296,61 @@
{
try
{
+ // current prepare builds
+ PrepareBuildProjectsTask currentPrepareBuildTask = getContinuum().getBuildsManager().getCurrentProjectInPrepareBuild();
+
+ if ( currentPrepareBuildTask != null )
+ {
+ PrepareBuildSummary s = new PrepareBuildSummary();
+
+ s.setProjectGroupId( currentPrepareBuildTask.getProjectGroupId() );
+ s.setProjectGroupName( currentPrepareBuildTask.getProjectGroupName() );
+ s.setScmRootId( currentPrepareBuildTask.getProjectScmRootId() );
+ s.setScmRootAddress( currentPrepareBuildTask.getScmRootAddress() );
+ currentPrepareBuilds.add( s );
+ }
+ }
+ catch ( BuildManagerException e )
+ {
+ addActionError( e.getMessage() );
+ return ERROR;
+ }
+
+ try
+ {
// current builds
Map<String, BuildProjectTask> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
Set<String> keySet = currentBuilds.keySet();
for ( String key : keySet )
{
BuildProjectTask buildTask = currentBuilds.get( key );
- currentBuildProjectTasks.put( key, buildTask );
+ BuildProjectQueue queue = new BuildProjectQueue();
+ queue.setName( key );
+ queue.setTask( buildTask );
+ currentBuildProjectTasks.add( queue );
+ }
+ }
+ catch ( BuildManagerException e )
+ {
+ addActionError( e.getMessage() );
+ return ERROR;
+ }
+
+ try
+ {
+ // queued prepare builds
+ List<PrepareBuildProjectsTask> prepareBuilds =
+ getContinuum().getBuildsManager().getProjectsInPrepareBuildQueue();
+ for ( PrepareBuildProjectsTask task : prepareBuilds )
+ {
+ PrepareBuildSummary summary = new PrepareBuildSummary();
+ summary.setProjectGroupId( task.getProjectGroupId() );
+ summary.setProjectGroupName( task.getProjectGroupName() );
+ summary.setScmRootId( task.getProjectScmRootId() );
+ summary.setScmRootAddress( task.getScmRootAddress() );
+ summary.setHashCode( task.getHashCode() );
+
+ prepareBuildQueues.add( summary );
}
}
catch ( BuildManagerException e )
@@ -264,12 +367,13 @@
Set<String> keySet = builds.keySet();
for ( String key : keySet )
{
- List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
for ( BuildProjectTask task : builds.get( key ) )
{
- buildTasks.add( task );
+ BuildProjectQueue queue = new BuildProjectQueue();
+ queue.setName( key );
+ queue.setTask( task );
+ buildsInQueue.add( queue );
}
- buildsInQueue.put( key, buildTasks );
}
}
catch ( BuildManagerException e )
@@ -286,7 +390,10 @@
for ( String key : keySet )
{
CheckOutTask checkoutTask = currentCheckouts.get( key );
- currentCheckoutTasks.put( key, checkoutTask );
+ CheckoutQueue queue = new CheckoutQueue();
+ queue.setName( key );
+ queue.setTask( checkoutTask );
+ currentCheckoutTasks.add( queue );
}
}
catch ( BuildManagerException e )
@@ -303,12 +410,13 @@
Set<String> keySet = checkouts.keySet();
for ( String key : keySet )
{
- List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
for ( CheckOutTask task : checkouts.get( key ) )
{
- checkoutTasks.add( task );
+ CheckoutQueue queue = new CheckoutQueue();
+ queue.setName( key );
+ queue.setTask( task );
+ checkoutsInQueue.add( queue );
}
- checkoutsInQueue.put( key, checkoutTasks );
}
}
catch ( BuildManagerException e )
@@ -339,8 +447,8 @@
return REQUIRES_AUTHENTICATION;
}
- getContinuum().getBuildsManager().removeProjectFromBuildQueue( projectId, buildDefinitionId, trigger,
- projectName );
+ getContinuum().getBuildsManager().removeProjectFromBuildQueue( projectId, buildDefinitionId,
+ new BuildTrigger( trigger, "" ), projectName, projectGroupId );
Project project = getContinuum().getProject( projectId );
project.setState( project.getOldState() );
getContinuum().updateProject( project );
@@ -394,6 +502,51 @@
return SUCCESS;
}
+ public String removePrepareBuildEntry()
+ throws Exception
+ {
+ try
+ {
+ checkManageQueuesAuthorization();
+ }
+ catch ( AuthorizationRequiredException authzE )
+ {
+ addActionError( authzE.getMessage() );
+ return REQUIRES_AUTHORIZATION;
+ }
+ catch ( AuthenticationRequiredException e )
+ {
+ addActionError( e.getMessage() );
+ return REQUIRES_AUTHENTICATION;
+ }
+
+ getContinuum().getBuildsManager().removeProjectFromPrepareBuildQueue( projectGroupId, scmRootId );
+ return SUCCESS;
+ }
+
+ public String removePrepareBuildEntries()
+ throws Exception
+ {
+ try
+ {
+ checkManageQueuesAuthorization();
+ }
+ catch ( AuthorizationRequiredException authzE )
+ {
+ addActionError( authzE.getMessage() );
+ return REQUIRES_AUTHORIZATION;
+ }
+ catch ( AuthenticationRequiredException e )
+ {
+ addActionError( e.getMessage() );
+ return REQUIRES_AUTHENTICATION;
+ }
+
+ getContinuum().getBuildsManager().removeProjectsFromPrepareBuildQueueWithHashCodes(
+ listToIntArray( this.selectedPrepareBuildTaskHashCodes ) );
+ return SUCCESS;
+ }
+
public String cancelDistributedBuild()
throws Exception
{
@@ -412,7 +565,53 @@
return REQUIRES_AUTHENTICATION;
}
- distributedBuildManager.cancelDistributedBuild( buildAgentUrl, projectGroupId, scmRootAddress );
+ getContinuum().getDistributedBuildManager().cancelDistributedBuild( buildAgentUrl );
+
+ return SUCCESS;
+ }
+
+ public String removeDistributedPrepareBuildEntry()
+ throws Exception
+ {
+ try
+ {
+ checkManageQueuesAuthorization();
+ }
+ catch ( AuthorizationRequiredException authzE )
+ {
+ addActionError( authzE.getMessage() );
+ return REQUIRES_AUTHORIZATION;
+ }
+ catch ( AuthenticationRequiredException e )
+ {
+ addActionError( e.getMessage() );
+ return REQUIRES_AUTHENTICATION;
+ }
+
+ getContinuum().getDistributedBuildManager().removeFromPrepareBuildQueue( buildAgentUrl, projectGroupId, scmRootId );
+
+ return SUCCESS;
+ }
+
+ public String removeDistributedPrepareBuildEntries()
+ throws Exception
+ {
+ try
+ {
+ checkManageQueuesAuthorization();
+ }
+ catch ( AuthorizationRequiredException authzE )
+ {
+ addActionError( authzE.getMessage() );
+ return REQUIRES_AUTHORIZATION;
+ }
+ catch ( AuthenticationRequiredException e )
+ {
+ addActionError( e.getMessage() );
+ return REQUIRES_AUTHENTICATION;
+ }
+
+ getContinuum().getDistributedBuildManager().removeFromPrepareBuildQueue( this.getSelectedPrepareBuildTaskHashCodes() );
return SUCCESS;
}
@@ -435,7 +634,7 @@
return REQUIRES_AUTHENTICATION;
}
- getContinuum().getTaskQueueManager().removeFromDistributedBuildQueue( projectGroupId, scmRootAddress );
+ getContinuum().getDistributedBuildManager().removeFromBuildQueue( buildAgentUrl, projectId, buildDefinitionId );
return SUCCESS;
}
@@ -458,8 +657,7 @@
return REQUIRES_AUTHENTICATION;
}
- getContinuum().getTaskQueueManager().removeTasksFromDistributedBuildQueueWithHashCodes(
- listToIntArray( this.getSelectedDistributedBuildTaskHashCodes() ) );
+ getContinuum().getDistributedBuildManager().removeFromBuildQueue( this.getSelectedBuildTaskHashCodes() );
return SUCCESS;
}
@@ -586,54 +784,74 @@
this.selectedCheckOutTaskHashCodes = selectedCheckOutTaskHashCodes;
}
- public Map<String, BuildProjectTask> getCurrentBuildProjectTasks()
+ public List<BuildProjectQueue> getCurrentBuildProjectTasks()
{
return currentBuildProjectTasks;
}
- public void setCurrentBuildProjectTasks( Map<String, BuildProjectTask> currentBuildProjectTasks )
+ public void setCurrentBuildProjectTasks( List<BuildProjectQueue> currentBuildProjectTasks )
{
this.currentBuildProjectTasks = currentBuildProjectTasks;
}
- public Map<String, CheckOutTask> getCurrentCheckoutTasks()
+ public List<CheckoutQueue> getCurrentCheckoutTasks()
{
return currentCheckoutTasks;
}
- public void setCurrentCheckoutTasks( Map<String, CheckOutTask> currentCheckoutTasks )
+ public void setCurrentCheckoutTasks( List<CheckoutQueue> currentCheckoutTasks )
{
this.currentCheckoutTasks = currentCheckoutTasks;
}
- public Map<String, List<BuildProjectTask>> getBuildsInQueue()
+ public List<BuildProjectQueue> getBuildsInQueue()
{
return buildsInQueue;
}
- public void setBuildsInQueue( Map<String, List<BuildProjectTask>> buildsInQueue )
+ public void setBuildsInQueue( List<BuildProjectQueue> buildsInQueue )
{
this.buildsInQueue = buildsInQueue;
}
- public Map<String, List<CheckOutTask>> getCheckoutsInQueue()
+ public List<CheckoutQueue> getCheckoutsInQueue()
{
return checkoutsInQueue;
}
- public void setCheckoutsInQueue( Map<String, List<CheckOutTask>> checkoutsInQueue )
+ public void setCheckoutsInQueue( List<CheckoutQueue> checkoutsInQueue )
{
this.checkoutsInQueue = checkoutsInQueue;
}
- public List<DistributedBuildSummary> getDistributedBuildSummary()
+ public List<PrepareBuildSummary> getCurrentDistributedPrepareBuilds()
{
- return distributedBuildSummary;
+ return currentDistributedPrepareBuilds;
}
- public void setDistributedBuildSummary( List<DistributedBuildSummary> distributedBuildSummary )
+ public List<DistributedBuildSummary> getCurrentDistributedBuilds()
{
- this.distributedBuildSummary = distributedBuildSummary;
+ return currentDistributedBuilds;
+ }
+
+ public List<PrepareBuildSummary> getDistributedPrepareBuildQueues()
+ {
+ return distributedPrepareBuildQueues;
+ }
+
+ public List<DistributedBuildSummary> getDistributedBuildQueues()
+ {
+ return distributedBuildQueues;
+ }
+
+ public List<PrepareBuildSummary> getCurrentPrepareBuilds()
+ {
+ return currentPrepareBuilds;
+ }
+
+ public List<PrepareBuildSummary> getPrepareBuildQueues()
+ {
+ return prepareBuildQueues;
}
public String getBuildAgentUrl()
@@ -646,65 +864,23 @@
this.buildAgentUrl = buildAgentUrl;
}
- public List<PrepareBuildProjectsTask> getDistributedBuildQueues()
+ public void setProjectGroupId( int projectGroupId )
{
- return distributedBuildQueues;
+ this.projectGroupId = projectGroupId;
}
- public void setDistributedBuildQueues( List<PrepareBuildProjectsTask> distributedBuildQueues )
+ public void setScmRootId( int scmRootId )
{
- this.distributedBuildQueues = distributedBuildQueues;
+ this.scmRootId = scmRootId;
}
- public List<String> getSelectedDistributedBuildTaskHashCodes()
+ public void setSelectedPrepareBuildTaskHashCodes( List<String> selectedPrepareBuildTaskHashCodes )
{
- return selectedDistributedBuildTaskHashCodes;
+ this.selectedPrepareBuildTaskHashCodes = selectedPrepareBuildTaskHashCodes;
}
- public void setSelectedDistributedBuildTaskHashCodes( List<String> selectedDistributedBuildTaskHashCodes )
+ public List<String> getSelectedPrepareBuildTaskHashCodes()
{
- this.selectedDistributedBuildTaskHashCodes = selectedDistributedBuildTaskHashCodes;
- }
-
- public String getScmRootAddress()
- {
- return scmRootAddress;
- }
-
- public void setScmRootAddress( String scmRootAddress )
- {
- this.scmRootAddress = scmRootAddress;
- }
-
- private List<PrepareBuildProjectsTask> aggregateQueues()
- throws TaskQueueManagerException
- {
- List<PrepareBuildProjectsTask> aggregatedQueues = new ArrayList<PrepareBuildProjectsTask>();
-
- List<PrepareBuildProjectsTask> overallQueues =
- getContinuum().getTaskQueueManager().getDistributedBuildProjectsInQueue();
-
- Map<String, DistributedBuildTaskQueueExecutor> agentTaskQueueExecutors =
- distributedBuildManager.getTaskQueueExecutors();
-
- for ( String url : agentTaskQueueExecutors.keySet() )
- {
- try
- {
- logger.debug( "size of each queue snapshot " + url + " : " +
- agentTaskQueueExecutors.get( url ).getQueue().getQueueSnapshot().size() );
- aggregatedQueues.addAll( agentTaskQueueExecutors.get( url ).getQueue().getQueueSnapshot() );
- }
- catch ( TaskQueueException e )
- {
- //silently ignore error
- logger.error( "Error encountered retrieving queue snapshot from queue :" + url, e );
- }
- }
-
- logger.debug( "size of agg. queue " + aggregatedQueues.size() );
- aggregatedQueues.addAll( overallQueues );
-
- return aggregatedQueues;
+ return selectedPrepareBuildTaskHashCodes;
}
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
index 0fc09cd..c5bc8f3 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
@@ -140,13 +140,15 @@
}
}
- if ( containsDefaultBDForProject )
+ for ( BuildDefinitionSummary bds : groupBuildDefinitionSummaries )
{
- for ( BuildDefinitionSummary bds : groupBuildDefinitionSummaries )
+ if ( bds.isIsDefault() )
{
- if (bds.isIsDefault()){
- defaultGroupDefinitionId = bds.getId();
- }
+ defaultGroupDefinitionId = bds.getId();
+ }
+
+ if ( containsDefaultBDForProject )
+ {
bds.setIsDefault( false );
}
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
index 942a36d..0aa5804 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
@@ -43,6 +43,8 @@
private boolean committers;
+ private boolean developers;
+
protected void initConfiguration( Map<String, String> configuration )
{
if ( StringUtils.isNotEmpty( configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD ) ) )
@@ -54,6 +56,11 @@
{
committers = Boolean.parseBoolean( configuration.get( AbstractContinuumNotifier.COMMITTER_FIELD ) );
}
+
+ if (StringUtils.isNotEmpty(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD)))
+ {
+ developers = Boolean.parseBoolean(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD));
+ }
}
protected void setNotifierConfiguration( ProjectNotifier notifier )
@@ -67,6 +74,8 @@
configuration.put( AbstractContinuumNotifier.COMMITTER_FIELD, String.valueOf( committers ) );
+ configuration.put(AbstractContinuumNotifier.DEVELOPER_FIELD, String.valueOf(developers));
+
notifier.setConfiguration( configuration );
}
@@ -89,4 +98,14 @@
{
this.committers = committers;
}
+
+ public boolean isDevelopers()
+ {
+ return developers;
+ }
+
+ public void setDevelopers(boolean developers)
+ {
+ this.developers = developers;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
index e7197d9..935e989 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
@@ -43,6 +43,8 @@
private boolean committers;
+ private boolean developers;
+
protected void initConfiguration( Map<String, String> configuration )
{
if ( StringUtils.isNotEmpty( configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD ) ) )
@@ -54,6 +56,11 @@
{
committers = Boolean.parseBoolean( configuration.get( AbstractContinuumNotifier.COMMITTER_FIELD ) );
}
+
+ if (StringUtils.isNotEmpty(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD)))
+ {
+ developers = Boolean.parseBoolean(configuration.get(AbstractContinuumNotifier.DEVELOPER_FIELD));
+ }
}
protected void setNotifierConfiguration( ProjectNotifier notifier )
@@ -67,6 +74,8 @@
configuration.put( AbstractContinuumNotifier.COMMITTER_FIELD, String.valueOf( committers ) );
+ configuration.put(AbstractContinuumNotifier.DEVELOPER_FIELD, String.valueOf(developers));
+
notifier.setConfiguration( configuration );
}
@@ -89,4 +98,14 @@
{
this.committers = committers;
}
+
+ public boolean isDevelopers()
+ {
+ return developers;
+ }
+
+ public void setDevelopers(boolean developers)
+ {
+ this.developers = developers;
+ }
}
diff --git a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/appareance/DefaultAppareanceConfiguration.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/appareance/DefaultAppareanceConfiguration.java
index e18e51f..1c285ef 100644
--- a/continuum-webapp/src/main/java/org/apache/maven/continuum/web/appareance/DefaultAppareanceConfiguration.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/appareance/DefaultAppareanceConfiguration.java
@@ -111,7 +111,9 @@
{
confFile.getParentFile().mkdirs();
}
- writer.write( new FileWriter( confFile ), continuumAppearance );
+ FileWriter fileWriter = new FileWriter( confFile );
+ writer.write( fileWriter, continuumAppearance );
+ fileWriter.close();
this.footer = footerHtmlContent;
}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/BuildProjectQueue.java
similarity index 72%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
copy to continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/BuildProjectQueue.java
index 6d9f5ee..6aa4b43 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/BuildProjectQueue.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.maven.continuum.web.bean;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,24 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.continuum.taskqueue.BuildProjectTask;
/**
- * Goal which add an ANT project.
- *
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id$
- * @goal add-ant-project
*/
-public class AddAntProject
- extends AbstractAddProject
+public class BuildProjectQueue
+ extends Queue
{
- protected String getProjectType()
+ private BuildProjectTask task;
+
+ public BuildProjectTask getTask()
{
- return ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
+ return task;
+ }
+
+ public void setTask( BuildProjectTask task )
+ {
+ this.task = task;
}
}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/CheckoutQueue.java
similarity index 72%
rename from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
rename to continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/CheckoutQueue.java
index 6d9f5ee..79f037e 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/CheckoutQueue.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.maven.continuum.web.bean;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,24 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.continuum.taskqueue.CheckOutTask;
/**
- * Goal which add an ANT project.
- *
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id$
- * @goal add-ant-project
*/
-public class AddAntProject
- extends AbstractAddProject
+public class CheckoutQueue
+ extends Queue
{
- protected String getProjectType()
+ private CheckOutTask task;
+
+ public CheckOutTask getTask()
{
- return ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
+ return task;
+ }
+
+ public void setTask( CheckOutTask task )
+ {
+ this.task = task;
}
}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/Queue.java
similarity index 72%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
copy to continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/Queue.java
index 6d9f5ee..af7d452 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddAntProject.java
+++ b/continuum-webapp/src/main/java/org/apache/maven/continuum/web/bean/Queue.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.maven.continuum.web.bean;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,21 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-
/**
- * Goal which add an ANT project.
- *
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id$
- * @goal add-ant-project
*/
-public class AddAntProject
- extends AbstractAddProject
+public class Queue
{
- protected String getProjectType()
+ private String name;
+
+ public String getName()
{
- return ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
+ return name;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
}
}
diff --git a/continuum-webapp/src/main/mdo/session-models.mdo b/continuum-webapp/src/main/mdo/session-models.mdo
deleted file mode 100644
index a14cd25..0000000
--- a/continuum-webapp/src/main/mdo/session-models.mdo
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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.
- -->
-<model>
- <id>continuum-session-models</id>
- <name>ContinuumSessionModels</name>
- <defaults>
- <default>
- <key>package</key>
- <value>org.apache.maven.continuum.web.model</value>
- </default>
- </defaults>
- <classes>
- <class rootElement="true">
- <name>Session</name>
- <version>1.0.0</version>
- <fields>
- <field>
- <name>sessionUsers</name>
- <version>1.0.0</version>
- <description></description>
- <required>true</required>
- <association>
- <type>SessionUser</type>
- <multiplicity>*</multiplicity>
- </association>
- </field>
- </fields>
- </class>
- <class>
- <name>SessionUser</name>
- <version>1.0.0</version>
- <fields>
- <field>
- <name>id</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>id of the user</description>
- <type>int</type>
- </field>
- <field>
- <name>username</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>username</description>
- <type>String</type>
- </field>
- <field>
- <name>fullName</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>full name of the user</description>
- <type>String</type>
- </field>
- <field>
- <name>email</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>email of the user</description>
- <type>String</type>
- </field>
- <field>
- <name>userGroupId</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>user group the user is a member of</description>
- <type>int</type>
- </field>
- <field>
- <name>loggedIn</name>
- <version>1.0.0</version>
- <required>true</required>
- <description>boolean for the user is logged in or not</description>
- <type>boolean</type>
- <required>true</required>
- <defaultValue>false</defaultValue>
- </field>
- </fields>
- </class>
- </classes>
-</model>
\ No newline at end of file
diff --git a/continuum-webapp/src/main/mdo/view-models.mdo b/continuum-webapp/src/main/mdo/view-models.mdo
index 78b3fb5..c3e0c50 100644
--- a/continuum-webapp/src/main/mdo/view-models.mdo
+++ b/continuum-webapp/src/main/mdo/view-models.mdo
@@ -262,7 +262,7 @@
<required>true</required>
<description>number of successful builds in the project group</description>
<type>int</type>
- <defaultValue>-1</defaultValue>
+ <defaultValue>0</defaultValue>
</field>
<field>
<name>numFailures</name>
@@ -270,7 +270,7 @@
<required>true</required>
<description>number of failed builds in the project group</description>
<type>int</type>
- <defaultValue>-1</defaultValue>
+ <defaultValue>0</defaultValue>
</field>
<field>
<name>numErrors</name>
@@ -278,7 +278,7 @@
<required>true</required>
<description>number of errored builds in the project group</description>
<type>int</type>
- <defaultValue>-1</defaultValue>
+ <defaultValue>0</defaultValue>
</field>
<field>
<name>repositoryId</name>
@@ -495,13 +495,13 @@
</fields>
</class>
<class>
- <name>DistributedBuildSummary</name>
+ <name>PrepareBuildSummary</name>
<version>1.0.0+</version>
<fields>
<field>
- <name>url</name>
+ <name>buildAgentUrl</name>
<version>1.0.0</version>
- <required>true</required>
+ <required>false</required>
<description>URL of the build agent</description>
<type>String</type>
</field>
@@ -527,11 +527,17 @@
<type>String</type>
</field>
<field>
- <name>cancelEnabled</name>
+ <name>scmRootId</name>
<version>1.0.0</version>
<required>true</required>
- <description>Determines if the cancel button is enabled</description>
- <type>boolean</type>
+ <description>ID of the scm root</description>
+ <type>int</type>
+ </field>
+ <field>
+ <name>hashCode</name>
+ <version>1.0.0</version>
+ <required>false</required>
+ <type>int</type>
</field>
</fields>
</class>
@@ -601,5 +607,53 @@
</field>
</fields>
</class>
+ <class>
+ <name>DistributedBuildSummary</name>
+ <version>1.0.0+</version>
+ <fields>
+ <field>
+ <name>projectId</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>int</type>
+ </field>
+ <field>
+ <name>projectName</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>String</type>
+ </field>
+ <field>
+ <name>projectGroupName</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>String</type>
+ </field>
+ <field>
+ <name>buildDefinitionId</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>int</type>
+ </field>
+ <field>
+ <name>buildDefinitionLabel</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>String</type>
+ </field>
+ <field>
+ <name>buildAgentUrl</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>String</type>
+ </field>
+ <field>
+ <name>hashCode</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <type>int</type>
+ </field>
+ </fields>
+ </class>
</classes>
</model>
diff --git a/continuum-webapp/src/main/resources/META-INF/plexus/application.xml b/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
index c21dd6c..bb12303 100644
--- a/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
+++ b/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
@@ -94,11 +94,10 @@
results in "[continuum] BUILD SUCCESSFUL: Hello World, Build Def - Nightly Test Build"
-->
<buildSubjectFormat>[continuum] BUILD ${state}: ${project.projectGroup.name} - ${project.name} - ${build.buildDefinition.description}</buildSubjectFormat>
- <prepareBuildSubjectFormat>[continuum] PREPARE BUILD ${state}: ${project.projectGroup.name}</prepareBuildSubjectFormat>
- <includeBuildResult>true</includeBuildResult>
+ <prepareBuildSubjectFormat>[continuum] PREPARE BUILD ${state}: ${projectScmRoot.projectGroup.name}</prepareBuildSubjectFormat>
<includeBuildSummary>true</includeBuildSummary>
<includeTestSummary>true</includeTestSummary>
- <includeOutput>false</includeOutput>
+ <includeBuildOutput>false</includeBuildOutput>
<alwaysSend>false</alwaysSend>
<!--
Setting this propery will make Continuum send all emails to
diff --git a/continuum-webapp/src/main/resources/localization/Continuum.properties b/continuum-webapp/src/main/resources/localization/Continuum.properties
index 06b9caf..b6961e1 100644
--- a/continuum-webapp/src/main/resources/localization/Continuum.properties
+++ b/continuum-webapp/src/main/resources/localization/Continuum.properties
@@ -197,6 +197,9 @@
projectGroup.scmRoot.title = Project Group Scm Root
projectGroup.scmRoot.label = Scm Root URL
projectGroup.cancelGroupBuild = Cancel Group Build
+projectGroup.invalid.id = Invalid Project Group Id: {0}
+projectGroup.build.error.noBuildAgent = Unable to build projects because no build agent is configured
+projectGroup.build.error.noBuildAgentInGroup = Unable to build projects because no build agent is configured in the build agent group
# ----------------------------------------------------------------------
# Page: Project Group - Members
@@ -239,6 +242,11 @@
confirmGroupRemoval.confirmation.message=Are you sure you want to delete the project group "{0}"?
# ----------------------------------------------------------------------
+# Page: Delete Project Group
+# ----------------------------------------------------------------------
+projectGroup.delete.error = Unable to remove project group
+
+# ----------------------------------------------------------------------
# Page: Configuration
# ----------------------------------------------------------------------
configuration.page.title = Continuum - Configuration
@@ -293,6 +301,7 @@
add.project.project.building.error = Unknown error trying to build POM.
add.project.unknown.error = The specified resource cannot be accessed. Please try again later or contact your administrator.
add.project.nogroup.error = No project group specified.
+add.project.duplicate.error = Trying to add duplicate projects in the same project group.
# ----------------------------------------------------------------------
# Page: AddMavenOneProject
@@ -330,7 +339,6 @@
add.m2.project.nonRecursiveProject = For multi-module project, load only root as recursive build
add.m2.project.buildDefinitionTemplate = Build Definition Template
add.m2.project.defaultBuildDefinition = Default
-add.m2.project.checkoutInSingleDirectory = Checkout multi-module project in single directory
# ----------------------------------------------------------------------
# Page: AddProject (ant or shell)
@@ -379,6 +387,7 @@
deleteProject.page.title = Continuum - Delete Continuum Project
deleteProject.section.title = Delete Continuum Project
deleteProject.confirmation.message = Are you sure you want to delete the project "{0}"?
+deleteProject.error = Unable to delete project with id {0}
# ----------------------------------------------------------------------
# Page: ProjectView
@@ -458,6 +467,10 @@
buildDefinition.alwaysBuild.label = Always Build
buildDefinition.noname.save.error.message = There was an error saving the schedule, no schedule name was supplied.
buildDefinition.duplicatename.save.error.message = There was an error saving the schedule, a schedule with the same name already exists.
+buildDefinition.updatePolicy.label = Update Policy
+buildDefinition.updatePolicy.always = Always
+buildDefinition.updatePolicy.never = Never
+buildDefinition.updatePolicy.newPom = Only for new Pom
# ----------------------------------------------------------------------
# Page: BuildSummary
@@ -490,6 +503,7 @@
notifier.type.label = Type
notifier.mail.recipient.address.label = Mail Recipient Address
notifier.mail.recipient.committers.label = Send a mail to latest committers
+notifier.mail.recipient.developers.label = Send a mail to project developers
notifier.irc.host.label = IRC Host
notifier.irc.port.label = IRC port
notifier.irc.channel.label = IRC channel
@@ -531,6 +545,7 @@
buildResults.state = State
buildResults.result = Result
buildResults.buildDefinition.description = Build Definition Description
+buildResults.delete.error = Unable to delete Build Results
# ----------------------------------------------------------------------
# Page: BuildResults
@@ -544,6 +559,7 @@
buildResult.trigger = Build Trigger
buildResult.state = State
buildResult.buildNumber = Build#
+buildResult.username = Triggered by
buildResult.buildError = Build Error
buildResult.buildOutput = Output
buildResult.noOutput = No output.
@@ -626,7 +642,7 @@
schedule.description.label = Description
schedule.description.message = Enter a description of the schedule
schedule.cronExpression.label = Cron Expression
-schedule.cronExpression.message = Enter the cron expression. Format is described there : <a href="http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html" target="_blank">Syntax<a>
+schedule.cronExpression.message = Enter the cron expression. Format is described there : <a href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html" target="_blank">Syntax<a>
schedule.maxJobExecutionTime.label = Maximum job execution time (seconds)
schedule.maxJobExecutionTime.message = Enter the maximum number of seconds a job may execute in this schedule before it''s terminated.
schedule.quietPeriod.label = Quiet Period (seconds)
@@ -647,6 +663,7 @@
schedule.available.buildqueues.used = --- Used Build Queues ---
schedule.buildqueues.add.error = Error attaching the build queue(s) to schedule.
schedule.name.already.exists = A Schedule with the same name already exists
+schedule.buildqueues.empty.error = Used Build Queues cannot be empty
# ----------------------------------------------------------------------
# Page: Delete Schedule
@@ -706,6 +723,7 @@
releaseViewResult.noOutput=No Output
releaseViewResult.projectName=Project Name
releaseViewResult.releaseGoal=Release Goal
+releaseViewResult.username=Triggered by
releasePrepare.scmUsername.label=SCM Username
releasePrepare.scmPassword.label=SCM Password
releasePrepare.scmTag.label=SCM Tag
@@ -722,7 +740,7 @@
releasePerformFromScm.scmPassword.label=SCM Password
releasePerformFromScm.scmTag.label=SCM Tag
releasePerformFromScm.scmTagBase.label=SCM Tag Base
-releasePerformFromScm.goals.label=Maven Arguments
+releasePerformFromScm.goals.label=Perform Goals
releasePerformFromScm.useReleaseProfile.label=Use Release Profile
releasePerformFromScm.buildEnvironment.label=Build Environment
releasePerformFromScm.page.title=Continuum - Perform Project Release
@@ -866,7 +884,7 @@
# Page: Queues
# ----------------------------------------------------------------------
buildQueue.page.title = Continuum - Build Queue
-buildQueue.section.title = Continuum - Build Queue
+buildQueue.section.title = Build Queue
buildQueue.empty = Build Queue is empty
buildQueue.currentTask.section.title = Current Build
buildQueue.currentTask.buildQueue = Build Queue
@@ -881,6 +899,13 @@
checkoutQueue.section.title = Checkout Queue
checkoutQueue.empty = Checkout Queue is empty
checkoutQueue.removeEntries = Cancel Entries
+prepareBuildQueue.currentTask.section.title = Current Prepare Build
+prepareBuildQueue.section.title = Prepare Build Queue
+prepareBuildQueue.table.projectGroupName = Project Group
+prepareBuildQueue.table.scmRootAddress = SCM Root URL
+prepareBuildQueue.empty = Prepare Build Queue is empty
+prepareBuildQueue.no.currentTasks = No current prepare build
+prepareBuildQueue.removeEntries = Cancel Entries
# ----------------------------------------------------------------------
# Page: Build Queue
@@ -894,7 +919,8 @@
buildResult.delete.confirmation.page.title = Continuum - Delete Build Results
buildResult.delete.confirmation.section.title = Delete Build Results
buildResult.delete.confirmation.message = Are you sure you want to delete {0} build results ?
-buildResult.cannot.delete = Cannot delete a build result which is currently building.
+buildResult.cannot.delete = Cannot delete the build result of a currently building project.
+buildResult.delete.error = Unable to delete Build Result with id {0}
# ----------------------------------------------------------------------
# Legend
@@ -957,7 +983,7 @@
repository.error.save.in.use = Unable to edit local repository because it is currently in use
repository.error.remove.in.use = Unable to remove local repository because it is currently in use
repository.error.purge.in.use = Unable to purge local repository because it is currently in use
-repository.error.remove.default = Cannot remove default local repository.
+repository.error.remove.default = Cannot remove default local repository
#-----------------------------------------------------------------------
# Page: Delete Local Repository
@@ -997,7 +1023,7 @@
purgeConfig.defaultPurge.label = Is it Default?
purgeConfig.schedule.label = Schedule
purgeConfig.description.label = Description
-purgeConfig.enabled.label = Enabled
+purgeConfig.enabled.label = Enabled Purge Configuration
purgeConfig.no.repositories = No repositories to purge
#-----------------------------------------------------------------------
@@ -1058,7 +1084,7 @@
appearance.noCompanyPom = You have not yet specified a company POM.
appearance.selectCompanyPom = Select a Company POM
appearance.detailsIntroduction = Your selected company POM is below.
-appearance.maybeChange = If you would like to change the organization name, url or logo, you can
+appearance.maybeChange = If you would like to change the organization name, URL or logo, you can
appearance.editThePomLink = edit the POM
appearance.companyPom.groupId = Group ID
appearance.companyPom.artifactId = Artifact ID
@@ -1150,12 +1176,22 @@
# Page: View Distributed Build
# ----------------------------------------------------------------------
distributedBuilds.page.title = Continuum - View Distributed Builds
-distributedBuilds.section.title = View Distributed Builds
+distributedBuilds.currentPrepareBuild.section.title = Current Prepare Build
+distributedBuilds.currentBuild.section.title = Current Build
+distributedBuilds.prepareBuildQueue.section.title = Prepare Build Queue
distributedBuilds.buildQueue.section.title = Build Queue
+distributedPrepareBuild.table.projectGroupName = Project Group Name
+distributedPrepareBuild.table.scmRootAddress = SCM Root URL
+distributedPrepareBuild.table.buildAgentUrl = Build Agent URL
+distributedPrepareBuilds.empty = Prepare Build Queue is empty
+distributedPrepareBuilds.no.currentTasks = No current prepare build
+distributedPrepareBuilds.removeEntries = Cancel Entries
+distributedBuild.table.projectName = Project Name
+distributedBuild.table.buildDefinitionLabel = Build Definition Label
distributedBuild.table.projectGroupName = Project Group Name
-distributedBuild.table.scmRootAddress = Scm Root Address
-distributedBuild.table.agentUrl = Build Agent URL
-distributedBuilds.empty = No Distributed Builds
+distributedBuild.table.buildAgentUrl = Build Agent URL
+distributedBuilds.empty = Build Queue is empty
+distributedBuilds.no.currentTasks = No current build
distributedBuilds.removeEntries = Cancel Entries
# ----------------------------------------------------------------------
diff --git a/continuum-webapp/src/main/resources/localization/Continuum_de.properties b/continuum-webapp/src/main/resources/localization/Continuum_de.properties
index ddf8f8c..351f952 100644
--- a/continuum-webapp/src/main/resources/localization/Continuum_de.properties
+++ b/continuum-webapp/src/main/resources/localization/Continuum_de.properties
@@ -77,7 +77,7 @@
menu.administration.users = Benutzer
menu.administration.userGroups = Benutzergruppen
menu.administration.roles = Rollen
-menu.administration.buildDefinitionTemplates = Vorgangsschablonen
+menu.administration.buildDefinitionTemplates = Vorgangsvorlagen
menu.account.options = Meine Daten
user.edit.account = Benutzerinformationen bearbeiten
menu.administration.queues = Warteschlangen
@@ -144,7 +144,7 @@
groups.table.groupId = Bezeichner
groups.table.totalProjects = Summe
groups.table.summary = Zusammenfassung
-groups.page.list.empty = Die Liste der Projektgruppen ist leer.
+groups.page.list.empty = Leere Projektgruppen-Liste.
groups.section.title = Projektgruppe:
groups.manage.label = Gruppe verwalten
groups.table.repositoryName = Lokales Repository
@@ -247,7 +247,7 @@
add.project.unknown.host.error = Zugriff auf den angegebenen Host nicht m\u00F6glich.
add.project.connect.error = Es konnte keine Verbindung zum entfernten System hergestellt werden.
add.project.malformed.url.error = Ung\u00FCltiger URL.
-add.project.xml.parse.error = XML des POM kann nicht verarbeitet werden.
+add.project.xml.parse.error = POM XML kann nicht verarbeitet werden.
add.project.extend.error = Es kann kein POM mit einem ''extend'' Element verwendet werden.
add.project.missing.pom.error = Die angegebene POM-Datei oder ein Modul daraus existiert nicht.
add.project.missing.groupid.error = Kein ''groupId'' Element im POM.
@@ -281,7 +281,7 @@
add.m1.project.m1PomFile.message = Bitte geben Sie den lokalen Dateinamen des zu \u00FCbertragenden Maven 1 POM an.
add.m1.project.m1PomFile.error = Es mu\u00DF ein g\u00FCltiger URL angegeben werden.
add.m1.project.projectGroup = Projektgruppe
-add.m1.project.buildDefinitionTemplate = Vorgangsschablone
+add.m1.project.buildDefinitionTemplate = Vorgangsvorlage
add.m1.project.defaultBuildDefinition = Standard
# ----------------------------------------------------------------------
@@ -301,7 +301,7 @@
# TODO: remove this part once uploading of an m2 project with modules is supported ( CONTINUUM-1098 )
add.m2.project.upload.modules.error = Es kann kein Maven 2 Projekt mit Modulen \u00FCbertragen werden.
add.m2.project.nonRecursiveProject = Bei Projekten mit mehreren Modulen nur das Eltern-Projekt laden.
-add.m2.project.buildDefinitionTemplate = Vorgangsschablone
+add.m2.project.buildDefinitionTemplate = Vorgangsvorlage
add.m2.project.defaultBuildDefinition = Standard
# ----------------------------------------------------------------------
@@ -339,7 +339,7 @@
projectVersion.message = Bitte geben Sie die Version des Projekts an.
projectScmUseCache.label = Legitimationsdaten zwischenspeichern, falls m\u00F6glich.
-add.project.buildDefinitionTemplate = Vorgangsschablone
+add.project.buildDefinitionTemplate = Vorgangsvorlage
add.project.defaultBuildDefinition = Standard
# ----------------------------------------------------------------------
@@ -531,7 +531,7 @@
buildResult.dependencies.artifactId = Artefakt-Bezeichner
buildResult.dependencies.version = Version
buildResult.changesSinceLastSuccess = Weitere \u00C4nderungen seit letzer erfolgreicher Ausf\u00FChrung
-buildResult.generatedReports.title = Generierte Berichte
+buildResult.generatedReports.title = Berichte
buildResult.generatedReports.surefire = Surefire-Bericht
buildResult.buildOutput.text = Als Text herunterladen
buildResult.buildDefinition = Vorgangsdefinition
@@ -549,7 +549,7 @@
# From ContinuumProjectState
buildResult.trigger.0 = durch Warteschlange
-buildResult.trigger.1 = erzwungen
+buildResult.trigger.1 = durch Benutzer
buildResult.state.1 = Neu
buildResult.state.2 = Ok
buildResult.state.3 = Fehlversuch
@@ -592,7 +592,7 @@
schedule.description.label = Beschreibung
schedule.description.message = Bitte geben Sie eine Beschreibung des Zeitplans an.
schedule.cronExpression.label = Cron-Ausdruck
-schedule.cronExpression.message = Bitte geben Sie den Cron-Ausdruck an. Eine Beschreibung des Formats finden Sie <a href="http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html" target="_blank">hier<a>.
+schedule.cronExpression.message = Bitte geben Sie den Cron-Ausdruck an. Eine Beschreibung des Formats finden Sie <a href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html" target="_blank">hier<a>.
schedule.maxJobExecutionTime.label = Maximale Ausf\u00FChrungszeit (Sekunden)
schedule.maxJobExecutionTime.message = Bitte geben Sie die maximale Anzahl Sekunden an, die ein Vorgang dieses Zeitplans ausgef\u00FChrt werden kann, bevor er abgebrochen wird.
schedule.quietPeriod.label = Ruhezeit (Sekunden)
@@ -666,7 +666,7 @@
releasePerformFromScm.scmPassword.label=SCM Passwort
releasePerformFromScm.scmTag.label=SCM Markierung
releasePerformFromScm.scmTagBase.label=SCM Markierungs-Basis
-releasePerformFromScm.goals.label=Maven Argumente
+releasePerformFromScm.goals.label=Perform Goals
releasePerformFromScm.useReleaseProfile.label=Ver\u00F6ffentlichungs-Profil verwenden
releasePerformFromScm.buildEnvironment.label=Umgebung
@@ -752,7 +752,7 @@
# ----------------------------------------------------------------------
# Page: Build Definitions Templates Summary
# ----------------------------------------------------------------------
-buildDefinition.templates.page.title = Continuum - Vorgangsschablonen
+buildDefinition.templates.page.title = Continuum - Vorgangsvorlagen
buildDefinition.templates.continuum.section.title = Continuum Standard Vorgangsdefinition
buildDefinition.templates.goals = Goals
buildDefinition.templates.arguments = Argumente
@@ -763,14 +763,14 @@
buildDefinition.templates.alwaysBuild = Immer ausf\u00FChren
buildDefinition.templates.description = Beschreibung
buildDefinition.templates.type = Typ
-buildDefinition.templates.section.title = Verf\u00FCgbare Vorgangsschablonen
+buildDefinition.templates.section.title = Verf\u00FCgbare Vorgangsvorlagen
buildDefinition.templates.buildDefinitions.section.title = Verf\u00FCgbare Vorgangsdefinitionen
# ----------------------------------------------------------------------
# Page: Edit Build Definition Template
# ----------------------------------------------------------------------
-buildDefinition.template.page.title = Continuum - Vorgangsschablone hinzuf\u00FCgen/bearbeiten
-buildDefinition.template.section.title = Vorgangsschablone hinzuf\u00FCgen/bearbeiten
+buildDefinition.template.page.title = Continuum - Vorgangsvorlage hinzuf\u00FCgen/bearbeiten
+buildDefinition.template.section.title = Vorgangsvorlage hinzuf\u00FCgen/bearbeiten
buildDefinition.template.name = Name
buildDefinition.template.buildDefinition.goals = Goals
buildDefinition.template.buildDefinition.arguments = Argumente
@@ -791,7 +791,7 @@
# ----------------------------------------------------------------------
buildQueue.page.title = Continuum - Warteschlangen
buildQueue.section.title = Ausstehende Vorg\u00E4nge
-buildQueue.empty = Die Warteschlange ist leer.
+buildQueue.empty = Die Vorgangs-Warteschlange ist leer.
buildQueue.currentTask.section.title = Aktuelle Vorg\u00E4nge
buildQueue.currentTask.projectName = Projektname
buildQueue.currentTask.buildDefinition = Vorgangsdefinition
@@ -891,9 +891,9 @@
purgeConfigs.dir.section.title = Verzeichnis Bereinigungskonfigurationen
purgeConfigs.table.repository = Repository
purgeConfigs.table.description = Beschreibung
-purgeConfigs.table.retentionCount = Aufbewahrungstage
+purgeConfigs.table.retentionCount=Aufzubewahrende Artefakte/Verzeichnisse
purgeConfigs.table.schedule = Zeitplan
-purgeConfigs.table.daysOlder = \u00C4lter als (in Tagen)
+purgeConfigs.table.daysOlder = \u00C4lter als
purgeConfigs.table.deleteAll = Alle l\u00F6schen
purgeConfigs.table.directoryType = Verzeichnistyp
purgeConfigs.table.default = Standard
@@ -907,7 +907,7 @@
purgeConfig.section.title = Bereinigungskonfiguration hinzuf\u00FCgen/bearbeiten
purgeConfig.repository.label = Repository
purgeConfig.directoryType.label = Verzeichnistyp
-purgeConfig.retentionCount.label = Aufbewahrungstage
+purgeConfig.retentionCount.label=Aufzubewahrende Artefakte/Verzeichnisse
purgeConfig.daysOlder.label = \u00C4lter als (in Tagen)
purgeConfig.deleteAll.label = Alle l\u00F6schen
purgeConfig.deleteReleasedSnapshots.label = Ver\u00F6ffentlichte Snapshots l\u00F6schen
@@ -955,7 +955,7 @@
scmResult.section.title = SCM Ergebnis
scmResult.state = Status
scmResult.projectGroupName = Projektgruppenname
-scmResult.scmRootAddress = SCM Wurzel-Verzeichnis-URL
+scmResult.scmRootAddress = SCM Hauptverzeichnis-URL
scmResult.scmError = SCM Fehler
# ----------------------------------------------------------------------
@@ -988,13 +988,13 @@
companyPom.section.title=Firmen-POM
companyPom.autoIncrementVersion=Die Version wird beim Speichern automatisch inkrementiert.
notifier.event.sendOnScmFailure=Bei SCM-Fehler senden
-projectGroup.scmRoot.label=SCM Wurzel-Verzeichnis-URL
-projectGroup.scmRoot.title=SCM Wurzel-Verzeichnisse
+projectGroup.scmRoot.label=SCM Hauptverzeichnis-URL
+projectGroup.scmRoot.title=SCM Hauptverzeichnisse
releasePrepare.useEditMode.label=''Editmodus'' verwenden
projectGroup.cancelGroupBuild=Gruppenvorg\u00E4nge abbrechen
configuration.allowed.build.parallel=Maximal erlaubte Anzahl parallel ausgef\u00FChrter Vorg\u00E4nge
configuration.disable.parallel.builds=Parallel ausf\u00FChrbare Vorg\u00E4nge deaktivieren
-configuration.allowed.build.paralle.message=Bitte geben Sie die maximal erlaubte Anzahl parallel ausgef\u00FChrter Vorg\u00E4nge an.
+configuration.allowed.build.paralle.message=Bitte geben Sie die maximal erlaubte Anzahl parallel ausf\u00FChrbarer Vorg\u00E4nge an.
configuration.numberOfBuildsInParallel.invalid=Die erlaubte Anzahl parallel ausf\u00FChrbarer Vorg\u00E4nge mu\u00DF gr\u00F6\u00DFer als Null sein.
configuration.distributedBuildEnabled.label=Vorgangsverteilung aktiv
projectDescription.label=Beschreibung
@@ -1013,7 +1013,7 @@
checkoutQueue.currentTask.buildQueue=Warteschlange
buildQueue.cannot.delete=Die Warteschlange kann nicht gel\u00F6scht werden, da Vorg\u00E4nge ausgef\u00FChrt werden.
buildQueue.delete.error=Die Warteschlange konnte nicht aus der Datenbank entfernt werden.
-deletePurgeConfiguration.page.title=Continnum - Bereinigungskonfiguration l\u00F6schen
+deletePurgeConfiguration.page.title=Continuum - Bereinigungskonfiguration l\u00F6schen
deletePurgeConfiguration.section.title=Bereinigungskonfiguration l\u00F6schen
deletePurgeConfiguration.confirmation.message=Soll die ''{0}'' Bereinigungskonfiguration wirklich gel\u00F6scht werden ?
parallel.build.queues.page.title=Continuum - Warteschlangen
@@ -1040,12 +1040,9 @@
deleteBuildAgent.section.title=Vorgangsagent l\u00F6schen
deleteBuildAgent.confirmation.message=Soll der ''{0}'' Vorgangsagent wirklich gel\u00F6scht werden ?
distributedBuilds.page.title=Continuum - Warteschlangen
-distributedBuilds.section.title=Aktuelle Vorg\u00E4nge
distributedBuilds.buildQueue.section.title=Ausstehende Vorg\u00E4nge
distributedBuild.table.projectGroupName=Projektgruppenname
-distributedBuild.table.scmRootAddress=Scm Wurzel Adresse
-distributedBuild.table.agentUrl=Vorgangsagent URL
-distributedBuilds.empty=Aktuell werden keine Vorg\u00E4nge ausgef\u00FChrt.
+distributedBuilds.empty=Die Vorgangs-Warteschlange ist leer.
distributedBuilds.removeEntries=Eintr\u00E4ge abbrechen
buildDefinitionSummary.project.section.title=Projekt Vorgangsdefinitionen
buildDefinitionSummary.project=Projekt
@@ -1075,9 +1072,9 @@
deleteInstallation.page.title=Continuum - Installation l\u00F6schen
deleteInstallation.section.title=Installation l\u00F6schen
deleteInstallation.confirmation.message=Soll die ''{0}'' Installation wirklich gel\u00F6scht werden ?
-deletebuildDefinition.template.page.title=Continuum - Vorgangsschablone l\u00F6schen
-deletebuildDefinition.template.section.title=Vorgangsschablone l\u00F6schen
-deletebuildDefinition.template.confirmation.message=Soll die ''{0}'' Vorgangsschablone wirklich gel\u00F6scht werden ?
+deletebuildDefinition.template.page.title=Continuum - Vorgangsvorlage l\u00F6schen
+deletebuildDefinition.template.section.title=Vorgangsvorlage l\u00F6schen
+deletebuildDefinition.template.confirmation.message=Soll die ''{0}'' Vorgangsvorlage wirklich gel\u00F6scht werden ?
deleteBuildQueue.page.title=Continuum - Warteschlange l\u00F6schen
deleteBuildQueue.section.title=Warteschlange l\u00F6schen
deleteBuildQueue.confirmation.message=Soll die ''{0}'' Warteschlange wirklich gel\u00F6scht werden ?
@@ -1100,13 +1097,13 @@
buildAgentGroup.available.buildAgents=--- Verf\u00FCgbare Vorgangsagenten ---
buildAgentGroup.available.buildAgents.used=--- Verwendete Vorgangsagenten ---
buildAgentGroup.buildAgents.define=Konfiguration der zu verwendenden Vorgangsagenten
-buildAgentGroup.error.remove.in.use=Die Vorgangsagenten-Gruppe kann nicht gel\u00F6scht werden - wird mit einer Umgebung verwendet.
+buildAgentGroup.error.remove.in.use=Die Vorgangsagenten-Gruppe kann nicht gel\u00F6scht werden - sie wird mit einer Umgebung verwendet.
releases.page.title=Continuum - Ver\u00F6ffentlichungen
releases.section.title=Ver\u00F6ffentlichungen
releaseSummary.table.releaseId=Ver\u00F6ffentlichungs ID
releaseSummary.table.releaseGoal=Ver\u00F6ffentlichungs-Goal
releaseSummary.table.buildAgentUrl=URL des Vorgangsagenten
-distributedBuild.releasePrepare.input.error=Projektverarbeitung nicht m\u00F6glich. Der {0} Vorgangsagent wurde entweder entfernt bzw. deaktiviert, oder es wurde noch kein Vorgang ausgef\u00FChrt
+distributedBuild.releasePrepare.input.error=Projektverarbeitung nicht m\u00F6glich. Der {0} Vorgangsagent wurde entweder entfernt bzw. deaktiviert, oder es wurde noch kein Vorgang ausgef\u00FChrt.
distributedBuild.releasePrepare.error=Ver\u00F6ffentlichungs-Vorbereitung nicht m\u00F6glich.
distributedBuild.releasePrepare.release.error=Ver\u00F6ffentlichungs-Vorbereitung nicht m\u00F6glich. Der {0} Vorgangsagent wurde zwischenzeitlich entfernt oder deaktiviert.
distributedBuild.releaseInProgress.error=Anzeige des Ver\u00F6ffentlichungs-Vorgangs nicht m\u00F6glich. Der {0} Vorgangsagent wurde zwischenzeitlich entfernt oder deaktiviert.
@@ -1125,9 +1122,37 @@
releasePerformFromScm.parameters.section.title=Parameter
authorizationError.page.title=Continuum - Autorisierungs-Fehler
authorizationError.section.title=Autorisierungs-Fehler
-authorizationError.not.authorized=Autorisierung fehlgeschlagen. Bitte kontaktieren Sie Ihren Administrator, um entsprechende Berechtigungen zugewiesen zu bekommen.
+authorizationError.not.authorized=Autorisierung fehlgeschlagen. Bitte kontaktieren Sie Ihren Administrator, um entsprechende Berechtigungen erteilt zu bekommen.
errorOccured.page.title=Continuum - Fehler
errorOccured.section.title=Fehler
menu.continuum=Continuum
releaseError.page.title=Continuum - Ver\u00F6ffentlichung fehlgeschlagen
releaseError.section.title=Ver\u00F6ffentlichung fehlgeschlagen
+add.project.duplicate.error=Ein identisches Projekt existiert in dieser Gruppe bereits.
+distributedPrepareBuild.table.scmRootAddress=SCM Hauptverzeichnis-URL
+distributedBuilds.currentBuild.section.title=Aktuelle Vorg\u00E4nge
+projectGroup.delete.error=Die Projektgruppe konnte nicht gel\u00F6scht werden.
+buildResult.delete.error=Das ''{0}'' Vorgangsergebnis konnte nicht gel\u00F6scht werden.
+prepareBuildQueue.table.projectGroupName=Projektgruppe
+distributedPrepareBuild.table.projectGroupName=Projektgruppen-Name
+prepareBuildQueue.table.scmRootAddress=SCM Hauptverzeichnis-URL
+deleteProject.error=Das ''{0}'' Projekt konnte nicht gel\u00F6scht werden.
+buildResults.delete.error=Die Vorgangsergebnisse konnten nicht gel\u00F6scht werden.
+distributedPrepareBuilds.no.currentTasks=Aktuell wird kein Vorgang vorbereitet.
+distributedBuilds.currentPrepareBuild.section.title=Aktuelle Vorbereitungen
+distributedBuilds.prepareBuildQueue.section.title=Ausstehende Vorbereitungen
+distributedPrepareBuild.table.buildAgentUrl=Vorgangsagent URL
+distributedBuild.table.buildAgentUrl=Vorgangsagent URL
+distributedBuild.table.projectName=Projektname
+prepareBuildQueue.currentTask.section.title=Aktuelle Vorbereitungen
+prepareBuildQueue.removeEntries=Auswahl abbrechen
+prepareBuildQueue.section.title=Ausstehende Vorbereitungen
+distributedBuild.table.buildDefinitionLabel=Vorgangsdefinition
+distributedBuilds.no.currentTasks=Aktuell wird kein Vorgang ausgef\u00FChrt.
+distributedPrepareBuilds.empty=Die Vorbereitungs-Warteschlange ist leer.
+prepareBuildQueue.empty=Die Vorbereitungs-Warteschlange ist leer.
+distributedPrepareBuilds.removeEntries=Auswahl abbrechen
+prepareBuildQueue.no.currentTasks=Aktuell wird kein Vorgang vorbereitet.
+releasePrepare.input.error=Die ''Release-Plugin'' Parameter konnten nicht ermittelt werden - Verarbeitung fehlgeschlagen - {0}
+projectGroup.invalid.id=Ung\u00FCltiger Gruppen-Bezeichner: {0}
+schedule.buildqueues.empty.error=Es m\u00FCssen zu verwendende Warteschlangen angegeben werden.
diff --git a/continuum-webapp/src/main/resources/localization/Continuum_en.properties b/continuum-webapp/src/main/resources/localization/Continuum_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/localization/Continuum_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/localization/Continuum_fr.properties b/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
index 93e7cae..42afbc8 100644
--- a/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
+++ b/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
@@ -198,6 +198,7 @@
projectGroup.scmRoot.title = Racine SCM du groupe de projet
projectGroup.scmRoot.label = URL de la racine SCM
projectGroup.cancelGroupBuild = Annuler la construction du groupe
+projectGroup.invalid.id = Id du groupe de projets invalide : {0}
# ----------------------------------------------------------------------
# Page: Project Group - Members
@@ -626,7 +627,7 @@
schedule.description.label = Description
schedule.description.message = Entrer une description pour la planification
schedule.cronExpression.label = Expression Cron
-schedule.cronExpression.message = Entrer l''expression Cron Le format est d\u00e9crit l\u00e0 : <a href="http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html" target="_blank">Syntaxe<a>
+schedule.cronExpression.message = Entrer l''expression Cron Le format est d\u00e9crit l\u00e0 : <a href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html" target="_blank">Syntaxe<a>
schedule.maxJobExecutionTime.label = Temp d''ex\u00e9cution du travail maximum
schedule.maxJobExecutionTime.message = Entrer le nombre maximal de secondes que le travail peut prendre pour s''executer dans cette planification avant d''\u00eatre tu\u00e9.
schedule.quietPeriod.label = P\u00e9riode d''attente (secondes)
@@ -722,7 +723,7 @@
releasePerformFromScm.scmPassword.label=Mot de passe SCM
releasePerformFromScm.scmTag.label=SCM Tag
releasePerformFromScm.scmTagBase.label=SCM Tag Base
-releasePerformFromScm.goals.label=Arguments Maven
+releasePerformFromScm.goals.label=Perform Goals
releasePerformFromScm.useReleaseProfile.label=Utilisation du profile "release"
releasePerformFromScm.buildEnvironment.label=Environment de construction
releasePerformFromScm.page.title=Continuum - Effectuer la "release" du projet
diff --git a/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties b/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
index 4631503..0e38e94 100644
--- a/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
+++ b/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
@@ -556,7 +556,7 @@
save = Salvar
schedule.cronExpression.label = Express\u00E3o Cron
-schedule.cronExpression.message = Informe a express\u00E3o cron. O formato est\u00E1 descrito aqui: <a href="http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html" target="_blank">Sintaxe<a>
+schedule.cronExpression.message = Informe a express\u00E3o cron. O formato est\u00E1 descrito aqui: <a href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html" target="_blank">Sintaxe<a>
schedule.dayOfMonth.label = Dia do M\u00EAs
schedule.dayOfWeek.label = Dia da Semana
schedule.description.label = Descri\u00E7\u00E3o
diff --git a/continuum-webapp/src/main/resources/localization/Continuum_zh_CN.properties b/continuum-webapp/src/main/resources/localization/Continuum_zh_CN.properties
index a7fff20..d650064 100644
--- a/continuum-webapp/src/main/resources/localization/Continuum_zh_CN.properties
+++ b/continuum-webapp/src/main/resources/localization/Continuum_zh_CN.properties
@@ -597,7 +597,7 @@
schedule.description.label = \u63cf\u8ff0
schedule.description.message = \u8f93\u5165\u8ba1\u5212\u7684\u63cf\u8ff0
schedule.cronExpression.label = Cron\u8868\u8fbe\u5f0f
-schedule.cronExpression.message = \u8f93\u5165cron\u8868\u8fbe\u5f0f\u3002\u683c\u5f0f\u5982\u8fd9\u91cc\u63cf\u8ff0\uff1a<a href="http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html" target="_blank">\u8bed\u6cd5<a>
+schedule.cronExpression.message = \u8f93\u5165cron\u8868\u8fbe\u5f0f\u3002\u683c\u5f0f\u5982\u8fd9\u91cc\u63cf\u8ff0\uff1a<a href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html" target="_blank">\u8bed\u6cd5<a>
schedule.maxJobExecutionTime.label = \u6700\u5927\u4f5c\u4e1a\u6267\u884c\u65f6\u95f4\uff08\u79d2\uff09
schedule.maxJobExecutionTime.message = \u4e00\u4e2a\u4f5c\u4e1a\u6267\u884c\u5b8c\u6210\u53ef\u80fd\u4f7f\u7528\u7684\u6700\u5927\u79d2\u6570\u3002
schedule.quietPeriod.label = \u5e73\u9759\u671f\uff08\u79d2\uff09
@@ -672,7 +672,7 @@
releasePerformFromScm.scmPassword.label=SCM\u5bc6\u7801
releasePerformFromScm.scmTag.label=SCM\u6807\u7b7e
releasePerformFromScm.scmTagBase.label=SCM\u6807\u7b7eBase
-releasePerformFromScm.goals.label=Maven\u53c2\u6570
+releasePerformFromScm.goals.label=Perform Goals
releasePerformFromScm.useReleaseProfile.label=\u4f7f\u7528\u53d1\u5e03\u914d\u7f6e\u9009\u9879
releasePerformFromScm.buildEnvironment.label=\u6784\u5efa\u73af\u5883
diff --git a/continuum-webapp/src/main/resources/log4j.xml b/continuum-webapp/src/main/resources/log4j.xml
index cd3d230..a47b4ba 100644
--- a/continuum-webapp/src/main/resources/log4j.xml
+++ b/continuum-webapp/src/main/resources/log4j.xml
@@ -58,116 +58,96 @@
<appender-ref ref="redbackAuditLog" />
</logger>
- <!-- Help identify bugs during testing -->
+<!--
<logger name="org.apache.maven">
<level value="info"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.apache.continuum">
<level value="info" />
- <appender-ref ref="rolling" />
</logger>
<logger name="org.codehaus.plexus.redback">
<level value="info"/>
- <appender-ref ref="rolling" />
- </logger>
-
- <!-- squelch noisy objects (for now) -->
- <logger name="org.apache.commons">
- <level value="warn"/>
- <appender-ref ref="rolling" />
- </logger>
-
- <logger name="net.sf.ehcache">
- <level value="warn"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.codehaus.plexus.mailsender.MailSender">
<level value="info"/>
- <appender-ref ref="rolling" />
- </logger>
-
- <logger name="org.codehaus.plexus.velocity">
- <level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.quartz">
<level value="info"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.apache.jasper">
<level value="info"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="com.opensymphony.xwork">
<level value="info"/>
- <appender-ref ref="rolling" />
- </logger>
-
- <!-- CONTINUUM-1228 -->
- <logger name="com.opensymphony.xwork2.util.OgnlUtil">
- <level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.codehaus.plexus.PlexusContainer">
<level value="info"/>
- <appender-ref ref="rolling" />
+ </logger>
+-->
+
+ <!-- squelch noisy objects (for now) -->
+ <logger name="org.apache.commons">
+ <level value="warn"/>
+ </logger>
+
+ <logger name="net.sf.ehcache">
+ <level value="warn"/>
+ </logger>
+
+ <logger name="org.codehaus.plexus.velocity">
+ <level value="error"/>
+ </logger>
+
+ <logger name="com.opensymphony.xwork2.util.OgnlUtil">
+ <level value="error"/>
</logger>
<logger name="JPOX">
<level value="warn"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="JPOX.MetaData">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="JPOX.RDBMS.SQL">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="SQL">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="freemarker">
<level value="warn"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.codehaus.plexus.component.manager.ClassicSingletonComponentManager">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.springframework.beans.factory.xml.XmlBeanDefinitionReader">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="org.springframework.beans.factory.support.DefaultListableBeanFactory">
<level value="error"/>
- <appender-ref ref="rolling" />
</logger>
<logger name="net.sf.dozer.util.mapping.util.XMLParser">
<level value="warn"/>
- <appender-ref ref="rolling" />
</logger>
<root>
<priority value="info" />
+ <appender-ref ref="rolling" />
</root>
</log4j:configuration>
diff --git a/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction_en.properties b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/LocalRepositoryAction_en.properties b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/LocalRepositoryAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/LocalRepositoryAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction_en.properties b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/security_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/security_en.properties
new file mode 100644
index 0000000..fe95886
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/security_en.properties
@@ -0,0 +1,18 @@
+#
+# 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.
+#
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_en.properties
new file mode 100644
index 0000000..d8a500d
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_en.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/LoginAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/LoginAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/LoginAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_en.properties
new file mode 100644
index 0000000..d8a500d
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_en.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_en.properties
new file mode 100644
index 0000000..d8a500d
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_en.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePerformAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePerformAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePerformAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePrepareAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePrepareAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ReleasePrepareAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserGroupManagementAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserGroupManagementAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserGroupManagementAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserManagementAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserManagementAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/UserManagementAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
index 15f8fd4..94ebec5 100644
--- a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
@@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
+buildDefintionTemplate.name.exists = Name already exists
buildDefintionTemplate.name.required = Name is required
buildDefintion.buildFile.required = BuildFile is required
-buildDefintion.description.required = Description is required
\ No newline at end of file
+buildDefintion.description.required = Description is required
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction_en.properties
new file mode 100644
index 0000000..d8a500d
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction_en.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildQueueAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildQueueAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildQueueAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/InstallationAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ProfileAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ProfileAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ProfileAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonGroupNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonGroupNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonGroupNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonProjectNotifierEditAction_en.properties b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonProjectNotifierEditAction_en.properties
new file mode 100644
index 0000000..661b0cb
--- /dev/null
+++ b/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/WagonProjectNotifierEditAction_en.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+
diff --git a/continuum-webapp/src/main/resources/struts.xml b/continuum-webapp/src/main/resources/struts.xml
index 00ec40c..dd5d4eb 100644
--- a/continuum-webapp/src/main/resources/struts.xml
+++ b/continuum-webapp/src/main/resources/struts.xml
@@ -67,6 +67,20 @@
<param name="excludeMethods">input,back,cancel,browse,edit</param>
</interceptor-ref>
</interceptor-stack>
+
+ <interceptor-stack name="storeStack">
+ <interceptor-ref name="configuredContinuumStack"/>
+ <interceptor-ref name="store">
+ <param name="operationMode">STORE</param>
+ </interceptor-ref>
+ </interceptor-stack>
+
+ <interceptor-stack name="retrieveStack">
+ <interceptor-ref name="configuredContinuumStack"/>
+ <interceptor-ref name="store">
+ <param name="operationMode">RETRIEVE</param>
+ </interceptor-ref>
+ </interceptor-stack>
</interceptors>
<default-interceptor-ref name="configuredContinuumStack"/>
@@ -147,14 +161,18 @@
allowing plexus-security to call out from its own set of actions
into the application webapp, using global result names. -->
<action name="redbackRedirect" class="redback-redirect" method="redirect">
+ <interceptor-ref name="retrieveStack"/>
<result type="redirect-action">groupSummary</result>
</action>
+ <action name="httpError" class="httpError">
+ <result name="success">/WEB-INF/jsp/error/httpError.jsp</result>
+ </action>
+
<action name="about" class="about">
<result name="success">/WEB-INF/jsp/about.jsp</result>
</action>
-
<action name="companyInfo" class="companyInfo">
<result name="success">/WEB-INF/jsp/components/companyLogo.jsp</result>
<interceptor-ref name="basicStack" />
@@ -167,6 +185,7 @@
<action name="groupSummary" class="groupSummary">
+ <interceptor-ref name="retrieveStack"/>
<result name="success">/WEB-INF/jsp/groupSummary.jsp</result>
</action>
@@ -223,6 +242,7 @@
</action>
<action name="deleteProject" class="deleteProject">
+ <interceptor-ref name="storeStack"/>
<result name="delete">/WEB-INF/jsp/deleteProject.jsp</result>
<result name="success" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
@@ -231,6 +251,7 @@
</action>
<action name="ProjectsList" class="projects">
+ <interceptor-ref name="storeStack"/>
<result name="confirmRemove">/WEB-INF/jsp/confirmDeleteProjects.jsp</result>
<result name="success" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
@@ -239,6 +260,7 @@
</action>
<action name="buildProject" class="buildProject">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="chain">groupSummary</result>
<result name="to_group_page" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
@@ -300,7 +322,11 @@
* project group actions
-->
<action name="projectGroupSummary" class="projectGroup" method="summary">
+ <interceptor-ref name="retrieveStack"/>
<result name="success">/WEB-INF/jsp/projectGroupSummary.jsp</result>
+ <result name="to_summary_page" type="redirect-action">
+ <param name="actionName">groupSummary</param>
+ </result>
</action>
<action name="projectGroupMembers" class="projectGroup" method="members">
@@ -316,6 +342,7 @@
</action>
<action name="buildProjectGroup" class="projectGroup" method="build">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
<param name="projectGroupId">${projectGroupId}</param>
@@ -324,6 +351,7 @@
</action>
<action name="removeProjectGroup" class="projectGroup" method="remove">
+ <interceptor-ref name="storeStack"/>
<result name="confirm">/WEB-INF/jsp/confirmGroupRemoval.jsp</result>
<result name="success" type="redirect-action">
<param name="actionName">groupSummary</param>
@@ -331,6 +359,7 @@
</action>
<action name="releaseProjectGroup" class="projectGroup" method="release">
+ <interceptor-ref name="storeStack"/>
<result name="input" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
<param name="projectGroupId">${projectGroupId}</param>
@@ -362,10 +391,12 @@
* build results, test reporting, working copy actions
-->
<action name="buildResults" class="buildResults">
+ <interceptor-ref name="retrieveStack"/>
<result name="success">/WEB-INF/jsp/buildResults.jsp</result>
</action>
<action name="removeBuildResults" class="buildResults" method="remove">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="redirect-action">
<param name="actionName">buildResults</param>
<param name="projectId">${projectId}</param>
@@ -374,6 +405,7 @@
</action>
<action name="buildResult" class="buildResult">
+ <interceptor-ref name="storeStack"/>
<result name="success">/WEB-INF/jsp/buildResult.jsp</result>
<result name="error" type="redirect-action">
<param name="actionName">projectGroupSummary</param>
@@ -389,6 +421,7 @@
</action>
<action name="removeBuildResult" class="buildResult" method="remove">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="redirect-action">
<param name="actionName">buildResults</param>
<param name="projectId">${projectId}</param>
@@ -404,7 +437,7 @@
<result name="success">/WEB-INF/jsp/workingCopy.jsp</result>
<result name="stream" type="stream">
<param name="contentType">application/octet-stream</param>
- <param name="contentDisposition">filename="${downloadFilename}"</param>
+ <param name="contentDisposition">attachment; filename="${downloadFilename}"</param>
<param name="contentLength">${fileLength}</param>
</result>
</action>
@@ -648,6 +681,7 @@
-->
<action name="buildEnvList" class="profileAdministration" method="list">
+ <interceptor-ref name="retrieveStack"/>
<result name="success">/WEB-INF/jsp/admin/profilesList.jsp</result>
</action>
@@ -661,17 +695,12 @@
</action>
<action name="deleteBuildEnv" class="profileAdministration" method="delete">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="redirect-action">
<param name="actionName">buildEnvList</param>
<param name="namespace">/admin</param>
<param name="method">list</param>
</result>
- <result name="error" type="redirect-action">
- <param name="actionName">buildEnvList</param>
- <param name="namespace">/admin</param>
- <param name="method">list</param>
- <param name="errorMessage">${message}</param>
- </result>
</action>
<action name="confirmDeleteBuildEnv" class="profileAdministration" method="confirmDelete">
@@ -818,6 +847,18 @@
<param name="actionName">displayQueues</param>
</result>
</action>
+
+ <action name="removePrepareBuildEntry" class="queues" method="removePrepareBuildEntry">
+ <result name="success" type="redirect-action">
+ <param name="actionName">displayQueues</param>
+ </result>
+ </action>
+
+ <action name="removePrepareBuildEntries" class="queues" method="removePrepareBuildEntries">
+ <result name="success" type="redirect-action">
+ <param name="actionName">displayQueues</param>
+ </result>
+ </action>
<action name="cancelDistributedBuild" class="queues" method="cancelDistributedBuild">
<result name="success" type="redirect-action">
@@ -825,12 +866,24 @@
</result>
</action>
+ <action name="removeDistributedPrepareBuildEntry" class="queues" method="removeDistributedPrepareBuildEntry">
+ <result name="success" type="redirect-action">
+ <param name="actionName">displayQueues</param>
+ </result>
+ </action>
+
+ <action name="removeDistributedPrepareBuildEntries" class="queues" method="removeDistributedPrepareBuildEntries">
+ <result name="success" type="redirect-action">
+ <param name="actionName">displayQueues</param>
+ </result>
+ </action>
+
<action name="removeDistributedBuildEntries" class="queues" method="removeDistributedBuildEntries">
<result name="success" type="redirect-action">
<param name="actionName">displayQueues</param>
</result>
</action>
-
+
<action name="removeDistributedBuildEntry" class="queues" method="removeDistributedBuildEntry">
<result name="success" type="redirect-action">
<param name="actionName">displayQueues</param>
@@ -867,6 +920,7 @@
-->
<action name="repositoryList" class="localRepository" method="list">
+ <interceptor-ref name="retrieveStack"/>
<result name="success">/WEB-INF/jsp/admin/localRepositoriesList.jsp</result>
</action>
@@ -884,10 +938,7 @@
</action>
<action name="removeRepository" class="localRepository" method="remove">
- <result name="error" type="redirect-action">
- <param name="actionName">repositoryList</param>
- <param name="errorMessage">${message}</param>
- </result>
+ <interceptor-ref name="storeStack"/>
<result name="confirm">/WEB-INF/jsp/admin/confirmDeleteLocalRepository.jsp</result>
<result name="success" type="redirect-action">
<param name="actionName">repositoryList</param>
@@ -895,13 +946,10 @@
</action>
<action name="purgeRepository" class="localRepository" method="doPurge">
+ <interceptor-ref name="storeStack"/>
<result name="success" type="redirect-action">
<param name="actionName">repositoryList</param>
</result>
- <result name="error" type="redirect-action">
- <param name="actionName">repositoryList</param>
- <param name="errorMessage">${message}</param>
- </result>
</action>
<!--
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
index b79e1f7..3208bc1 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
@@ -66,7 +66,7 @@
</bean>
<bean id="masterBuildAgentTransportServer" class="org.apache.continuum.distributed.transport.master.MasterBuildAgentTransportServer">
- <constructor-arg ref="distributedBuildManager"/>
+ <constructor-arg ref="distributedBuildService"/>
</bean>
<bean name="xmlrpcServicesList" class="java.util.ArrayList">
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
index 7c13137..e04a64a 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
@@ -82,7 +82,6 @@
</c:otherwise>
</c:choose>
<s:checkbox label="%{getText('add.m2.project.nonRecursiveProject')}" name="nonRecursiveProject" />
- <s:checkbox label="%{getText('add.m2.project.checkoutInSingleDirectory')}" name="checkoutInSingleDirectory" />
<s:select label="%{getText('add.m2.project.buildDefinitionTemplate')}" name="buildDefinitionTemplateId"
list="buildDefinitionTemplates" listKey="id" listValue="name" headerKey="-1"
headerValue="%{getText('add.m2.project.defaultBuildDefinition')}"/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp
index f1fd74d..6841d27 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp
@@ -86,6 +86,14 @@
<s:select label="%{getText('projectGroup.name.label')}" name="selectedProjectGroup" list="projectGroups" listKey="id" listValue="name"/>
</c:otherwise>
</c:choose>
+ <c:choose>
+ <c:when test="${!empty projectGroups}">
+ <s:hidden name="emptyProjectGroups" value="false"/>
+ </c:when>
+ <c:otherwise>
+ <s:hidden name="emptyProjectGroups" value="true"/>
+ </c:otherwise>
+ </c:choose>
<s:select label="%{getText('add.project.buildDefinitionTemplate')}" name="buildDefinitionTemplateId"
list="buildDefinitionTemplates" listKey="id" listValue="name" headerKey="-1"
headerValue="%{getText('add.project.defaultBuildDefinition')}"/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp
index 827e2f9..50a44f4 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp
@@ -24,7 +24,6 @@
<s:i18n name="localization.Continuum">
<head>
<title><s:text name="appearance.page.title"/></title>
- <s:head/>
</head>
<body>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
index b43f9ea..a956465 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
@@ -30,216 +30,202 @@
<meta http-equiv="refresh" content="60"/>
</head>
<body>
- <s:form id="removeForm" action="none" method="post">
+ <s:form id="buildQueueForm" action="none" method="post">
<div id="h3">
<h3>
<s:text name="buildQueue.currentTask.section.title"/>
- </h3>
- <table width="100%">
- <s:if test="%{currentBuildProjectTasks != null}">
- <tbody>
- <tr>
- <th><s:text name="buildQueue.currentTask.buildQueue"/></th>
- <th><s:text name="buildQueue.currentTask.projectName"/></th>
- <th><s:text name="buildQueue.currentTask.buildDefinition"/></th>
- <th> </th>
- </tr>
- <c:forEach var="element" items="${currentBuildProjectTasks}">
- <tr>
- <td width="20%">${element.key}</td>
- <td width="20%">
- <s:url id="viewUrl" action="buildResults">
- <s:param name="projectId">${element.value.projectId}</s:param>
+ </h3>
+ <c:if test="${not empty currentBuildProjectTasks}">
+ <s:set name="currentBuildProjectTasks" value="currentBuildProjectTasks" scope="request"/>
+ <ec:table items="currentBuildProjectTasks"
+ var="queue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <ec:column property="name" title="buildQueue.currentTask.buildQueue" width="29%"/>
+ <ec:column property="projectUrl" title="buildQueue.currentTask.projectName" width="50%">
+ <s:url id="viewUrl" action="buildResults">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${queue.task.projectName}</s:a>
+ </ec:column>
+ <ec:column property="task.buildDefinitionLabel" title="buildQueue.currentTask.buildDefinition" width="19%"/>
+ <ec:column property="cancelAction" title=" " width="1%">
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:url id="cancelUrl" action="cancelCurrentBuildTask" method="cancelCurrent" namespace="/">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
</s:url>
- <s:a href="%{viewUrl}">${element.value.projectName}</s:a>
- </td>
- <td width="29%">${element.value.buildDefinitionLabel}</td>
- <td width="1%">
- <redback:ifAuthorized permission="continuum-manage-queues">
- <s:url id="cancelUrl" action="cancelCurrentBuildTask" method="cancelCurrent" namespace="/">
- <s:param name="projectId">${element.value.projectId}</s:param>
- </s:url>
- <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
- </redback:ifAuthorized>
- <redback:elseAuthorized>
- <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </redback:elseAuthorized>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </s:if>
- <s:else>
- <s:text name="buildQueue.no.currentTaks" />
- </s:else>
- </table>
- </div>
-
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty currentBuildProjectTasks}">
+ <s:text name="buildQueue.no.currentTaks" />
+ </c:if>
+ </div>
+ </s:form>
+
+ <s:form id="removeBuildForm" action="removeBuildQueueEntries!removeBuildEntries.action" method="post">
<div id="h3">
<h3>
<s:text name="buildQueue.section.title"/>
- </h3>
- <table width="100%">
- <s:if test="%{buildsInQueue != null}">
- <tbody>
- <tr>
+ </h3>
+ <c:if test="${not empty buildsInQueue}">
+ <s:set name="buildsInQueue" value="buildsInQueue" scope="request"/>
+ <ec:table items="buildsInQueue"
+ var="queue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
<redback:ifAuthorized permission="continuum-manage-queues">
- <th> </th>
+ <ec:column alias="selectedBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" headerCell="selectAll">
+ <input type="checkbox" name="selectedBuildTaskHashCodes" value="${queue.task.hashCode}" />
+ </ec:column>
</redback:ifAuthorized>
- <th><s:text name="buildQueue.currentTask.buildQueue"/></th>
- <th><s:text name="buildQueue.currentTask.projectName"/></th>
- <th><s:text name="buildQueue.currentTask.buildDefinition"/></th>
- <th> </th>
- </tr>
- <c:forEach var="element" items="${buildsInQueue}">
- <c:forEach var="buildTask" items="${element.value}">
- <tr>
- <td width="1%">
- <redback:ifAuthorized permission="continuum-manage-queues">
- <input type="checkbox" name="selectedBuildTaskHashCodes" value="${buildTask.hashCode}" />
- </redback:ifAuthorized>
- </td>
- <td width="29%">${element.key}</td>
- <td width="50%">
- <s:url id="viewUrl" action="buildResults">
- <s:param name="projectId">${buildTask.projectId}</s:param>
- </s:url>
- <s:a href="%{viewUrl}">${buildTask.projectName}</s:a>
- </td>
- <td width="19%">${buildTask.buildDefinitionLabel}</td>
- <td width="1%">
- <redback:ifAuthorized permission="continuum-manage-queues">
- <s:url id="cancelUrl" action="removeBuildQueueEntry" method="remove" namespace="/">
- <s:param name="projectId">${pageScope.buildTask.projectId}</s:param>
- <s:param name="buildDefinitionId">${pageScope.buildTask.buildDefinitionId}</s:param>
- <s:param name="trigger">${pageScope.buildTask.trigger}</s:param>
- <s:param name="projectName">${pageScope.buildTask.projectName}</s:param>
- </s:url>
- <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
- </redback:ifAuthorized>
- <redback:elseAuthorized>
- <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </redback:elseAuthorized>
- </td>
- </tr>
- </c:forEach>
- </c:forEach>
- </tbody>
- </s:if>
- <s:else>
- <s:text name="buildQueue.empty"/>
- </s:else>
- </table>
- </div>
+ <ec:column property="name" title="buildQueue.currentTask.buildQueue" width="29%"/>
+ <ec:column property="projectUrl" title="buildQueue.currentTask.projectName" width="50%">
+ <s:url id="viewUrl" action="buildResults">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${queue.task.projectName}</s:a>
+ </ec:column>
+ <ec:column property="task.buildDefinitionLabel" title="buildQueue.currentTask.buildDefinition" width="19%"/>
+ <ec:column property="cancelAction" title=" " width="1%">
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:url id="cancelUrl" action="removeBuildQueueEntry" method="remove" namespace="/">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ <s:param name="buildDefinitionId">${queue.task.buildDefinitionId}</s:param>
+ <s:param name="trigger">${queue.task.buildTrigger.trigger}</s:param>
+ <s:param name="projectName">${queue.task.projectName}</s:param>
+ <s:param name="projectGroupId">${queue.task.projectGroupId}</s:param>
+ </s:url>
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty buildsInQueue}">
+ <s:text name="buildQueue.empty"/>
+ </c:if>
+ </div>
<c:if test="${not empty buildsInQueue}">
<div class="functnbar3">
<table>
<tbody>
<tr>
<td>
- <input type="submit" value="<s:text name="buildQueue.removeEntries"/>"
- onclick="$('removeForm').action='removeBuildQueueEntries!removeBuildEntries.action';$('removeForm').submit();" />
+ <input type="button" value="<s:text name="buildQueue.removeEntries"/>" onclick="document.forms.removeBuildForm.submit();" />
</td>
</tr>
</tbody>
</table>
</div>
- </c:if>
-
- <!-- checkout queue -->
+ </c:if>
+ </s:form>
+
+ <s:form id="checkoutForm" action="none" method="post">
+ <%-- checkout queue --%>
<div id="h3">
<h3>
<s:text name="checkoutQueue.currentTask.section.title"/>
- </h3>
- <table width="100%">
- <s:if test="%{currentCheckoutTasks != null}">
- <tbody>
- <tr>
- <th><s:text name="checkoutQueue.currentTask.buildQueue"/></th>
- <th><s:text name="checkoutQueue.currentTask.projectName"/></th>
- <th> </th>
- </tr>
- <c:forEach var="element" items="${currentCheckoutTasks}">
- <tr>
- <td width="30%">${element.key}</td>
- <td width="69%">
- <s:url id="viewUrl" action="projectView">
- <s:param name="projectId">${element.value.projectId}</s:param>
- </s:url>
- <s:a href="%{viewUrl}">${element.value.projectName}</s:a>
- </td>
- <td width="1%">
+ </h3>
+ <c:if test="${not empty currentCheckoutTasks}">
+ <s:set name="currentCheckoutTasks" value="currentCheckoutTasks" scope="request"/>
+ <ec:table items="currentCheckoutTasks"
+ var="queue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <ec:column property="name" title="checkoutQueue.currentTask.buildQueue" width="29%"/>
+ <ec:column property="projectUrl" title="checkoutQueue.currentTask.projectName" width="69%">
+ <s:url id="viewUrl" action="projectView">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${queue.task.projectName}</s:a>
+ </ec:column>
+ <ec:column property="cancelAction" title=" " width="1%">
<redback:ifAuthorized permission="continuum-manage-queues">
<s:url id="cancelUrl" action="cancelCurrentQueueTask" method="cancelCurrentCheckout" namespace="/">
- <s:param name="projectId">${element.value.projectId}</s:param>
+ <s:param name="projectId">${queue.task.projectId}</s:param>
</s:url>
<s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
</redback:ifAuthorized>
<redback:elseAuthorized>
<img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </redback:elseAuthorized>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </s:if>
- <s:else>
- <s:text name="checkoutQueue.no.currentTaks" />
- </s:else>
- </table>
- </div>
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty currentCheckoutTasks}">
+ <s:text name="checkoutQueue.no.currentTaks" />
+ </c:if>
+ </div>
+ </s:form>
+ <s:form id="removeCheckoutForm" action="removeCheckoutQueueEntries!removeCheckoutEntries.action" method="post">
<div id="h3">
<h3>
<s:text name="checkoutQueue.section.title"/>
- </h3>
- <table width="100%">
- <s:if test="%{checkoutsInQueue != null}">
- <tbody>
- <tr>
+ </h3>
+ <c:if test="${not empty checkoutsInQueue}">
+ <s:set name="checkoutsInQueue" value="checkoutsInQueue" scope="request"/>
+ <ec:table items="checkoutsInQueue"
+ var="queue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
<redback:ifAuthorized permission="continuum-manage-queues">
- <th> </th>
+ <ec:column alias="selectedCheckOutTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" headerCell="selectAll">
+ <input type="checkbox" name="selectedCheckOutTaskHashCodes" value="${queue.task.hashCode}" />
+ </ec:column>
</redback:ifAuthorized>
- <th><s:text name="checkoutQueue.currentTask.buildQueue"/></th>
- <th><s:text name="checkoutQueue.currentTask.projectName"/></th>
- <th> </th>
- </tr>
- <c:forEach var="element" items="${checkoutsInQueue}">
- <c:forEach var="checkoutTask" items="${element.value}">
- <tr>
- <td width="1%">
- <redback:ifAuthorized permission="continuum-manage-queues">
- <input type="checkbox" name="selectedCheckOutTaskHashCodes" value="${checkoutTask.hashCode}" />
- </redback:ifAuthorized>
- </td>
- <td width="29%">${element.key}</td>
- <td width="69%">
- <s:url id="viewUrl" action="projectView">
- <s:param name="projectId">${checkoutTask.projectId}</s:param>
- </s:url>
- <s:a href="%{viewUrl}">${checkoutTask.projectName}</s:a>
- </td>
- <td width="1%">
- <redback:ifAuthorized permission="continuum-manage-queues">
- <s:url id="cancelUrl" action="removeCheckoutQueueEntry" method="removeCheckout">
- <s:param name="projectId">${checkoutTask.projectId}</s:param>
- </s:url>
- <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
- </redback:ifAuthorized>
- <redback:elseAuthorized>
- <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </redback:elseAuthorized>
- </td>
- </tr>
- </c:forEach>
- </c:forEach>
- </tbody>
- </s:if>
- <s:else>
- <s:text name="checkoutQueue.no.currentTaks" />
- </s:else>
- </table>
- </div>
+ <ec:column property="name" title="checkoutQueue.currentTask.buildQueue" width="29%"/>
+ <ec:column property="projectUrl" title="checkoutQueue.currentTask.projectName" width="69%">
+ <s:url id="viewUrl" action="projectView">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${queue.task.projectName}</s:a>
+ </ec:column>
+ <ec:column property="cancelAction" title=" " width="1%">
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:url id="cancelUrl" action="removeCheckoutQueueEntry" method="removeCheckout" namespace="/">
+ <s:param name="projectId">${queue.task.projectId}</s:param>
+ </s:url>
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty checkoutsInQueue}">
+ <s:text name="checkoutQueue.empty" />
+ </c:if>
+ </div>
<c:if test="${not empty checkoutsInQueue}">
<div class="functnbar3">
<table>
@@ -247,17 +233,105 @@
<tr>
<td>
<redback:ifAuthorized permission="continuum-manage-queues">
- <input type="submit" value="<s:text name="checkoutQueue.removeEntries"/>"
- onclick="$('removeForm').action='removeCheckoutQueueEntries!removeCheckoutEntries.action';$('removeForm').submit();" />
+ <input type="submit" value="<s:text name="checkoutQueue.removeEntries"/>" onclick="document.forms.removeCheckoutForm.submit();" />
</redback:ifAuthorized>
</td>
</tr>
</tbody>
</table>
</div>
+ </c:if>
+ </s:form>
+
+ <s:form id="prepareBuildForm" action="none" method="post">
+ <div id="h3">
+ <h3><s:text name="prepareBuildQueue.currentTask.section.title"/></h3>
+ <c:if test="${not empty currentPrepareBuilds}">
+ <s:set name="currentPrepareBuilds" value="currentPrepareBuilds" scope="request"/>
+ <ec:table items="currentPrepareBuilds"
+ var="currentPrepareBuild"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <ec:column property="projectGroupUrl" title="prepareBuildQueue.table.projectGroupName">
+ <s:url id="viewUrl" action="projectGroupSummary">
+ <s:param name="projectGroupId">${pageScope.currentPrepareBuild.projectGroupId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.currentPrepareBuild.projectGroupName}</s:a>
+ </ec:column>
+ <ec:column property="scmRootAddress" title="prepareBuildQueue.table.scmRootAddress"/>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty currentPrepareBuilds}">
+ <s:text name="prepareBuildQueue.no.currentTasks"/>
+ </c:if>
+ </div>
+ </s:form>
+
+ <s:form id="removePrepareBuildForm" action="removePrepareBuildEntries.action" method="post">
+ <div id="h3">
+ <h3>
+ <s:text name="prepareBuildQueue.section.title"/>
+ </h3>
+ <c:if test="${not empty prepareBuildQueues}">
+ <s:set name="prepareBuildQueues" value="prepareBuildQueues" scope="request"/>
+ <ec:table items="prepareBuildQueues"
+ var="prepareBuildQueue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <ec:column alias="selectedPrepareBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
+ <input type="checkbox" name="selectedPrepareBuildTaskHashCodes" value="${pageScope.prepareBuildQueue.hashCode}" />
+ </ec:column>
+ </redback:ifAuthorized>
+ <ec:column property="projectGroupUrl" title="prepareBuildQueue.table.projectGroupName">
+ <s:url id="viewUrl" action="projectGroupSummary">
+ <s:param name="projectGroupId">${pageScope.prepareBuildQueue.projectGroupId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.prepareBuildQueue.projectGroupName}</s:a>
+ </ec:column>
+ <ec:column property="scmRootAddress" title="prepareBuildQueue.table.scmRootAddress"/>
+ <ec:column property="cancelEntry" title=" " width="1%">
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:url id="cancelUrl" action="removePrepareBuildEntry" method="removePrepareBuildEntry" namespace="/">
+ <s:param name="projectGroupId">${pageScope.prepareBuildQueue.projectGroupId}</s:param>
+ <s:param name="scmRootId">${pageScope.prepareBuildQueue.scmRootId}</s:param>
+ </s:url>
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ </div>
+ <c:if test="${not empty prepareBuildQueues}">
+ <div class="functnbar3">
+ <table>
+ <tbody>
+ <tr>
+ <td>
+ <input type="button" name="remove-prepare-build-queues" value="<s:text name="prepareBuildQueue.removeEntries"/>" onclick="document.forms.removePrepareBuildForm.submit();" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</c:if>
-
+ <c:if test="${empty prepareBuildQueues}">
+ <s:text name="prepareBuildQueue.empty"/>
+ </c:if>
</s:form>
</body>
</s:i18n>
-</html>
\ No newline at end of file
+</html>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp
index 62ae81e..8e3a725 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp
@@ -22,7 +22,6 @@
<s:i18n name="localization.Continuum">
<head>
<title><s:text name="appearance.page.title"/></title>
- <s:head/>
</head>
<body>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
index 7dc417c..7e20c75 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionAsTemplate.jsp
@@ -79,6 +79,9 @@
listKey="id" headerKey="-1" headerValue=""/>
</s:else>
<s:select label="%{getText('buildDefinition.type.label')}" name="buildDefinition.type" list="buildDefinitionTypes"/>
+ <s:if test="buildDefinition.type != 'ant' || buildDefinition.type != 'shell'">
+ <s:select label="%{getText('buildDefinition.updatePolicy.label')}" name="buildDefinition.updatePolicy" list="buildDefinitionUpdatePolicies"/>
+ </s:if>
<s:textfield label="%{getText('buildDefinition.description.label')}" name="buildDefinition.description" required="true"/>
</tbody>
</table>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp
index e85bc21..30062dc 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp
@@ -22,7 +22,6 @@
<s:i18n name="localization.Continuum">
<head>
<title><s:text name="companyPom.page.title"/></title>
- <s:head/>
</head>
<body>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPurgeConfiguration.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPurgeConfiguration.jsp
index 8a185dd..40257a2 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPurgeConfiguration.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editPurgeConfiguration.jsp
@@ -68,6 +68,7 @@
<s:select label="%{getText('purgeConfig.schedule.label')}" name="scheduleId" list="schedules"
headerKey="-1" headerValue=""/>
<s:textfield label="%{getText('purgeConfig.description.label')}" name="description"/>
+ <s:checkbox label="%{getText('purgeConfig.enabled.label')}" name="enabled"/>
</table>
<s:hidden name="purgeConfigId"/>
<s:hidden name="purgeType"/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
index d991519..5295f63 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
@@ -26,65 +26,67 @@
<s:i18n name="localization.Continuum">
<head>
<title><s:text name="distributedBuilds.page.title"/></title>
+ <meta http-equiv="refresh" content="60"/>
</head>
<body>
- <s:form id="removeForm" action="none" method="post">
+ <c:if test="${!empty actionErrors}">
+ <div class="errormessage">
+ <s:iterator value="actionErrors">
+ <p><s:text name="<s:property/>" /></p>
+ </s:iterator>
+ </div>
+ </c:if>
+
+ <s:form id="buildForm" action="none" method="post">
<div id="h3">
- <h3><s:text name="distributedBuilds.section.title"/></h3>
- <c:if test="${!empty actionErrors}">
- <div class="errormessage">
- <s:iterator value="actionErrors">
- <p><s:text name="<s:property/>" /></p>
- </s:iterator>
- </div>
- </c:if>
- <c:if test="${not empty distributedBuildSummary}">
- <s:set name="distributedBuildSummary" value="distributedBuildSummary" scope="request"/>
- <ec:table items="distributedBuildSummary"
- var="distributedBuild"
+ <h3><s:text name="distributedBuilds.currentBuild.section.title"/></h3>
+ <c:if test="${not empty currentDistributedBuilds}">
+ <s:set name="currentDistributedBuilds" value="currentDistributedBuilds" scope="request"/>
+ <ec:table items="currentDistributedBuilds"
+ var="currentBuild"
showExports="false"
showPagination="false"
showStatusBar="false"
sortable="false"
filterable="false">
<ec:row>
+ <ec:column property="projectUrl" title="distributedBuild.table.projectName">
+ <s:url id="viewUrl" action="buildResults">
+ <s:param name="projectId">${pageScope.currentBuild.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.currentBuild.projectName}</s:a>
+ </ec:column>
+ <ec:column property="buildDefinitionLabel" title="distributedBuild.table.buildDefinitionLabel"/>
<ec:column property="projectGroupName" title="distributedBuild.table.projectGroupName"/>
- <ec:column property="scmRootAddress" title="distributedBuild.table.scmRootAddress"/>
- <ec:column property="url" title="distributedBuild.table.agentUrl"/>
+ <ec:column property="buildAgentUrl" title="distributedBuild.table.buildAgentUrl"/>
<ec:column property="cancelEntry" title=" " width="1%">
- <c:choose>
- <c:when test="${pageScope.distributedBuild.cancelEnabled}">
- <s:url id="cancelUrl" action="cancelDistributedBuild" method="cancelDistributedBuild" namespace="/">
- <s:param name="projectGroupId">${pageScope.distributedBuild.projectGroupId}</s:param>
- <s:param name="scmRootAddress">${pageScope.distributedBuild.scmRootAddress}</s:param>
- <s:param name="buildAgentUrl">${pageScope.distributedBuild.url}</s:param>
- </s:url>
- <redback:ifAuthorized permission="continuum-manage-queues">
- <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
- </redback:ifAuthorized>
- <redback:elseAuthorized>
- <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </redback:elseAuthorized>
- </c:when>
- <c:otherwise>
- <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
- </c:otherwise>
- </c:choose>
+ <s:url id="cancelUrl" action="cancelDistributedBuild" method="cancelDistributedBuild" namespace="/">
+ <s:param name="buildAgentUrl">${pageScope.currentBuild.buildAgentUrl}</s:param>
+ </s:url>
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
</ec:column>
</ec:row>
</ec:table>
</c:if>
- <c:if test="${empty distributedBuildSummary}">
- <s:text name="distributedBuilds.empty"/>
+ <c:if test="${empty currentDistributedBuilds}">
+ <s:text name="distributedBuilds.no.currentTasks"/>
</c:if>
</div>
+ </s:form>
+ <s:form id="removeBuildForm" action="removeDistributedBuildEntries.action" method="post">
<div id="h3">
<h3>
<s:text name="distributedBuilds.buildQueue.section.title"/>
</h3>
<c:if test="${not empty distributedBuildQueues}">
+ <s:set name="distributedBuildQueues" value="distributedBuildQueues" scope="request"/>
<ec:table items="distributedBuildQueues"
- var="distributedBuildQueue"
+ var="buildQueue"
showExports="false"
showPagination="false"
showStatusBar="false"
@@ -92,17 +94,25 @@
filterable="false">
<ec:row>
<redback:ifAuthorized permission="continuum-manage-queues">
- <ec:column alias="selectedDistributedBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
- <input type="checkbox" name="selectedDistributedBuildTaskHashCodes" value="${pageScope.distributedBuildQueue.hashCode}" />
+ <ec:column alias="selectedBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" headerCell="selectAll">
+ <input type="checkbox" name="selectedBuildTaskHashCodes" value="${pageScope.buildQueue.hashCode}" />
</ec:column>
</redback:ifAuthorized>
+ <ec:column property="projectUrl" title="distributedBuild.table.projectName">
+ <s:url id="viewUrl" action="buildResults">
+ <s:param name="projectId">${pageScope.buildQueue.projectId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.buildQueue.projectName}</s:a>
+ </ec:column>
+ <ec:column property="buildDefinitionLabel" title="distributedBuild.table.buildDefinitionLabel"/>
<ec:column property="projectGroupName" title="distributedBuild.table.projectGroupName"/>
- <ec:column property="scmRootAddress" title="distributedBuild.table.scmRootAddress"/>
+ <ec:column property="buildAgentUrl" title="distributedBuild.table.buildAgentUrl"/>
<ec:column property="cancelEntry" title=" " width="1%">
<redback:ifAuthorized permission="continuum-manage-queues">
<s:url id="cancelUrl" action="removeDistributedBuildEntry" method="removeDistributedBuildEntry" namespace="/">
- <s:param name="projectGroupId">${pageScope.distributedBuildQueue.projectGroupId}</s:param>
- <s:param name="scmRootAddress">${pageScope.distributedBuildQueue.scmRootAddress}</s:param>
+ <s:param name="projectId">${pageScope.buildQueue.projectId}</s:param>
+ <s:param name="buildDefinitionId">${pageScope.buildQueue.buildDefinitionId}</s:param>
+ <s:param name="buildAgentUrl">${pageScope.buildQueue.buildAgentUrl}</s:param>
</s:url>
<s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
</redback:ifAuthorized>
@@ -120,15 +130,110 @@
<tbody>
<tr>
<td>
- <input type="submit" value="<s:text name="distributedBuilds.removeEntries"/>"
- onclick="$('removeForm').action='removeDistributedBuildEntries!removeDistributedBuildEntries.action';$('removeForm').submit();" />
+ <input type="button" name="remove-build-queues" value="<s:text name="distributedBuilds.removeEntries"/>" onclick="document.forms.removeBuildForm.submit();" />
</td>
</tr>
</tbody>
</table>
</div>
</c:if>
+ <c:if test="${empty distributedBuildQueues}">
+ <s:text name="distributedBuilds.empty"/>
+ </c:if>
</s:form>
+ <s:form id="prepareForm" action="none" method="post">
+ <div id="h3">
+ <h3><s:text name="distributedBuilds.currentPrepareBuild.section.title"/></h3>
+ <c:if test="${not empty currentDistributedPrepareBuilds}">
+ <s:set name="currentDistributedPrepareBuilds" value="currentDistributedPrepareBuilds" scope="request"/>
+ <ec:table items="currentDistributedPrepareBuilds"
+ var="currentPrepareBuild"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <ec:column property="projectGroupUrl" title="distributedPrepareBuild.table.projectGroupName">
+ <s:url id="viewUrl" action="projectGroupSummary">
+ <s:param name="projectGroupId">${pageScope.currentPrepareBuild.projectGroupId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.currentPrepareBuild.projectGroupName}</s:a>
+ </ec:column>
+ <ec:column property="scmRootAddress" title="distributedPrepareBuild.table.scmRootAddress"/>
+ <ec:column property="buildAgentUrl" title="distributedPrepareBuild.table.buildAgentUrl"/>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ <c:if test="${empty currentDistributedPrepareBuilds}">
+ <s:text name="distributedPrepareBuilds.no.currentTasks"/>
+ </c:if>
+ </div>
+ </s:form>
+
+ <s:form id="removePrepareBuildForm" action="removeDistributedPrepareBuildEntries.action" method="post">
+ <div id="h3">
+ <h3>
+ <s:text name="distributedBuilds.prepareBuildQueue.section.title"/>
+ </h3>
+ <c:if test="${not empty distributedPrepareBuildQueues}">
+ <s:set name="distributedPrepareBuildQueues" value="distributedPrepareBuildQueues" scope="request"/>
+ <ec:table items="distributedPrepareBuildQueues"
+ var="prepareBuildQueue"
+ showExports="false"
+ showPagination="false"
+ showStatusBar="false"
+ sortable="false"
+ filterable="false">
+ <ec:row>
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <ec:column alias="selectedPrepareBuildTaskHashCodes" title=" " style="width:5px" filterable="false" sortable="false" width="1%" headerCell="selectAll">
+ <input type="checkbox" name="selectedPrepareBuildTaskHashCodes" value="${pageScope.prepareBuildQueue.hashCode}" />
+ </ec:column>
+ </redback:ifAuthorized>
+ <ec:column property="projectGroupUrl" title="distributedPrepareBuild.table.projectGroupName">
+ <s:url id="viewUrl" action="projectGroupSummary">
+ <s:param name="projectGroupId">${pageScope.prepareBuildQueue.projectGroupId}</s:param>
+ </s:url>
+ <s:a href="%{viewUrl}">${pageScope.prepareBuildQueue.projectGroupName}</s:a>
+ </ec:column>
+ <ec:column property="scmRootAddress" title="distributedPrepareBuild.table.scmRootAddress"/>
+ <ec:column property="buildAgentUrl" title="distributedPrepareBuild.table.buildAgentUrl"/>
+ <ec:column property="cancelEntry" title=" " width="1%">
+ <redback:ifAuthorized permission="continuum-manage-queues">
+ <s:url id="cancelUrl" action="removeDistributedPrepareBuildEntry" method="removeDistributedPrepareBuildEntry" namespace="/">
+ <s:param name="projectGroupId">${pageScope.prepareBuildQueue.projectGroupId}</s:param>
+ <s:param name="scmRootId">${pageScope.prepareBuildQueue.scmRootId}</s:param>
+ <s:param name="buildAgentUrl">${pageScope.prepareBuildQueue.buildAgentUrl}</s:param>
+ </s:url>
+ <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0"></s:a>
+ </redback:ifAuthorized>
+ <redback:elseAuthorized>
+ <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
+ </redback:elseAuthorized>
+ </ec:column>
+ </ec:row>
+ </ec:table>
+ </c:if>
+ </div>
+ <c:if test="${not empty distributedPrepareBuildQueues}">
+ <div class="functnbar3">
+ <table>
+ <tbody>
+ <tr>
+ <td>
+ <input type="button" name="remove-prepare-build-queues" value="<s:text name="distributedPrepareBuilds.removeEntries"/>" onclick="document.forms.removePrepareBuildForm.submit();" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </c:if>
+ <c:if test="${empty distributedPrepareBuildQueues}">
+ <s:text name="distributedPrepareBuilds.empty"/>
+ </c:if>
+ </s:form>
+
</body>
</s:i18n>
-</html>
\ No newline at end of file
+</html>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
index f63d7fe..9240f9e 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
@@ -30,7 +30,7 @@
<h3><s:text name="buildDefinition.section.title"/></h3>
<div class="axial">
- <s:form action="saveBuildDefinition" method="get">
+ <s:form action="saveBuildDefinition" method="post">
<c:choose>
<c:when test="${!empty actionErrors}">
@@ -79,6 +79,9 @@
<s:select label="%{getText('buildDefinition.profile.label')}" name="profileId" list="profiles" listValue="name"
listKey="id" headerKey="-1" headerValue=""/>
<s:select label="%{getText('buildDefinition.type.label')}" name="buildDefinitionType" list="buildDefinitionTypes"/>
+ <s:if test="executor != 'ant' || executor != 'shell'">
+ <s:select label="%{getText('buildDefinition.updatePolicy.label')}" name="updatePolicy" list="buildDefinitionUpdatePolicies"/>
+ </s:if>
<s:textfield label="%{getText('buildDefinition.description.label')}" name="description" />
</tbody>
</table>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
index abdd5f7..c7896a0 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
@@ -66,6 +66,9 @@
</s:else>
</s:param>
</c1:data>
+ <c1:data label="%{getText('buildResult.username')}">
+ <s:param name="after"><s:property value="buildResult.username"/></s:param>
+ </c1:data>
</table>
</div>
<div class="functnbar3">
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp
index 4f5927f..87afa1f 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp
@@ -39,6 +39,15 @@
<s:param><s:property value="project.name"/></s:param>
</s:text>
</h3>
+
+ <c:if test="${!empty actionErrors}">
+ <div class="errormessage">
+ <s:iterator value="actionErrors">
+ <p><s:property/></p>
+ </s:iterator>
+ </div>
+ </c:if>
+
<form id="buildResultsForm" action="removeBuildResults.action" method="post">
<s:hidden name="projectGroupId"/>
<s:hidden name="projectId"/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
index c9dea1b..025bd77 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
@@ -66,6 +66,7 @@
<s:url id="buildUrl" action="buildProject" namespace="/">
<s:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</s:param>
<s:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</s:param>
+ <s:param name="fromGroupPage" value="true"/>
</s:url>
<s:a href="%{buildUrl}"><img src="<s:url value='/images/buildnow.gif' includeParams="none"/>" alt="<s:text name='build'/>" title="<s:text name='build'/>" border="0"></s:a>
</redback:ifAuthorized>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp
index 983595b..fa86289 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp
@@ -21,15 +21,16 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<s:set name="companyLogo" value="companyLogo"/>
<c:if test="${!empty (companyLogo)}">
+ <s:set name="companyName" value="companyName"/>
<s:set name="companyUrl" value="companyUrl"/>
<c:choose>
<c:when test="${!empty (companyUrl)}">
<a href="${companyUrl}">
- <img src="${companyLogo}" title="${companyName}" border="0" alt=""/>
+ <img src="${companyLogo}" title="${companyName}" border="0" alt="${companyName}"/>
</a>
</c:when>
<c:otherwise>
- <img src="${companyLogo}" title="${companyName}" border="0" alt=""/>
+ <img src="${companyLogo}" title="${companyName}" border="0" alt="${companyName}"/>
</c:otherwise>
</c:choose>
</c:if>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
index 902ed31..f2b43cf 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/editSchedule.jsp
@@ -32,7 +32,7 @@
<h3><s:text name="editSchedule.section.title"/></h3>
<div class="axial">
- <s:form action="saveSchedule" method="post" validate="true">
+ <s:form action="saveSchedule" method="post" validate="false" name="scheduleForm">
<c:if test="${!empty actionErrors}">
<div class="errormessage">
<s:iterator value="actionErrors">
@@ -74,14 +74,27 @@
</s:textfield>
<c1:ifBuildTypeEnabled buildType="parallel">
- <s:optiontransferselect label="%{getText('schedule.buildqueues.label')}" name="availableBuildQueues"
- list="availableBuildQueues" size="8" multiple="true" emptyOption="false"
- doubleName="selectedBuildQueues" doubleList="selectedBuildQueues" doubleSize="8"
- doubleMultiple="true" doubleEmptyOption="false"
- addAllToRightOnclick="selectAllOptions(document.getElementById('saveSchedule_availableBuildQueues'));selectAllOptions(document.getElementById('saveSchedule_selectedBuildQueues'));"
- addToRightOnclick="selectAllOptions(document.getElementById('saveSchedule_availableBuildQueues'));selectAllOptions(document.getElementById('saveSchedule_selectedBuildQueues'));"
- addAllToLeftOnclick="selectAllOptions(document.getElementById('saveSchedule_availableBuildQueues'));selectAllOptions(document.getElementById('saveSchedule_selectedBuildQueues'));"
- addToLeftOnclick="selectAllOptions(document.getElementById('saveSchedule_availableBuildQueues'));selectAllOptions(document.getElementById('saveSchedule_selectedBuildQueues'));"
+ <s:optiontransferselect
+ label="%{getText('schedule.buildqueues.label')}"
+ name="availableBuildQueuesIds"
+ list="availableBuildQueues"
+ listKey="id"
+ listValue="name"
+ headerKey="-1"
+ headerValue="%{getText('schedule.available.buildqueues')}"
+ multiple="true"
+ size="8"
+ emptyOption="false"
+ doubleName="selectedBuildQueuesIds"
+ doubleList="selectedBuildQueues"
+ doubleListKey="id"
+ doubleListValue="name"
+ doubleHeaderKey="-1"
+ doubleSize="8"
+ doubleMultiple="true"
+ doubleEmptyOption="false"
+ doubleHeaderValue="%{getText('schedule.available.buildqueues.used')}"
+ formName="scheduleForm"
/>
</c1:ifBuildTypeEnabled>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/error.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/error.jsp
index fccb61c..d7eadba 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/error.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/error.jsp
@@ -24,7 +24,6 @@
<s:i18n name="localization.Continuum">
<head>
<title><s:text name="errorOccured.page.title"/></title>
- <s:head />
<script language=javascript type='text/javascript'>
<!--
var state = 'none';
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp
index bdb022b..9845b57 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/error/httpError.jsp
@@ -33,79 +33,52 @@
<c:when test="${param.errorCode == 404}">
<s:text name="error.404.title"/>
</c:when>
- <c:when test="${param.errorCode == 405}">
- <s:text name="error.405.title"/>
+ <c:when test="${param.errorCode == 500}">
+ <s:text name="error.500.title"/>
</c:when>
<c:otherwise>
<s:text name="error.page.title"/>
</c:otherwise>
</c:choose>
</title>
- <link rel="stylesheet" type="text/css" href="<s:url value="/css/tigris.css" includeParams="none"/>" media="screen"/>
- <link rel="stylesheet" type="text/css" href="<s:url value="/css/print.css" includeParams="none"/>" media="print"/>
- <link rel="stylesheet" type="text/css" href="<s:url value="/css/extremecomponents.css" includeParams="none"/>" media="screen"/>
- <link rel="shortcut icon" href="<s:url value="/favicon.ico" includeParams="none"/>" type="image/x-icon"/>
-
- <script src="<s:url value="/scripts/tigris.js" includeParams="none"/>" type="text/javascript"></script>
</head>
-<body onload="focus()" marginwidth="0" marginheight="0" class="composite">
-<s:include value="/WEB-INF/jsp/navigations/DefaultTop.jsp"/>
+<body>
+ <div id="h3">
+ <h3>
+ <c:choose>
+ <c:when test="${param.errorCode == 403}">
+ <s:text name="error.403.section.title"/>
+ </c:when>
+ <c:when test="${param.errorCode == 404}">
+ <s:text name="error.404.section.title"/>
+ </c:when>
+ <c:when test="${param.errorCode == 500}">
+ <s:text name="error.500.section.title"/>
+ </c:when>
+ <c:otherwise>
+ The URL requested results to an unknown error (Error <s:property value="errorCode"/>).
+ </c:otherwise>
+ </c:choose>
+ </h3>
-<table id="main" border="0" cellpadding="4" cellspacing="0" width="100%">
- <tbody>
- <tr valign="top">
- <td id="leftcol" width="180">
- <br/> <br/>
- <s:include value="/WEB-INF/jsp/navigations/Menu.jsp"/>
- </td>
- <td width="86%">
- <br/>
-
- <div id="bodycol">
- <div class="app">
- <div id="axial" class="h3">
- <h3>
- <c:choose>
- <c:when test="${param.errorCode == 403}">
- <s:text name="error.403.section.title"/>
- </c:when>
- <c:when test="${param.errorCode == 404}">
- <s:text name="error.404.section.title"/>
- </c:when>
- <c:when test="${param.errorCode == 405}">
- <s:text name="error.405.section.title"/>
- </c:when>
- <c:otherwise>
- The URL requested results to an unknown error.
- </c:otherwise>
- </c:choose>
- </h3>
-
- <div class="errormessage">
- <c:choose>
- <c:when test="${param.errorCode == 403}">
- <s:text name="error.403.message"/>
- </c:when>
- <c:when test="${param.errorCode == 404}">
- <s:text name="error.404.message"/>
- </c:when>
- <c:when test="${param.errorCode == 405}">
- <s:text name="error.405.message"/>
- </c:when>
- <c:otherwise>
- The URL requested results to an unknown error.
- </c:otherwise>
- </c:choose>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
-</table>
-<s:include value="/WEB-INF/jsp/navigations/DefaultBottom.jsp"/>
+ <div class="errormessage">
+ <c:choose>
+ <c:when test="${param.errorCode == 403}">
+ <s:text name="error.403.message"/>
+ </c:when>
+ <c:when test="${param.errorCode == 404}">
+ <s:text name="error.404.message"/>
+ </c:when>
+ <c:when test="${param.errorCode == 500}">
+ <s:text name="error.500.message"/>
+ </c:when>
+ <c:otherwise>
+ The URL requested results to an unknown error (Error <s:property value="errorCode"/>).
+ </c:otherwise>
+ </c:choose>
+ </div>
+ </div>
</body>
</html>
</s:i18n>
\ No newline at end of file
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
index 30b540b..e285e4c 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/groupSummary.jsp
@@ -39,6 +39,14 @@
<h3><s:text name="groups.page.section.title"/></h3>
</s:else>
+ <c:if test="${!empty actionErrors}">
+ <div class="errormessage">
+ <s:iterator value="actionErrors">
+ <p><s:property/></p>
+ </s:iterator>
+ </div>
+ </c:if>
+
<c:if test="${empty groups}">
<s:text name="groups.page.list.empty"/>
</c:if>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/wait.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/wait.jsp
index 9427702..f7ee150 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/wait.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/wait.jsp
@@ -22,11 +22,11 @@
<html>
<s:i18n name="localization.Continuum">
<head>
- <META HTTP-EQUIV="refresh" CONTENT="2;url=<s:url includeParams="all"/>"/>
+ <META HTTP-EQUIV="refresh" CONTENT="2;url=<s:url includeParams="NONE"/>"/>
</head>
<body>
<img src="images/wait.gif">
<b><s:text name="wait.addprocessing.processing"/></b>
</body>
</s:i18n>
-</html>
\ No newline at end of file
+</html>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
index 69bf438..7a517d3 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
@@ -57,6 +57,7 @@
<tbody>
<s:textfield label="%{getText('notifier.mail.recipient.address.label')}" name="address" />
<s:checkbox label="%{getText('notifier.mail.recipient.committers.label')}" name="committers" value="committers" fieldValue="true"/>
+ <s:checkbox label="%{getText('notifier.mail.recipient.developers.label')}" name="developers" value="developers" fieldValue="true"/>
<s:checkbox label="%{getText('notifier.event.sendOnSuccess')}" name="sendOnSuccess" value="sendOnSuccess" fieldValue="true"/>
<s:checkbox label="%{getText('notifier.event.sendOnFailure')}" name="sendOnFailure" value="sendOnFailure" fieldValue="true"/>
<s:checkbox label="%{getText('notifier.event.sendOnError')}" name="sendOnError" value="sendOnError" fieldValue="true"/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp
index c1d64cb..9ddf335 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp
@@ -33,7 +33,7 @@
<table border="1" cellspacing="2" cellpadding="3" width="100%">
<s:textfield label="%{getText('releasePerformFromScm.goals.label')}" name="goals"/>
<s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"/>
- <s:checkbox label="%{getText('releasePerformFromScm.useReleaseProfile.label')}" name="useReleaseProfile" fieldValue="false"/>
+ <s:checkbox label="%{getText('releasePerformFromScm.useReleaseProfile.label')}" name="useReleaseProfile"/>
</table>
</div>
<s:submit/>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp b/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
index 5b3f627..dc8d3b5 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
+++ b/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
@@ -52,6 +52,9 @@
</s:else>
</s:param>
</c1:data>
+ <c1:data label="%{getText('releaseViewResult.username')}">
+ <s:param name="after"><s:property value="username"/></s:param>
+ </c1:data>
</table>
</div>
diff --git a/continuum-webapp/src/main/webapp/WEB-INF/web.xml b/continuum-webapp/src/main/webapp/WEB-INF/web.xml
index 39b018e..0d7e364 100644
--- a/continuum-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/continuum-webapp/src/main/webapp/WEB-INF/web.xml
@@ -138,15 +138,15 @@
<error-page>
<error-code>403</error-code>
- <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=403</location>
+ <location>/httpError.jsp?errorCode=403</location>
</error-page>
<error-page>
<error-code>404</error-code>
- <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=404</location>
+ <location>/httpError.jsp?errorCode=404</location>
</error-page>
<error-page>
<error-code>500</error-code>
- <location>/WEB-INF/jsp/error/httpError.jsp?errorCode=500</location>
+ <location>/httpError.jsp?errorCode=500</location>
</error-page>
<!-- [jspc-maven-plugin:post-compiled-jsps-as-servlets] -->
diff --git a/continuum-webapp/src/main/webapp/httpError.jsp b/continuum-webapp/src/main/webapp/httpError.jsp
new file mode 100644
index 0000000..26bd9c5
--- /dev/null
+++ b/continuum-webapp/src/main/webapp/httpError.jsp
@@ -0,0 +1,20 @@
+<%--
+ ~ 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.
+ --%>
+
+<% response.sendRedirect( request.getContextPath() + "/httpError.action?errorCode="+ request.getParameter( "errorCode" ) ); %>
diff --git a/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java b/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
new file mode 100644
index 0000000..7798eae
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
@@ -0,0 +1,145 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
+import org.apache.continuum.release.distributed.DistributedReleaseUtil;
+import org.apache.continuum.web.action.stub.ReleaseActionStub;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.model.system.Profile;
+import org.jmock.Mock;
+import org.jmock.MockObjectTestCase;
+
+public class AbstractReleaseActionTest
+ extends MockObjectTestCase
+{
+ private ReleaseActionStub action;
+
+ private Mock continuumMock;
+
+ private Mock configurationServiceMock;
+
+ private String defaultBuildagentUrl = "http://localhost:8181/continuum-buildagent/xmlrpc";
+
+ protected void setUp()
+ throws Exception
+ {
+ continuumMock = mock( Continuum.class );
+ configurationServiceMock = mock( ConfigurationService.class );
+
+ Profile profile = new Profile();
+ profile.setBuildAgentGroup( "BUILDAGENT_GROUP" );
+
+ action = new ReleaseActionStub();
+ action.setProfile( profile );
+ action.setDefaultBuildagent( defaultBuildagentUrl );
+ action.setContinuum( (Continuum) continuumMock.proxy() );
+ }
+
+ public void testGetEnvironmentsDefaultAgentInGroup()
+ throws Exception
+ {
+ BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration( true );
+ buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl, "Default Build Agent", true ) );
+
+ continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
+
+ action.getEnvironments();
+ Map<String, String> envVars = action.getEnvironmentVariables();
+ String buildagent = envVars.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
+
+ assertNotNull( envVars );
+ assertTrue( "Default build agent is expected to be used.", defaultBuildagentUrl.equals( buildagent ) );
+ }
+
+ public void testGetEnvironmentsDefaultAgentNotInGroup()
+ throws Exception
+ {
+ BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration( true );
+
+ continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
+
+ action.getEnvironments();
+ Map<String, String> envVars = action.getEnvironmentVariables();
+ String buildagent = envVars.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
+
+ assertNotNull( envVars );
+ assertFalse( "Default build agent is not expected to be used.", defaultBuildagentUrl.equals( buildagent ) );
+ }
+
+ public void testGetEnvironmentsNoEnabledAgentInGroup()
+ throws Exception
+ {
+ BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration( false );
+ buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl, "Default Build Agent", false ) );
+
+ continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
+
+ action.getEnvironments();
+ Map<String, String> envVars = action.getEnvironmentVariables();
+ String buildagent = envVars.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
+
+ assertNotNull( envVars );
+ assertFalse( "Default build agent is not expected to be used.", defaultBuildagentUrl.equals( buildagent ) );
+ assertNull( "Build agent should be empty.", buildagent );
+ }
+
+ public void testGetEnvironmentsNoAgentInGroup()
+ throws Exception
+ {
+ BuildAgentGroupConfiguration buildAgentGroup = new BuildAgentGroupConfiguration();
+
+ continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will( returnValue( buildAgentGroup ) );
+
+ action.getEnvironments();
+ Map<String, String> envVars = action.getEnvironmentVariables();
+ String buildagent = envVars.get( DistributedReleaseUtil.KEY_BUILD_AGENT_URL );
+
+ assertNotNull( envVars );
+ assertFalse( "Default build agent is not expected to be used.", defaultBuildagentUrl.equals( buildagent ) );
+ assertNull( "Build agent should be empty.", buildagent );
+ }
+
+ private BuildAgentGroupConfiguration createBuildAgentGroupConfiguration( boolean isAgentEnabled )
+ {
+ BuildAgentConfiguration buildagent1 = new BuildAgentConfiguration( "http://localhost:9191/continuum-buildagent/xmlrpc",
+ "Other Build Agent", isAgentEnabled );
+ BuildAgentConfiguration buildagent2 = new BuildAgentConfiguration( "http://localhost:9292/continuum-buildagent/xmlrpc",
+ "Other Build Agent", isAgentEnabled );
+
+ List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>();
+ buildAgents.add( buildagent1 );
+ buildAgents.add( buildagent2 );
+
+ BuildAgentGroupConfiguration buildAgentGroup = new BuildAgentGroupConfiguration( "BUILDAGENT_GROUP", buildAgents );
+
+ return buildAgentGroup;
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/continuum/web/action/stub/ReleaseActionStub.java b/continuum-webapp/src/test/java/org/apache/continuum/web/action/stub/ReleaseActionStub.java
new file mode 100644
index 0000000..ca844bd
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/continuum/web/action/stub/ReleaseActionStub.java
@@ -0,0 +1,61 @@
+package org.apache.continuum.web.action.stub;
+
+/*
+ * 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.
+ */
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.continuum.web.action.AbstractReleaseAction;
+import org.apache.maven.continuum.model.system.Profile;
+
+public class ReleaseActionStub
+ extends AbstractReleaseAction
+{
+ private Map<String, String> environmentVariables;
+
+ private Profile profile;
+
+ private String defaultBuildagent;
+
+ public ReleaseActionStub()
+ {
+ this.environmentVariables = new HashMap<String, String>();
+ }
+
+ public void getEnvironments()
+ {
+ this.environmentVariables = getEnvironments( profile, defaultBuildagent );
+ }
+
+ public Map<String, String> getEnvironmentVariables()
+ {
+ return this.environmentVariables;
+ }
+
+ public void setProfile( Profile profile )
+ {
+ this.profile = profile;
+ }
+
+ public void setDefaultBuildagent( String defaultBuildagent )
+ {
+ this.defaultBuildagent = defaultBuildagent;
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
new file mode 100644
index 0000000..d2f0bb8
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
@@ -0,0 +1,144 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.maven.continuum.web.action.stub.AddProjectActionStub;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.jmock.Mock;
+import org.jmock.MockObjectTestCase;
+
+/**
+ * Test for {@link AddProjectAction}
+ *
+ * @author <a href="mailto:jzurbano@apache.org">jzurbano</a>
+ */
+public class AddProjectActionTest
+ extends MockObjectTestCase
+{
+ private final AddProjectActionStub action;
+
+ private final Mock continuumMock;
+
+ public AddProjectActionTest()
+ {
+ action = new AddProjectActionStub();
+ continuumMock = new Mock( Continuum.class );
+ action.setContinuum( (Continuum) continuumMock.proxy() );
+
+ Collection<ProjectGroup> projectGroups = new ArrayList<ProjectGroup>();
+ ProjectGroup projectGroup = new ProjectGroup();
+ projectGroups.add( projectGroup );
+
+ action.setProjectGroups( projectGroups );
+ }
+
+ public void testAddProjectNullValues()
+ throws Exception
+ {
+ action.setProjectName( null );
+ action.setProjectVersion( null );
+ action.setProjectScmUrl( null );
+
+ action.validate();
+ }
+
+ /**
+ * Test add of Ant project
+ *
+ * @throws Exception
+ */
+ public void testAddAntProject()
+ throws Exception
+ {
+ String scmUrl = "scm:svn:http://project/scm/url/test/build.xml";
+
+ List<Project> projects = createProjectList();
+ continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects ) );
+ continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
+
+ action.setProjectName( "Ant Test Project" );
+ action.setProjectVersion( "1.0-SNAPSHOT" );
+ action.setProjectScmUrl( scmUrl );
+ action.setProjectType( "ant" );
+ action.setSelectedProjectGroup( 1 );
+ action.setBuildDefintionTemplateId( 1 );
+
+ action.validate();
+ action.add();
+ continuumMock.verify();
+
+ }
+
+ /**
+ * Test add of Shell project
+ *
+ * @throws Exception
+ */
+ public void testAddShellProject()
+ throws Exception
+ {
+ String scmUrl = "scm:svn:http://project/scm/url/test/run.sh";
+
+ List<Project> projects = createProjectList();
+ continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects ) );
+ continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
+
+ action.setProjectName( "Shell Test Project" );
+ action.setProjectVersion( "1.0-SNAPSHOT" );
+ action.setProjectScmUrl( scmUrl );
+ action.setProjectType( "shell" );
+ action.setSelectedProjectGroup( 1 );
+ action.setBuildDefintionTemplateId( 1 );
+
+ action.validate();
+ action.add();
+ continuumMock.verify();
+ }
+
+ private List<Project> createProjectList()
+ {
+ List<Project> projects = new ArrayList<Project>();
+
+ Project project1 = createProject( "scm:svn:http://project/scm/url/test-1/run.sh", "Shell Test Project 1", "1.0-SNAPSHOT", 1 );
+ Project project2 = createProject( "scm:svn:http://project/scm/url/test-2/build.xml", "Ant Test Project 1", "1.0-SNAPSHOT", 2 );
+
+ projects.add( project1 );
+ projects.add( project2 );
+
+ return projects;
+ }
+
+ private Project createProject( String scmUrl, String name, String version, int id )
+ {
+ Project project = new Project();
+ project.setId( id );
+ project.setName( name );
+ project.setVersion( version );
+ project.setScmUrl( scmUrl );
+
+ return project;
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
new file mode 100644
index 0000000..c7d3bdd
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
@@ -0,0 +1,81 @@
+package org.apache.maven.continuum.web.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
+import org.apache.continuum.web.action.admin.BuildAgentAction;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.jmock.Mock;
+import org.jmock.MockObjectTestCase;
+
+public class BuildAgentActionTest
+ extends MockObjectTestCase
+{
+ private BuildAgentAction action;
+
+ private Mock continuumMock;
+
+ private Mock configurationServiceMock;
+
+ private Mock distributedBuildManagerMock;
+
+ private List<BuildAgentConfiguration> buildAgents;
+
+ protected void setUp()
+ throws Exception
+ {
+ action = new BuildAgentAction();
+ continuumMock = mock( Continuum.class );
+ configurationServiceMock = mock( ConfigurationService.class );
+ distributedBuildManagerMock = mock( DistributedBuildManager.class );
+
+ action.setContinuum( (Continuum) continuumMock.proxy() );
+
+ buildAgents = new ArrayList<BuildAgentConfiguration>();
+ }
+
+ public void testAddBuildAgent()
+ throws Exception
+ {
+ continuumMock.expects( once() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgents" ).will( returnValue( buildAgents ) );
+ configurationServiceMock.expects( once() ).method( "addBuildAgent" ).isVoid();
+ configurationServiceMock.expects( once() ).method( "store" ).isVoid();
+ continuumMock.expects( once() ).method( "getDistributedBuildManager" ).will( returnValue( distributedBuildManagerMock.proxy() ) );
+ distributedBuildManagerMock.expects( once() ).method( "reload" ).isVoid();
+
+ BuildAgentConfiguration buildAgent = new BuildAgentConfiguration();
+ buildAgent.setUrl( "http://sample/agent" );
+
+ action.setBuildAgent( buildAgent );
+ action.save();
+ }
+
+ public void testDeleteBuildAgent()
+ throws Exception
+ {
+ List<BuildAgentGroupConfiguration> buildAgentGroups = new ArrayList<BuildAgentGroupConfiguration>();
+
+ continuumMock.expects( atLeastOnce() ).method( "getDistributedBuildManager" ).will( returnValue( distributedBuildManagerMock.proxy() ) );
+ distributedBuildManagerMock.expects( once() ).method( "isBuildAgentBusy" ).will( returnValue( false ) );
+ continuumMock.expects( once() ).method( "getConfiguration" ).will( returnValue( configurationServiceMock.proxy() ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroups" ).will( returnValue( buildAgentGroups ) );
+ configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgents" ).will( returnValue( buildAgents ) );
+
+ distributedBuildManagerMock.expects( never() ).method( "removeDistributedBuildQueueOfAgent" ).isVoid();
+ distributedBuildManagerMock.expects( never() ).method( "reload" ).isVoid();
+ configurationServiceMock.expects( never() ).method( "removeBuildAgent" ).isVoid();
+ configurationServiceMock.expects( never() ).method( "store" ).isVoid();
+
+ BuildAgentConfiguration buildAgent = new BuildAgentConfiguration();
+ buildAgent.setUrl( "http://sample/agent" );
+
+ action.setConfirmed( true );
+ action.setBuildAgent( buildAgent );
+ action.delete();
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
new file mode 100644
index 0000000..b5472f4
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
@@ -0,0 +1,97 @@
+package org.apache.maven.continuum.web.action;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
+import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.web.action.stub.BuildResultActionStub;
+import org.apache.maven.continuum.xmlrpc.project.ContinuumProjectState;
+import org.jmock.Mock;
+import org.jmock.MockObjectTestCase;
+
+public class BuildResultActionTest
+ extends MockObjectTestCase
+{
+ private BuildResultActionStub action;
+
+ private Mock continuum;
+
+ private Mock configurationService;
+
+ private Mock distributedBuildManager;
+
+ private Mock buildsManager;
+
+ protected void setUp()
+ {
+ action = new BuildResultActionStub();
+ continuum = mock( Continuum.class );
+ configurationService = mock( ConfigurationService.class );
+ distributedBuildManager = mock( DistributedBuildManager.class );
+ buildsManager = mock( BuildsManager.class );
+
+ action.setContinuum( (Continuum) continuum.proxy() );
+ action.setDistributedBuildManager( (DistributedBuildManager) distributedBuildManager.proxy() );
+ }
+
+ public void testViewPreviousBuild()
+ throws Exception
+ {
+ Project project = createProject( "stub-project" );
+ BuildResult buildResult = createBuildResult( project );
+
+ continuum.expects( once() ).method( "getProject" ).will( returnValue( project ) );
+ continuum.expects( once() ).method( "getBuildResult" ).will( returnValue( buildResult ) );
+ continuum.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService) configurationService.proxy() ) );
+ configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will( returnValue( false ) );
+ configurationService.expects( once() ).method( "getTestReportsDirectory" ).will( returnValue( new File( "testReportsDir" ) ) );
+ continuum.expects( once() ).method( "getChangesSinceLastSuccess" ).will( returnValue( null ) );
+ configurationService.expects( once() ).method( "getBuildOutputFile" ).will( returnValue( new File( "buildOutputFile" ) ) );
+ continuum.expects( once() ).method( "getBuildsManager" ).will( returnValue( buildsManager.proxy() ) );
+ buildsManager.expects( once() ).method( "getCurrentBuilds" ).will( returnValue( new HashMap<String, BuildProjectTask>() ) );
+
+ action.execute();
+ continuum.verify();
+ }
+
+ public void testViewCurrentBuildInDistributedBuildAgent()
+ throws Exception
+ {
+ Project project = createProject( "stub-project" );
+
+ continuum.expects( once() ).method( "getProject" ).will( returnValue( project ) );
+ continuum.expects( once() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService) configurationService.proxy() ) );
+ configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will( returnValue( true ) );
+ distributedBuildManager.expects( once() ).method( "getBuildResult" ).will( returnValue( new HashMap<String, Object>() ) );
+
+ action.execute();
+ continuum.verify();
+ }
+
+ private Project createProject( String name )
+ {
+ Project project = new Project();
+ project.setId( 1 );
+ project.setName( name );
+ project.setArtifactId( "foo:bar" );
+ project.setVersion( "1.0" );
+ project.setState( ContinuumProjectState.BUILDING );
+
+ return project;
+ }
+
+ private BuildResult createBuildResult( Project project )
+ {
+ BuildResult buildResult = new BuildResult();
+ buildResult.setId( 1 );
+ buildResult.setProject( project );
+
+ return buildResult;
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java
new file mode 100644
index 0000000..6ba0be7
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java
@@ -0,0 +1,191 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.web.action.stub.SummaryActionStub;
+import org.apache.maven.continuum.web.model.ProjectSummary;
+import org.apache.maven.continuum.xmlrpc.project.ContinuumProjectState;
+import org.jmock.Mock;
+import org.jmock.MockObjectTestCase;
+
+public class SummaryActionTest
+ extends MockObjectTestCase
+{
+ private SummaryActionStub action;
+
+ private Mock continuum;
+
+ private Mock configurationService;
+
+ private Mock buildsManager;
+
+ protected void setUp()
+ {
+ action = new SummaryActionStub();
+
+ continuum = mock( Continuum.class );
+
+ configurationService = mock( ConfigurationService.class );
+
+ buildsManager = mock( BuildsManager.class );
+
+ action.setContinuum( (Continuum) continuum.proxy() );
+ action.setParallelBuildsManager( (BuildsManager ) buildsManager.proxy() );
+ }
+
+ public void testLatestBuildIdWhenCurrentlyBuildingInDistributedBuild()
+ throws Exception
+ {
+ Collection<Project> projectsInGroup = createProjectsInGroup( 1, ContinuumProjectState.BUILDING );
+ Map<Integer, BuildResult> buildResults = createBuildResults( 0, ContinuumProjectState.OK );
+ Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
+
+ continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup ) );
+ continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue( buildResults ) );
+ continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue( buildResultsInSuccess ) );
+
+ buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInPrepareBuildQueue").will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue( false ) );
+
+ continuum.expects( once() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService) configurationService.proxy() ) );
+ configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will( returnValue( true ) );
+
+ action.execute();
+ continuum.verify();
+
+ List<ProjectSummary> projects = action.getProjects();
+
+ assertNotNull( projects );
+ assertEquals( 1, projects.size() );
+
+ ProjectSummary summary = projects.get( 0 );
+ assertEquals( 0, summary.getLatestBuildId() );
+ }
+
+ public void testLatestBuildIdInDistributedBuild()
+ throws Exception
+ {
+ Collection<Project> projectsInGroup = createProjectsInGroup( 1, ContinuumProjectState.OK );
+ Map<Integer, BuildResult> buildResults = createBuildResults( 1, ContinuumProjectState.OK );
+ Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
+
+ continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup ) );
+ continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue( buildResults ) );
+ continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue( buildResultsInSuccess ) );
+
+ buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInPrepareBuildQueue").will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue( false ) );
+
+ continuum.expects( once() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService) configurationService.proxy() ) );
+ configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will( returnValue( true ) );
+
+ action.execute();
+ continuum.verify();
+
+ List<ProjectSummary> projects = action.getProjects();
+
+ assertNotNull( projects );
+ assertEquals( 1, projects.size() );
+
+ ProjectSummary summary = projects.get( 0 );
+ assertEquals( 1, summary.getLatestBuildId() );
+ }
+
+ public void testLatestBuildIdWhenCurrentlyBuilding()
+ throws Exception
+ {
+ Collection<Project> projectsInGroup = createProjectsInGroup( 1, ContinuumProjectState.BUILDING );
+ Map<Integer, BuildResult> buildResults = createBuildResults( 1, ContinuumProjectState.BUILDING );
+ Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
+
+ continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup ) );
+ continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue( buildResults ) );
+ continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue( buildResultsInSuccess ) );
+
+ buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInPrepareBuildQueue").will( returnValue( false ) );
+ buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue( false ) );
+
+ continuum.expects( once() ).method( "getConfiguration" ).will( returnValue( (ConfigurationService) configurationService.proxy() ) );
+ configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will( returnValue( false ) );
+
+ action.execute();
+ continuum.verify();
+
+ List<ProjectSummary> projects = action.getProjects();
+
+ assertNotNull( projects );
+ assertEquals( 1, projects.size() );
+
+ ProjectSummary summary = projects.get( 0 );
+ assertEquals( 1, summary.getLatestBuildId() );
+ }
+
+ private Collection<Project> createProjectsInGroup( int projectId, int state )
+ {
+ Collection<Project> projectsInGroup = new ArrayList<Project>();
+
+ ProjectGroup group = new ProjectGroup();
+ group.setId( 1 );
+ group.setName( "test-group" );
+
+ Project project = new Project();
+ project.setId( projectId );
+ project.setName( "test-project" );
+ project.setVersion( "1.0" );
+ project.setBuildNumber( 1 );
+ project.setState( state );
+ project.setExecutorId( "maven2" );
+ project.setProjectGroup( group );
+
+ projectsInGroup.add( project );
+
+ return projectsInGroup;
+ }
+
+ private Map<Integer, BuildResult> createBuildResults( int projectId, int state )
+ {
+ Map<Integer, BuildResult> buildResults = new HashMap<Integer, BuildResult>();
+
+ BuildResult br = new BuildResult();
+ br.setId( 1 );
+ br.setStartTime( System.currentTimeMillis() );
+ br.setEndTime( System.currentTimeMillis() );
+ br.setState( state );
+
+ buildResults.put( projectId, br );
+
+ return buildResults;
+ }
+}
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/AddProjectActionStub.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/AddProjectActionStub.java
new file mode 100644
index 0000000..e42f891
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/AddProjectActionStub.java
@@ -0,0 +1,57 @@
+package org.apache.maven.continuum.web.action.stub;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.continuum.web.action.AddProjectAction;
+
+/**
+ * Stub for {@link AddProjectAction}
+ *
+ * @author <a href="mailto:jzurbano@apache.org">jzurbano</a>
+ */
+public class AddProjectActionStub
+ extends AddProjectAction
+{
+ public String input()
+ {
+ return INPUT;
+ }
+
+ private void initializeProjectGroupName()
+ {
+ setProjectGroupName( "Test Project Group" );
+ }
+
+ private boolean isAuthorizedToAddProjectToGroup( String projectGroupName )
+ {
+ return true;
+ }
+
+ protected void checkAddProjectGroupAuthorization()
+ {
+ // skip authorization check
+ }
+
+ protected void checkAddProjectToGroupAuthorization( String projectGroupName )
+ {
+ // skip authorization check
+ }
+}
+
diff --git a/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/BuildResultActionStub.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/BuildResultActionStub.java
new file mode 100644
index 0000000..71582ca
--- /dev/null
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/BuildResultActionStub.java
@@ -0,0 +1,17 @@
+package org.apache.maven.continuum.web.action.stub;
+
+import org.apache.maven.continuum.web.action.BuildResultAction;
+
+public class BuildResultActionStub
+ extends BuildResultAction
+{
+ public String getProjectGroupName()
+ {
+ return "test-group";
+ }
+
+ protected void checkViewProjectGroupAuthorization( String resource )
+ {
+ // skip authorization check
+ }
+}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/SummaryActionStub.java
similarity index 64%
copy from maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
copy to continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/SummaryActionStub.java
index c829c6d..f395101 100644
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddShellProject.java
+++ b/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/stub/SummaryActionStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.plugin;
+package org.apache.maven.continuum.web.action.stub;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,20 +19,18 @@
* under the License.
*/
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.maven.continuum.web.action.SummaryAction;
-/**
- * Goal which add a Shell Project.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-shell-project
- */
-public class AddShellProject
- extends AbstractAddProject
+public class SummaryActionStub
+ extends SummaryAction
{
- protected String getProjectType()
+ public String getProjectGroupName()
{
- return ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
+ return "test-group";
+ }
+
+ protected void checkViewProjectGroupAuthorization( String resource )
+ {
+ // skip authorization check
}
}
diff --git a/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml b/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
index 586cdb7..790dd67 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
+++ b/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
@@ -21,20 +21,12 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-xmlrpc</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-xmlrpc-api</artifactId>
<name>Continuum :: XMLRPC :: API</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.xmlrpc</groupId>
- <artifactId>xmlrpc-common</artifactId>
- <version>3.1</version>
- </dependency>
- </dependencies>
-
<build>
<plugins>
<plugin>
@@ -47,13 +39,16 @@
<goal>java</goal>
</goals>
<configuration>
- <model>src/main/mdo/continuum-service.xml</model>
+ <models>
+ <model>src/main/mdo/continuum-service.xml</model>
+ </models>
</configuration>
</execution>
</executions>
<configuration>
<version>1.1.1</version>
<packageWithVersion>false</packageWithVersion>
+ <useJava5>true</useJava5>
</configuration>
</plugin>
</plugins>
diff --git a/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java b/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
index e3a70be..5455825 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
+++ b/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
@@ -41,7 +41,6 @@
import org.apache.maven.continuum.xmlrpc.system.Installation;
import org.apache.maven.continuum.xmlrpc.system.Profile;
import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration;
-import org.apache.xmlrpc.XmlRpcException;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -59,7 +58,6 @@
* @param projectGroupId The project group Id
* @return List of {@link ProjectSummary}
* @throws Exception
- * @throws XmlRpcException
*/
List<ProjectSummary> getProjects( int projectGroupId )
throws Exception;
diff --git a/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml b/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml
index 6d7825a..71c530b 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml
+++ b/continuum-xmlrpc/continuum-xmlrpc-backup/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-xmlrpc</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-xmlrpc-backup</artifactId>
diff --git a/continuum-xmlrpc/continuum-xmlrpc-client/README.txt b/continuum-xmlrpc/continuum-xmlrpc-client/README.txt
index feaf4f8..85c66d8 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-client/README.txt
+++ b/continuum-xmlrpc/continuum-xmlrpc-client/README.txt
@@ -6,3 +6,8 @@
This assumes Continuum is running on port 8080. If not, you will need to edit
the url in the exec plugin's configuration.
+
+-----------------
+
+To purge old build results, change the exec plugin configuration to run BuildResultsPurge instead of SampleClient
+and run 'mvn exec:exec'.
\ No newline at end of file
diff --git a/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml b/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
index 86d44c1..6cba580 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
+++ b/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-xmlrpc</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-xmlrpc-client</artifactId>
diff --git a/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/BuildResultsPurge.java b/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/BuildResultsPurge.java
new file mode 100644
index 0000000..5bbefc7
--- /dev/null
+++ b/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/BuildResultsPurge.java
@@ -0,0 +1,89 @@
+package org.apache.maven.continuum.xmlrpc.client;
+
+/*
+ * 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.
+ */
+
+import java.net.URL;
+import java.util.List;
+import java.util.Date;
+
+import org.apache.maven.continuum.xmlrpc.project.*;
+
+/**
+ * Utility class to purge old build results.
+ * <p/>
+ * The easiest way to use it is to change the exec plugin config in the pom to execute this class instead of
+ * SampleClient, change RETENTION_DAYS if desired, and type 'mvn clean install exec:exec'
+ */
+public class BuildResultsPurge {
+
+ private static ContinuumXmlRpcClient client;
+
+ private static long RETENTION_DAYS = 60;
+
+ private static long DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000;
+
+ public static void main(String[] args)
+ throws Exception {
+
+ client = new ContinuumXmlRpcClient(new URL(args[0]), args[1], args[2]);
+
+ long today = new Date().getTime();
+
+ System.out.println("Today is " + new Date(today));
+
+ long purgeDate = today - (RETENTION_DAYS * DAY_IN_MILLISECONDS);
+ //long purgeDate = today - 1000; // 1 second ago (for testing)
+
+ System.out.println("Purging build results older than " + new Date(purgeDate));
+
+ List<ProjectGroupSummary> groups = client.getAllProjectGroups();
+
+ for (ProjectGroupSummary group : groups) {
+
+ System.out.println("Project Group [" + group.getId() + "] " + group.getName());
+
+ List<ProjectSummary> projects = client.getProjects(group.getId());
+
+ for (ProjectSummary project : projects) {
+
+
+ System.out.println(" Project [" + project.getId() + "] " + project.getName());
+
+ List<BuildResultSummary> results = client.getBuildResultsForProject(project.getId());
+
+ for (BuildResultSummary brs : results) {
+
+ BuildResult br = client.getBuildResult(project.getId(), brs.getId());
+
+ System.out.print(" Build Result [" + br.getId() + "] ended " + new Date(br.getEndTime()));
+
+ if (br.getEndTime() > 0 && br.getEndTime() < purgeDate) {
+
+ client.removeBuildResult(br);
+ System.out.println(" ...removed.");
+ } else {
+ System.out.println(" ...retained.");
+ }
+ }
+ }
+
+ }
+ }
+}
diff --git a/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml b/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml
index 506207c..8e8b4f0 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml
+++ b/continuum-xmlrpc/continuum-xmlrpc-server/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-xmlrpc</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-xmlrpc-server</artifactId>
@@ -49,6 +49,10 @@
<artifactId>continuum-model</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-buildagent-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.redback</groupId>
<artifactId>redback-rbac-role-manager</artifactId>
</dependency>
diff --git a/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java b/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
index 44a07f3..e88aeda 100644
--- a/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
+++ b/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
@@ -29,12 +29,15 @@
import java.util.Map;
import java.util.Set;
+import org.apache.continuum.buildagent.NoBuildAgentException;
+import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
import org.apache.continuum.buildmanager.BuildManagerException;
import org.apache.continuum.buildmanager.BuildsManager;
import org.apache.continuum.dao.SystemConfigurationDao;
import org.apache.continuum.purge.ContinuumPurgeManagerException;
import org.apache.continuum.purge.PurgeConfigurationServiceException;
import org.apache.continuum.repository.RepositoryServiceException;
+import org.apache.continuum.utils.build.BuildTrigger;
import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
import org.apache.continuum.xmlrpc.repository.LocalRepository;
@@ -589,63 +592,63 @@
// ----------------------------------------------------------------------
public int addProjectToBuildQueue( int projectId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectSummary ps = getProjectSummary( projectId );
checkBuildProjectInGroupAuthorization( ps.getProjectGroup().getName() );
- continuum.buildProject( projectId, ContinuumProjectState.TRIGGER_SCHEDULED );
+ continuum.buildProject( projectId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
public int addProjectToBuildQueue( int projectId, int buildDefinitionId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectSummary ps = getProjectSummary( projectId );
checkBuildProjectInGroupAuthorization( ps.getProjectGroup().getName() );
- continuum.buildProject( projectId, buildDefinitionId, ContinuumProjectState.TRIGGER_SCHEDULED );
+ continuum.buildProject( projectId, buildDefinitionId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
public int buildProject( int projectId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectSummary ps = getProjectSummary( projectId );
checkBuildProjectInGroupAuthorization( ps.getProjectGroup().getName() );
- continuum.buildProject( projectId );
+ continuum.buildProject( projectId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
public int buildProject( int projectId, int buildDefintionId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectSummary ps = getProjectSummary( projectId );
checkBuildProjectInGroupAuthorization( ps.getProjectGroup().getName() );
- continuum.buildProjectWithBuildDefinition( projectId, buildDefintionId );
+ continuum.buildProjectWithBuildDefinition( projectId, buildDefintionId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
public int buildGroup( int projectGroupId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectGroupSummary pg = getProjectGroupSummary( projectGroupId );
checkBuildProjectInGroupAuthorization( pg.getName() );
- continuum.buildProjectGroup( projectGroupId );
+ continuum.buildProjectGroup( projectGroupId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
public int buildGroup( int projectGroupId, int buildDefintionId )
- throws ContinuumException
+ throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException
{
ProjectGroupSummary pg = getProjectGroupSummary( projectGroupId );
checkBuildProjectInGroupAuthorization( pg.getName() );
- continuum.buildProjectGroupWithBuildDefinition( projectGroupId, buildDefintionId );
+ continuum.buildProjectGroupWithBuildDefinition( projectGroupId, buildDefintionId, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ) );
return 0;
}
diff --git a/continuum-xmlrpc/pom.xml b/continuum-xmlrpc/pom.xml
index 0297f07..d9f6465 100644
--- a/continuum-xmlrpc/pom.xml
+++ b/continuum-xmlrpc/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>continuum</artifactId>
<groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>continuum-xmlrpc</artifactId>
diff --git a/maven-continuum-plugin/pom.xml b/maven-continuum-plugin/pom.xml
deleted file mode 100644
index 0f2ec1a..0000000
--- a/maven-continuum-plugin/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>continuum</artifactId>
- <groupId>org.apache.continuum</groupId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>continuum-maven-plugin</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Continuum :: Maven Plugin</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum-xmlrpc-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.continuum</groupId>
- <artifactId>continuum-xmlrpc-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java b/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java
deleted file mode 100644
index 7fb69b9..0000000
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package org.apache.maven.continuum.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
-import org.apache.maven.continuum.xmlrpc.project.ProjectSummary;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Base class to add ANT/Shell projects.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractAddProject
- extends AbstractContinuumMojo
-{
- /**
- * The project name.
- *
- * @parameter expression="${projectName}"
- * @required
- */
- private String projectName;
-
- /**
- * The project verion.
- *
- * @parameter expression="${projectVersion}"
- * @required
- */
- private String projectVersion;
-
- /**
- * The SCM Url. Must be a Maven-SCM url.
- *
- * @parameter expression="${scmUrl}"
- * @required
- */
- private String scmUrl;
-
- /**
- * The SCM username.
- *
- * @parameter expression="${scm.username}"
- */
- private String scmUsernme;
-
- /**
- * The SCM password.
- *
- * @parameter expression="${scm.password}"
- */
- private String scmPassword;
-
- /**
- * The SCM branch/tag name.
- *
- * @parameter expression="${scm.tag}"
- */
- private String scmTag;
-
- /**
- * Use SCM credentials Cache, if available.
- *
- * @parameter expression="${scm.useCredentialsCache}" default-value="false"
- */
- private boolean scmUseCredentialsCache;
-
- /**
- * The project Group Id.
- *
- * @parameter expression="${projectGroupId}"
- */
- private String projectGroupId;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- ProjectSummary project = new ProjectSummary();
- project.setName( projectName );
- project.setVersion( projectVersion );
- project.setScmUrl( scmUrl );
- project.setScmUsername( scmUsernme );
- project.setScmPassword( scmPassword );
- project.setScmTag( scmTag );
- project.setScmUseCache( scmUseCredentialsCache );
-
- try
- {
- if ( projectGroupId != null && projectGroupId.length() > 0 )
- {
- if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals( getProjectType() ) )
- {
- getClient().addAntProject( project, Integer.parseInt( projectGroupId ) );
- }
- else
- {
- getClient().addShellProject( project, Integer.parseInt( projectGroupId ) );
- }
- }
- else
- {
- throw new Exception( "Can't add a project with an empty project group." );
- }
- }
- catch ( Exception e )
- {
- throw new MojoExecutionException( "Can't add the " + getProjectType() + " project.", e );
- }
- }
-
- protected abstract String getProjectType();
-}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractContinuumMojo.java b/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractContinuumMojo.java
deleted file mode 100644
index 7a1a3f0..0000000
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractContinuumMojo.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.maven.continuum.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.continuum.xmlrpc.client.ContinuumXmlRpcClient;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- */
-public abstract class AbstractContinuumMojo
- extends AbstractMojo
-{
- /**
- * The Continuum XML-RPC server URL.
- *
- * @parameter expression="${url}"
- * @required
- */
- private String url;
-
- /**
- * The Continuum username.
- *
- * @parameter expression="${username}"
- */
- private String username;
-
- /**
- * The Continuum password.
- *
- * @parameter expression="${password}"
- */
- private String password;
-
- private ContinuumXmlRpcClient client;
-
- protected void createClient()
- throws MojoExecutionException
- {
- URL continuumUrl;
-
- try
- {
- continuumUrl = new URL( url );
- }
- catch ( MalformedURLException e )
- {
- throw new MojoExecutionException( "The URL '" + url + "' isn't valid." );
- }
-
- client = new ContinuumXmlRpcClient( continuumUrl, username, password );
- }
-
- protected ContinuumXmlRpcClient getClient()
- throws MojoExecutionException
- {
- if ( client == null )
- {
- createClient();
- }
- return client;
- }
-}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java b/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java
deleted file mode 100644
index ccb137b..0000000
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.apache.maven.continuum.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Goal which add a Maven1 project.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-maven-one-project
- */
-public class AddMavenOneProject
- extends AbstractContinuumMojo
-{
- /**
- * POM Url.
- *
- * @parameter expression="${projectUrl}" default-value="${project.scm.url}"
- * @required
- */
- private String projectUrl;
-
- /**
- * Project Group Id.
- *
- * @parameter expression="${projectGroupId}"
- */
- private String projectGroupId;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- try
- {
- if ( projectGroupId != null && projectGroupId.length() > 0 )
- {
- getClient().addMavenOneProject( projectUrl, Integer.parseInt( projectGroupId ) );
- }
- else
- {
- throw new Exception( "Can't add a project with an empty project group." );
- }
- }
- catch ( Exception e )
- {
- throw new MojoExecutionException( "Can't add the Maven1 project from '" + projectUrl + "'.", e );
- }
- }
-}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenTwoProject.java b/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenTwoProject.java
deleted file mode 100644
index de556f4..0000000
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenTwoProject.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.apache.maven.continuum.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.continuum.xmlrpc.project.AddingResult;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Goal which add a Maven2 project.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal add-maven-two-project
- */
-public class AddMavenTwoProject
- extends AbstractContinuumMojo
-{
- /**
- * POM file name.
- *
- * @parameter expression="${pomFilename}" default-value="pom.xml"
- * @required
- */
- private String pomFilename;
-
- /**
- * POM Url.
- *
- * @parameter expression="${projectUrl}" default-value="${project.scm.url}"
- * @required
- */
- private String projectUrl;
-
- /**
- * Project Group Id.
- *
- * @parameter expression="${projectGroupId}"
- */
- private String projectGroupId;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- AddingResult addingResult = null;
- try
- {
- if ( !projectUrl.endsWith( pomFilename ) )
- {
- if ( !projectUrl.endsWith( "/" ) )
- {
- projectUrl += "/";
- }
- projectUrl += pomFilename;
- }
-
- getLog().info( "Adding M2 project from " + projectUrl );
- if ( projectGroupId != null && projectGroupId.length() > 0 )
- {
- addingResult = getClient().addMavenTwoProject( projectUrl, Integer.parseInt( projectGroupId ) );
- }
- else
- {
- addingResult = getClient().addMavenTwoProject( projectUrl );
- }
- if ( addingResult.getErrorsAsString() != null )
- {
- getLog().error( "fail to add mavenTwo project " + addingResult.getErrorsAsString() );
- throw new MojoExecutionException( "fail to add mavenTwo project " + addingResult.getErrorsAsString() );
- }
- //TODO: print projects/project groups added
- //addingResult.getProjects();
- }
- catch ( MojoExecutionException e )
- {
- throw e;
- }
- catch ( Exception e )
- {
- throw new MojoExecutionException( "Can't add the Maven2 project from '" + projectUrl + "'.", e );
- }
- }
-}
diff --git a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/PingMojo.java b/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/PingMojo.java
deleted file mode 100644
index a0569c5..0000000
--- a/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/PingMojo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.maven.continuum.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Goal which ping the Continuum server.
- *
- * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- * @version $Id$
- * @goal ping
- */
-public class PingMojo
- extends AbstractContinuumMojo
-{
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- try
- {
- getClient().ping();
- }
- catch ( Exception e )
- {
- throw new MojoExecutionException( "Can't run the continuum command.", e );
- }
- }
-}
diff --git a/pom.xml b/pom.xml
index a5be69f..ec3b238 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-parent</artifactId>
- <version>2</version>
+ <version>4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -31,7 +31,7 @@
<packaging>pom</packaging>
<name>Continuum :: Project</name>
<url>http://continuum.apache.org</url>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<prerequisites>
<maven>2.0.7</maven>
@@ -40,7 +40,7 @@
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/continuum/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/continuum/trunk</developerConnection>
- <url>http://svn.apache.org/viewcvs.cgi/continuum/trunk</url>
+ <url>http://svn.apache.org/viewvc/continuum/trunk/</url>
</scm>
<distributionManagement>
<site>
@@ -53,24 +53,27 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>1.1.1</version>
+ <version>2.3.1</version>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>changelog-maven-plugin</artifactId>
+ <artifactId>maven-changelog-plugin</artifactId>
+ <version>2.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
+ <version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.6.1</version>
<configuration>
<source>1.5</source>
<aggregate>true</aggregate>
@@ -90,12 +93,25 @@
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
+ <version>2.4</version>
<!-- TODO: choose appropriate rulesets -->
<configuration>
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
- </plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <inherited>true</inherited>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ <inherited>true</inherited>
+ </plugin>
+ </plugins>
</reporting>
<build>
<pluginManagement>
@@ -105,17 +121,18 @@
<configuration>
<tagBase>https://svn.apache.org/repos/asf/continuum/tags</tagBase>
<preparationGoals>clean install</preparationGoals>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-maven-plugin</artifactId>
- <version>1.3.4</version>
+ <version>1.3.8</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <version>1.0-alpha-18</version>
+ <version>1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -196,6 +213,7 @@
<exclude>xom:xom</exclude>
<exclude>org.codehaus.plexus:plexus-log4j-logging</exclude>
<exclude>commons-logging:commons-logging</exclude>
+ <exclude>org.slf4j:jcl104-over-slf4j</exclude>
</excludes>
</bannedDependencies>
</rules>
@@ -216,6 +234,12 @@
</manifestEntries>
</archive>
</configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -272,7 +296,6 @@
<module>continuum-xmlrpc</module>
<module>continuum-release</module>
<module>continuum-data-management</module>
- <module>maven-continuum-plugin</module>
<module>continuum-docs</module>
<module>continuum-jetty</module>
<module>continuum-purge</module>
@@ -327,7 +350,7 @@
<snapshots>
<enabled>true</enabled>
</snapshots>
- </repository>
+ </repository>
</repositories>
<dependencies>
<dependency>
@@ -494,9 +517,39 @@
<version>${maven-scm.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-bazaar</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-clearcase</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-hg</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-perforce</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-starteam</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-synergy</artifactId>
+ <version>${maven-scm.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.release</groupId>
<artifactId>maven-release-manager</artifactId>
- <version>2.0-beta-10-SNAPSHOT</version>
+ <version>2.0-beta-9</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -547,53 +600,53 @@
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-model</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-commons</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-configuration</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-scm</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-store</artifactId>
<classifier>tests</classifier>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-store</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-reports</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-core</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-test</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
@@ -608,7 +661,7 @@
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-xmlrpc-server</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
@@ -661,129 +714,129 @@
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-plexus-application</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-notifier-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-notifier-irc</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-notifier-jabber</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-notifier-msn</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-notifier-wagon</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-release</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-security</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-webapp</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-legacy</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>data-management-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>data-management-cli</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>data-management-jdo</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>data-management-redback-jdo</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>redback-legacy</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-builder</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-buildagent-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-buildagent-core</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-buildagent-webapp</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave-server</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-slave-client</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master-api</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master-server</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-distributed-master-client</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
@@ -908,7 +961,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.5.4</version>
+ <version>1.5.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -940,7 +993,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-velocity</artifactId>
- <version>1.1.4</version>
+ <version>1.1.7</version>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
@@ -967,11 +1020,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -983,6 +1037,11 @@
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4jVersion}</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>${slf4jVersion}</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -1042,11 +1101,6 @@
<version>3.2.1</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.0.14</version>
@@ -1313,12 +1367,18 @@
<dependency>
<groupId>org.apache.continuum</groupId>
<artifactId>continuum-purge</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-model</artifactId>
<version>${archiva.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
@@ -1340,6 +1400,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -1449,77 +1513,17 @@
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
+ <artifactId>jsp-2.1-jetty</artifactId>
<version>${jetty.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-api-2.0</artifactId>
- <version>${jetty.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-plus</artifactId>
<version>${jetty.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.6.5</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>commons-el</groupId>
- <artifactId>commons-el</artifactId>
- <version>1.0</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- <version>5.5.15</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- <version>5.5.15</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler-jdt</artifactId>
- <version>5.5.15</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>com.google.code.cli-parser</groupId>
<artifactId>cli</artifactId>
<version>7</version>
@@ -1583,11 +1587,16 @@
<artifactId>jdo2-api</artifactId>
<version>2.0</version>
</dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.0.b2</version>
- </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>1.1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -1605,7 +1614,7 @@
</descriptors>
<tarLongFileMode>gnu</tarLongFileMode>
<appendAssemblyId>false</appendAssemblyId>
- <finalName>apache-continuum-${version}-src</finalName>
+ <finalName>apache-continuum-${project.version}-src</finalName>
</configuration>
<executions>
<execution>
@@ -1658,15 +1667,15 @@
</profiles>
<properties>
- <jetty.version>6.1.11</jetty.version>
- <continuumWebappVersion>${pom.version}</continuumWebappVersion>
+ <jetty.version>6.1.19</jetty.version>
+ <continuumWebappVersion>${project.version}</continuumWebappVersion>
<maven.version>2.0.9</maven.version>
<spring.version>2.5.6</spring.version>
<wagon.version>1.0-beta-2</wagon.version>
<maven-scm.version>1.2</maven-scm.version>
- <redback.version>1.2.1</redback.version>
- <archiva.version>1.1</archiva.version>
- <slf4jVersion>1.5.6</slf4jVersion>
+ <redback.version>1.2.3</redback.version>
+ <archiva.version>1.2.1</archiva.version>
+ <slf4jVersion>1.5.8</slf4jVersion>
<xmlrpc.version>3.1</xmlrpc.version>
<atlassian.xmlrpc.binder.version>0.8.2</atlassian.xmlrpc.binder.version>
</properties>
diff --git a/release-script.sh b/release-script.sh
index 52afe42..9394848 100755
--- a/release-script.sh
+++ b/release-script.sh
@@ -6,51 +6,63 @@
set -x
if test $# -ne 2
then
- echo 'usage release-script.sh version stagingRepoPath on p.a.o'
+ echo 'usage release-script.sh version stagingRepoUrl'
exit
fi
-export VER=$1
-export STAGE_REPO=$2
+export version=$1
+export repo=$2
-cd /www/people.apache.org/builds/continuum/$1
+mkdir /www/people.apache.org/builds/continuum/$version
+cd /www/people.apache.org/builds/continuum/$version
-find $STAGE_REPO -name "*.zip*" -exec cp {} . \;
-find $STAGE_REPO -name "*.tar.gz*" -exec cp {} . \;
-find $STAGE_REPO -name "*.war*" -exec cp {} . \;
-find . -name "*.asc.*" -exec rm {} \;
+mkdir binaries
+cd binaries
+for i in tar.gz tar.gz.asc tar.gz.md5 tar.gz.sha1 zip zip.asc zip.md5 zip.sha1
+do
+ wget -O apache-continuum-$version-bin.$i $repo/org/apache/continuum/continuum-jetty/$version/continuum-jetty-$version-bin.$i
+ if [ ! -s apache-continuum-$version-bin.$i ]; then
+ echo Unable to find apache-continuum-$version-bin.$i
+ exit 1
+ fi
+done
-mv continuum-$VER.zip apache-continuum-$VER-src.zip
-mv continuum-$VER.zip.md5 apache-continuum-$VER-src.zip.md5
-mv continuum-$VER.zip.sha1 apache-continuum-$VER-src.zip.sha1
-mv continuum-$VER.zip.asc apache-continuum-$VER-src.zip.asc
+for i in tar.gz tar.gz.asc tar.gz.md5 tar.gz.sha1 zip zip.asc zip.md5 zip.sha1
+do
+ wget -O apache-continuum-buildagent-$version-bin.$i $repo/org/apache/continuum/continuum-buildagent-jetty/$version/continuum-buildagent-jetty-$version-bin.$i
+ if [ ! -s apache-continuum-buildagent-$version-bin.$i ]; then
+ echo Unable to find apache-continuum-buildagent-$version-bin.$i
+ exit 1
+ fi
+done
-mv continuum-jetty-$VER-bin.tar.gz apache-continuum-$VER-bin.tar.gz
-mv continuum-jetty-$VER-bin.tar.gz.md5 apache-continuum-$VER-bin.tar.gz.md5
-mv continuum-jetty-$VER-bin.tar.gz.sha1 apache-continuum-$VER-bin.tar.gz.sha1
-mv continuum-jetty-$VER-bin.tar.gz.asc apache-continuum-$VER-bin.tar.gz.asc
+for i in war war.asc war.md5 war.sha1
+do
+ wget -O apache-continuum-$version.$i $repo/org/apache/continuum/continuum-webapp/$version/continuum-webapp-$version.$i
+ if [ ! -s apache-continuum-$version.$i ]; then
+ echo Unable to find apache-continuum-$version.$i
+ exit 1
+ fi
+done
-mv continuum-jetty-$VER-bin.zip apache-continuum-$VER-bin.zip
-mv continuum-jetty-$VER-bin.zip.md5 apache-continuum-$VER-bin.zip.md5
-mv continuum-jetty-$VER-bin.zip.sha1 apache-continuum-$VER-bin.zip.sha1
-mv continuum-jetty-$VER-bin.zip.asc apache-continuum-$VER-bin.zip.asc
+for i in war war.asc war.md5 war.sha1
+do
+ wget -O apache-continuum-buildagent-$version.$i $repo/org/apache/continuum/continuum-buildagent-webapp/$version/continuum-buildagent-webapp-$version.$i
+ if [ ! -s apache-continuum-buildagent-$version.$i ]; then
+ echo Unable to find apache-continuum-buildagent-$version.$i
+ exit 1
+ fi
+done
-mv continuum-webapp-$VER.war apache-continuum-$VER.war
-mv continuum-webapp-$VER.war.asc apache-continuum-$VER.war.asc
-mv continuum-webapp-$VER.war.md5 apache-continuum-$VER.war.md5
-mv continuum-webapp-$VER.war.sha1 apache-continuum-$VER.war.sha1
+cd ..
+mkdir source
+cd source
+for i in zip zip.asc zip.md5 zip.sha1
+do
+ wget -O apache-continuum-$version-src.$i $repo/org/apache/continuum/continuum/$version/continuum-$version.$i
+ if [ ! -s apache-continuum-$version-src.$i ]; then
+ echo Unable to find apache-continuum-$version-src.$i
+ exit 1
+ fi
+done
-mv continuum-buildagent-jetty-$VER-bin.tar.gz apache-continuum-buildagent-$VER-bin.tar.gz
-mv continuum-buildagent-jetty-$VER-bin.tar.gz.md5 apache-continuum-buildagent-$VER-bin.tar.gz.md5
-mv continuum-buildagent-jetty-$VER-bin.tar.gz.sha1 apache-continuum-buildagent-$VER-bin.tar.gz.sha1
-mv continuum-buildagent-jetty-$VER-bin.tar.gz.asc apache-continuum-buildagent-$VER-bin.tar.gz.asc
-
-mv continuum-buildagent-jetty-$VER-bin.zip apache-continuum-buildagent-$VER-bin.zip
-mv continuum-buildagent-jetty-$VER-bin.zip.md5 apache-continuum-buildagent-$VER-bin.zip.md5
-mv continuum-buildagent-jetty-$VER-bin.zip.sha1 apache-continuum-buildagent-$VER-bin.zip.sha1
-mv continuum-buildagent-jetty-$VER-bin.zip.asc apache-continuum-buildagent-$VER-bin.zip.asc
-
-mv continuum-buildagent-webapp-$VER.war apache-continuum-buildagent-$VER.war
-mv continuum-buildagent-webapp-$VER.war.asc apache-continuum-buildagent-$VER.war.asc
-mv continuum-buildagent-webapp-$VER.war.md5 apache-continuum-buildagent-$VER.war.md5
-mv continuum-buildagent-webapp-$VER.war.sha1 apache-continuum-buildagent-$VER.war.sha1
echo 'GREAT :-) '
diff --git a/src/site/apt/architecture.apt b/src/site/apt/architecture.apt
new file mode 100644
index 0000000..d44d05d
--- /dev/null
+++ b/src/site/apt/architecture.apt
@@ -0,0 +1,34 @@
+ ---
+Architecture
+ ---
+
+~~ 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.
+
+Continuum Architecture
+
+
+ There has been {{{http://www.nabble.com/separating-the-builder-code-from-the-UI-td16626111.html}some discussion}}
+ of moving the Continuum architecture from
+
+[./images/continuum-now.png]
+
+ to
+
+[./images/continuum-new.png]
+
+ .
diff --git a/src/site/apt/findbugs.apt b/src/site/apt/findbugs.apt
index 51280fe..90cc076 100644
--- a/src/site/apt/findbugs.apt
+++ b/src/site/apt/findbugs.apt
@@ -2,6 +2,23 @@
FindBugs Bug Detector Reports
---------
+~~ 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.
+
FindBugs Bug Detector Reports
Want to help find and fix bugs in Continuum?
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
new file mode 100644
index 0000000..59ea11f
--- /dev/null
+++ b/src/site/apt/index.apt
@@ -0,0 +1,36 @@
+ ----
+ Welcome
+ ----
+
+~~ 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.
+
+Apache Continuum Developer Documentation
+
+ Welcome! This site contains the developer documentation for Apache Continuum. Here you will find Javadocs,
+ FindBugs reports, information about our unit and functional tests, and some requirements docs.
+
+ {{{apidocs/index.html}Javadocs}}.
+
+ {{{findbugs.html}Findbugs Reports}}.
+
+ {{{architecture.html}Architecture}}.
+
+ {{{requirements.html}Requirements}}.
+
+ {{{continuum-webapp-test/index.html}Functional Tests}}.
+
\ No newline at end of file
diff --git a/src/site/apt/requirements.apt b/src/site/apt/requirements.apt
new file mode 100644
index 0000000..2a69eea
--- /dev/null
+++ b/src/site/apt/requirements.apt
@@ -0,0 +1,34 @@
+ ----
+ Requirements
+ ----
+
+~~ 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.
+
+Requirements
+
+ The Continuum project does not have formal requirements docs, but there are some general requirements we adhere to.
+
+ * Anything that goes in the database must have a way to come out. For example, we add build results to the database,
+ and provide a way to delete them through the Web UI and the XML-RPC interface, as well as deleting them automatically
+ when the project they belong to is deleted.
+
+ []
+
+ In addition, we have the following requirements defined:
+
+ * {{{credentials.html}Credentials Handling}}
\ No newline at end of file
diff --git a/src/site/resources/images/continuum-new.png b/src/site/resources/images/continuum-new.png
new file mode 100644
index 0000000..1e9e699
--- /dev/null
+++ b/src/site/resources/images/continuum-new.png
Binary files differ
diff --git a/src/site/resources/images/continuum-now.png b/src/site/resources/images/continuum-now.png
new file mode 100644
index 0000000..2682215
--- /dev/null
+++ b/src/site/resources/images/continuum-now.png
Binary files differ
diff --git a/src/site/xdoc/credentials.xml b/src/site/xdoc/credentials.xml
new file mode 100644
index 0000000..76b3155
--- /dev/null
+++ b/src/site/xdoc/credentials.xml
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+
+ <properties>
+ <title>Credentials Handling</title>
+ </properties>
+
+ <body>
+
+ <section name="Credentials Handling">
+
+ <p>This document describes how Continuum should handle credentials for pom retrieval and scm access.</p>
+
+ <table>
+ <tr>
+ <th>Were credentials provided when the project was added?</th>
+ <th>Was 'Use cached credentials if available' checked when the project was added?</th>
+ <th>Are there Subversion credentials cached for the user running Continuum?</th>
+ <th>Were credentials provided during release prepare?</th>
+ <th> </th>
+ <th>Initial project add</th>
+ <th>Scheduled or Forced Build</th>
+ <th>Release</th>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td> </td>
+ <td>use the provided credentials for the HTTP GET to
+ retrieve the POM. Rely on cached credentials for the initial checkout [2].
+ Do not store the credentials in the database because the checkbox says we
+ should rely on cached credentials.</td>
+
+ <td>Rely on the cached credentials [2]</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2]</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td> </td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2]. Will probably fail because they are missing.</td>
+ <td>use the credentials provided during release prepare. Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2].</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td> </td>
+ <td>use the provided credentials for the HTTP GET to
+ retrieve the pom and for the initial checkout. Store the credentials in the
+ database for later use.</td>
+ <td>Use the credentials from the database [3]</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2].</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>N</td>
+ <td>N</td>
+
+ <td>Y</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>Y</td>
+ <td>N</td>
+ <td>N</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on unauthenticated access to the scm repo</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td> </td>
+ <td>GET the pom and do the initial checkout with no
+ credentials</td>
+ <td>Rely on cached credentials or unauthenticated access
+ to the scm repo [2].</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2].</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>rely on cached credentials or unauthenticated access to scm [2].</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>use the credentials provided during release prepare. Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>Rely on the cached credentials [2]</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>N</td>
+ <td>N</td>
+ <td>Y</td>
+ <td> </td>
+ <td>"</td>
+ <td>"</td>
+ <td>use the credentials provided during release prepare.
+ Avoid caching these credentials. [1]</td>
+ </tr>
+ <tr>
+ <td>N</td>
+ <td>N</td>
+ <td>N</td>
+ <td>N</td>
+ <td> </td>
+ <td>"</td>
+ <td>Rely on unauthenticated access to the scm repo</td>
+ <td>Rely on unauthenticated access to the scm repo</td>
+ </tr>
+ </table>
+
+ <p>A " (double quote) in a table cell means "same as above".</p>
+
+ <p>Implementation Notes for Subversion:
+ <ul>
+ <li>[1] Use --no-cache-credentials on the svn command</li>
+ <li>[2] Do not provide --username and --password on the svn command line</li>
+ <li>[3] Provide --username and --password on the svn command line</li>
+ </ul>
+ </p>
+ </section>
+
+ <section name="Testing">
+ <p>Currently the tests for these features tend to be manual since they require access to a secured website
+ and/or scm repository. This test is currently disabled: AbstractContinuumProjectBuilderTest.</p>
+
+ </section>
+
+ </body>
+
+</document>
\ No newline at end of file