You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by tr...@apache.org on 2005/07/24 17:02:15 UTC
svn commit: r224623 - in /maven/continuum/trunk:
continuum-core/src/main/java/org/apache/maven/continuum/
continuum-core/src/main/java/org/apache/maven/continuum/core/action/
continuum-core/src/main/java/org/apache/maven/continuum/utils/
continuum-core...
Author: trygvis
Date: Sun Jul 24 08:01:56 2005
New Revision: 224623
URL: http://svn.apache.org/viewcvs?rev=224623&view=rev
Log:
o Cleaning up a bit, preparing for next round of changes.
- Removing scmUrl from the project construction in the test cases.
o Adding actions to validate and store the project groups.
Added:
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java (with props)
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java (with props)
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java (with props)
Modified:
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutorTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ContinuumTypicalUsageTest.java
maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Sun Jul 24 08:01:56 2005
@@ -446,13 +446,7 @@
context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, core.getWorkingDirectory() );
// ----------------------------------------------------------------------
- // During the execution of the this action we may find that the metadata
- // isn't good enough for the following reasons:
- //
- // 1) No scm element (repository element for m1)
- // 2) Invalid scm element (repository element for m1)
- // 3) No ciManagement (m2)
- // 4) Invalid ciManagement element (m2)
+ // Create the projects from the URL
// ----------------------------------------------------------------------
executeAction( "create-projects-from-metadata", context );
@@ -470,7 +464,8 @@
}
// ----------------------------------------------------------------------
- // Save any new project groups that we've found
+ // Save any new project groups that we've found. Currenly all projects
+ // will go into the first project group in the list.
// ----------------------------------------------------------------------
ContinuumProjectGroup projectGroup = null;
@@ -479,21 +474,21 @@
{
projectGroup = (ContinuumProjectGroup) it.next();
- getLogger().info( "Looking for project group '" + projectGroup.getGroupId() + "'." );
-
try
{
try
{
projectGroup = store.getProjectGroupByGroupId( projectGroup.getGroupId() );
-
- getLogger().info( "Existed." );
}
catch ( ContinuumObjectNotFoundException e )
{
- projectGroup = store.addProjectGroup( projectGroup );
+ Map pgContext = new HashMap();
+
+ pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
- getLogger().info( "Added." );
+ executeAction( "validate-project-group", pgContext );
+
+ executeAction( "store-project-group", pgContext );
}
}
catch ( ContinuumStoreException e )
@@ -504,8 +499,6 @@
if ( projectGroup == null )
{
- getLogger().info( "Using default project group." );
-
projectGroup = getDefaultProjectGroup();
}
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java Sun Jul 24 08:01:56 2005
@@ -21,6 +21,7 @@
import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
import org.apache.maven.continuum.project.ContinuumBuild;
import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumProjectGroup;
import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
import org.apache.maven.continuum.scm.ContinuumScm;
import org.apache.maven.continuum.scm.ScmResult;
@@ -44,11 +45,15 @@
// Keys for the values that can be in the context
// ----------------------------------------------------------------------
- public final static String KEY_PROJECT_ID = "project-id";
+ public static final String KEY_PROJECT_ID = "project-id";
- public final static String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
+ public static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
- public final static String KEY_BUILD_ID = "build-id";
+ public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+
+ public static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
+
+ public static final String KEY_BUILD_ID = "build-id";
public static final String KEY_WORKING_DIRECTORY = "working-directory";
@@ -163,7 +168,12 @@
public static ContinuumProject getUnvalidatedProject( Map context )
{
- return ((ContinuumProject) getObject( context, KEY_UNVALIDATED_PROJECT ) );
+ return (ContinuumProject) getObject( context, KEY_UNVALIDATED_PROJECT );
+ }
+
+ public static ContinuumProjectGroup getUnvalidatedProjectGroup( Map context )
+ {
+ return (ContinuumProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP );
}
protected ContinuumBuild getBuild( Map context )
Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java?rev=224623&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java Sun Jul 24 08:01:56 2005
@@ -0,0 +1,54 @@
+package org.apache.maven.continuum.core.action;
+
+/*
+ * Copyright 2005 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 org.apache.maven.continuum.core.ContinuumCore;
+import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
+import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumProjectGroup;
+import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
+import org.apache.maven.continuum.scm.ContinuumScm;
+import org.apache.maven.continuum.scm.ScmResult;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.ContinuumException;
+
+import org.codehaus.plexus.action.AbstractAction;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public abstract class AbstractValidationContinuumAction
+ extends AbstractContinuumAction
+{
+ protected void assertStringNotEmpty( String value, String fieldName )
+ throws ContinuumException
+ {
+ if ( StringUtils.isEmpty( value ) )
+ {
+ throw new ContinuumException( "The " + fieldName + " has to be set." );
+ }
+ }
+}
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractValidationContinuumAction.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java Sun Jul 24 08:01:56 2005
@@ -1,7 +1,20 @@
+package org.apache.maven.continuum.core.action;
+
/*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ * Copyright 2005 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.
*/
-package org.apache.maven.continuum.core.action;
import org.apache.maven.continuum.project.ContinuumProject;
import org.apache.maven.continuum.scm.queue.CheckOutTask;
Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java?rev=224623&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java Sun Jul 24 08:01:56 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.continuum.core.action;
+
+/*
+ * Copyright 2004-2005 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 org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.project.ContinuumProjectGroup;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class StoreProjectGroupAction
+ extends AbstractContinuumAction
+{
+ public void execute( Map context )
+ throws ContinuumException, ContinuumStoreException
+ {
+ ContinuumProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ projectGroup = getStore().addProjectGroup( projectGroup );
+
+ context.put( KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+
+ // ----------------------------------------------------------------------
+ // Set the working directory
+ // ----------------------------------------------------------------------
+
+ File projectWorkingDirectory = new File( getCore().getWorkingDirectory(),
+ projectGroup.getId() );
+
+ if ( !projectWorkingDirectory.exists() && !projectWorkingDirectory.mkdirs() )
+ {
+ throw new ContinuumException( "Could not make the working directory for the project " +
+ "'" + projectWorkingDirectory.getAbsolutePath() + "'." );
+ }
+
+ // The working directory is created based on the project id so we can always
+ // figure out what it is.
+
+ projectGroup.setWorkingDirectory( projectWorkingDirectory.getAbsolutePath() );
+
+ getStore().updateProjectGroup( projectGroup );
+ }
+}
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java Sun Jul 24 08:01:56 2005
@@ -1,7 +1,20 @@
+package org.apache.maven.continuum.core.action;
+
/*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ * Copyright 2004-2005 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.
*/
-package org.apache.maven.continuum.core.action;
import org.apache.maven.continuum.ContinuumException;
import org.apache.maven.continuum.project.ContinuumProject;
@@ -14,7 +27,7 @@
* @version $Id$
*/
public class ValidateProject
- extends AbstractContinuumAction
+ extends AbstractValidationContinuumAction
{
public void execute( Map context )
throws Exception
@@ -41,21 +54,10 @@
// throw new ContinuumStoreException( "A project with the scm url '" + scmUrl + "' already exist." );
// }
- if ( StringUtils.isEmpty( project.getScmUrl() ) )
- {
- throw new ContinuumException( "The SCM URL has to be set." );
- }
-
// TODO: Enable
-// if ( StringUtils.isEmpty( project.getGroupId() ) )
-// {
-// throw new ContinuumException( "The group id has to be set." );
-// }
-//
-// if ( StringUtils.isEmpty( project.getArtifactId() ) )
-// {
-// throw new ContinuumException( "The artifact id has to be set." );
-// }
+// assertStringNotEmpty( project.getPath(), "path" );
+// assertStringNotEmpty( project.getGroupId(), "group id" );
+// assertStringNotEmpty( project.getArtifactId(), "artifact id" );
// TODO: validate that the SCM provider id
Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java?rev=224623&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java Sun Jul 24 08:01:56 2005
@@ -0,0 +1,41 @@
+package org.apache.maven.continuum.core.action;
+
+/*
+ * Copyright 2004-2005 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 org.apache.maven.continuum.project.ContinuumProjectGroup;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class ValidateProjectGroup
+ extends AbstractValidationContinuumAction
+{
+ public void execute( Map context )
+ throws Exception
+ {
+ ContinuumProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
+
+ // TODO: assert that the name is unique
+
+ assertStringNotEmpty( projectGroup.getName(), "name" );
+
+ assertStringNotEmpty( projectGroup.getGroupId(), "group id" );
+ }
+}
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java Sun Jul 24 08:01:56 2005
@@ -1,7 +1,20 @@
+package org.apache.maven.continuum.utils;
+
/*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ * Copyright 2004-2005 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.
*/
-package org.apache.maven.continuum.utils;
import org.apache.maven.continuum.project.ContinuumDependency;
import org.apache.maven.continuum.project.ContinuumProject;
Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml Sun Jul 24 08:01:56 2005
@@ -655,8 +655,28 @@
</component>
<component>
<role>org.codehaus.plexus.action.Action</role>
+ <role-hint>store-project-group</role-hint>
+ <implementation>org.apache.maven.continuum.core.action.StoreProjectGroupAction</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.core.ContinuumCore</role>
+ </requirement>
+ </requirements>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.action.Action</role>
<role-hint>validate-project</role-hint>
<implementation>org.apache.maven.continuum.core.action.ValidateProject</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.core.ContinuumCore</role>
+ </requirement>
+ </requirements>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.action.Action</role>
+ <role-hint>validate-project-group</role-hint>
+ <implementation>org.apache.maven.continuum.core.action.ValidateProjectGroup</implementation>
<requirements>
<requirement>
<role>org.apache.maven.continuum.core.ContinuumCore</role>
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java Sun Jul 24 08:01:56 2005
@@ -42,7 +42,7 @@
public void testTestTheQueueWithASingleProject()
throws Exception
{
- ContinuumProject project = addMavenTwoProject( getStore(), "Build Queue Project 1", "1" );
+ ContinuumProject project = addMavenTwoProject( getStore(), "Build Queue Project 1" );
String projectId = project.getId();
@@ -67,9 +67,9 @@
public void testTheQueueWithMultipleProjects()
throws Exception
{
- String projectId1 = addMavenTwoProject( getStore(), "Build Queue Project 2", "foo" ).getId();
+ String projectId1 = addMavenTwoProject( getStore(), "Build Queue Project 2" ).getId();
- String projectId2 = addMavenTwoProject( getStore(), "Build Queue Project 3", "bar" ).getId();
+ String projectId2 = addMavenTwoProject( getStore(), "Build Queue Project 3" ).getId();
buildProject( projectId1, false );
@@ -105,7 +105,7 @@
{
String name = "Build Queue Project 4";
- String projectId = addMavenTwoProject( getStore(), name, "4" ).getId();
+ String projectId = addMavenTwoProject( getStore(), name ).getId();
buildProject( projectId, true );
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutorTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutorTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutorTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutorTest.java Sun Jul 24 08:01:56 2005
@@ -32,7 +32,7 @@
{
ShellBuildExecutor buildExecutor = (ShellBuildExecutor) getBuildExecutor( ShellBuildExecutor.ID );
- ShellProject project = makeStubShellProject( "Shell project", "scm:foo" );
+ ShellProject project = makeStubShellProject( "Shell project" );
String script = project.getExecutable();
@@ -44,7 +44,7 @@
public void testAbsolutePath()
throws Exception
{
- ShellProject project = makeStubShellProject( "Shell project", "scm:foo" );
+ ShellProject project = makeStubShellProject( "Shell project" );
project.setExecutable( getTestFile( "foo.sh" ).getAbsolutePath() );
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java Sun Jul 24 08:01:56 2005
@@ -38,8 +38,7 @@
ContinuumStore store = getStore();
ContinuumProject project = AbstractContinuumTest.addMavenTwoProject( store,
- "Notification Dispatcher Test Project",
- "scm:notification/dispatcher" );
+ "Notification Dispatcher Test Project" );
ContinuumBuild build = new ContinuumBuild();
build.setStartTime( System.currentTimeMillis() );
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java Sun Jul 24 08:01:56 2005
@@ -16,38 +16,36 @@
* limitations under the License.
*/
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
+import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
import org.apache.maven.continuum.project.ContinuumBuild;
import org.apache.maven.continuum.project.ContinuumProject;
import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.project.MavenTwoProject;
-import org.apache.maven.continuum.scm.ScmResult;
import org.apache.maven.continuum.scm.ScmFile;
+import org.apache.maven.continuum.scm.ScmResult;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.mailsender.MailMessage;
import org.codehaus.plexus.mailsender.test.MockMailSender;
import org.codehaus.plexus.notification.notifier.Notifier;
import org.codehaus.plexus.util.CollectionUtils;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public class MailContinuumNotifierTest
- extends PlexusTestCase
+ extends AbstractContinuumTest
{
public void testSuccessfulBuild()
throws Exception
{
- ContinuumProject project = makeProject();
+ ContinuumProject project = makeStubMavenTwoProject( "Test Project" );
ContinuumBuild build = makeBuild( ContinuumProjectState.OK );
@@ -61,7 +59,7 @@
public void testFailedBuild()
throws Exception
{
- ContinuumProject project = makeProject();
+ ContinuumProject project = makeStubMavenTwoProject( "Test Project" );
ContinuumBuild build = makeBuild( ContinuumProjectState.FAILED );
@@ -75,7 +73,7 @@
public void testErrorenousBuild()
throws Exception
{
- ContinuumProject project = makeProject();
+ ContinuumProject project = makeStubMavenTwoProject( "Test Project" );
ContinuumBuild build = makeBuild( ContinuumProjectState.ERROR );
@@ -158,16 +156,6 @@
assertNull( ( (MailMessage.Address) to.get( 0 ) ).getName() );
return mailMessage;
- }
-
- private ContinuumProject makeProject()
- {
- ContinuumProject project = new MavenTwoProject();
-
- project.setName( "Test Project" );
-
- project.setExecutorId( MavenTwoBuildExecutor.ID );
- return project;
}
private ContinuumBuild makeBuild( int state )
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTest.java Sun Jul 24 08:01:56 2005
@@ -74,20 +74,16 @@
configuration.setProperty( "foo", "bar" );
ContinuumProject actual = store.addProject( makeMavenTwoProject( "Test Project",
- "scm:local:src/test/repo",
"foo@bar.com",
"1.0",
- "a b",
- "/tmp" ) );
+ "a b" ) );
assertNotNull( "The project id is null.", actual.getId() );
assertProjectEquals( makeMavenTwoProject( "Test Project",
- "scm:local:src/test/repo",
"foo@bar.com",
"1.0",
- "a b",
- "/tmp" ), actual );
+ "a b" ), actual );
}
public void testGetNonExistingProject()
@@ -114,18 +110,14 @@
throws Exception
{
String name = "Test Project 2";
- String scmUrl = "scm:local:jalla";
String nagEmailAddress = "foo@bar.com";
String version = "1.0";
String commandLineArguments = "";
- String workingDirectory = "/tmp";
ContinuumProject expected = makeMavenTwoProject( name,
- scmUrl,
nagEmailAddress,
version,
- commandLineArguments,
- workingDirectory );
+ commandLineArguments );
ContinuumProject project = store.addProject( expected );
@@ -151,11 +143,11 @@
//
// ----------------------------------------------------------------------
- project = store.getProjectByScmUrl( scmUrl );
-
- assertNotNull( project );
-
- assertEquals( projectId, project.getId() );
+// project = store.getProjectByScmUrl( scmUrl );
+//
+// assertNotNull( project );
+//
+// assertEquals( projectId, project.getId() );
// ----------------------------------------------------------------------
//
@@ -207,12 +199,10 @@
notifiers.add( notifier );
assertProjectEquals( name2,
- scmUrl2,
notifiers,
version2,
commandLineArguments2,
MavenTwoBuildExecutor.ID,
- workingDirectory,
project );
// ----------------------------------------------------------------------
@@ -246,35 +236,26 @@
throws Exception
{
String name1 = "Test All Projects 1";
- String scmUrl1 = "scm:local:src/test/repo/foo";
String nagEmailAddress1 = "foo@bar.com";
String version1 = "1.0";
String commandLineArguments1 = "";
- String workingDirectory1 = "/tmp";
ContinuumProject project1 = addMavenTwoProject( store,
name1,
- scmUrl1,
nagEmailAddress1,
version1,
- commandLineArguments1,
- workingDirectory1 );
+ commandLineArguments1 );
String name2 = "Test All Projects 2";
- String scmUrl2 = "scm:local:src/test/repo/bar";
String nagEmailAddress2 = "foo@bar.com";
String version2 = "1.0";
String commandLineArguments2 = "";
- String workingDirectory2 = "/tmp";
ContinuumProject project2 = addMavenTwoProject( store,
name2,
- scmUrl2,
nagEmailAddress2,
version2,
- commandLineArguments2,
- workingDirectory2 );
-
+ commandLineArguments2 );
Map projects = new HashMap();
Collection projectsCollection = store.getAllProjects();
@@ -293,28 +274,24 @@
}
assertProjectEquals( name1,
- scmUrl1,
(String)null,
version1,
commandLineArguments1,
MavenTwoBuildExecutor.ID,
- workingDirectory1,
- project1 );
+ (ContinuumProject) projects.get( name1 ) );
assertProjectEquals( name2,
- scmUrl2,
(String)null,
version2,
commandLineArguments2,
MavenTwoBuildExecutor.ID,
- workingDirectory2,
- project2 );
+ (ContinuumProject) projects.get( name2 ) );
}
public void testRemoveProject()
throws Exception
{
- ContinuumProject project = addMavenTwoProject( store, "Remove Test Project", "scm:remove-project" );
+ ContinuumProject project = addMavenTwoProject( store, "Remove Test Project" );
ContinuumBuild build = createBuild( store, project.getId(), false );
@@ -347,7 +324,7 @@
throws Exception
{
String projectId = addMavenTwoProject( store,
- makeStubMavenTwoProject( "Last project", "scm:foo" ) ).getId();
+ makeStubMavenTwoProject( "Last project" ) ).getId();
assertNull( store.getLatestBuildForProject( projectId ) );
@@ -369,7 +346,7 @@
public void testUpdateMavenTwoProject()
throws Exception
{
- String projectId = addMavenTwoProject( store, "Maven Two Project", "scm:foo" ).getId();
+ String projectId = addMavenTwoProject( store, "Maven Two Project" ).getId();
MavenTwoProject project = (MavenTwoProject) store.getProject( projectId );
@@ -430,7 +407,7 @@
{
lookup( JdoFactory.ROLE );
- String projectId = addMavenTwoProject( store, "Build Test Project", "scm:build" ).getId();
+ String projectId = addMavenTwoProject( store, "Build Test Project" ).getId();
// ----------------------------------------------------------------------
// Construct a build object
@@ -500,11 +477,11 @@
// Set up projects
// ----------------------------------------------------------------------
- String projectId = addMavenTwoProject( store, "Association Test Project", "scm:association" ).getId();
+ String projectId = addMavenTwoProject( store, "Association Test Project" ).getId();
- String projectIdFoo = addMavenTwoProject( store, "Foo Project", "scm:association-foo" ).getId();
+ String projectIdFoo = addMavenTwoProject( store, "Foo Project" ).getId();
- String projectIdBar = addMavenTwoProject( store, "Bar Project", "scm:association-bar" ).getId();
+ String projectIdBar = addMavenTwoProject( store, "Bar Project" ).getId();
// ----------------------------------------------------------------------
//
@@ -556,7 +533,7 @@
public void testGetLatestBuild()
throws Exception
{
- String projectId = addMavenTwoProject( store, "Association Test Project", "scm:association" ).getId();
+ String projectId = addMavenTwoProject( store, "Association Test Project" ).getId();
int size = 10;
@@ -593,7 +570,7 @@
//
// ----------------------------------------------------------------------
- String projectId = addMavenTwoProject( store, "Build Result Project", "scm:build/result" ).getId();
+ String projectId = addMavenTwoProject( store, "Build Result Project" ).getId();
long now = System.currentTimeMillis();
@@ -683,7 +660,7 @@
throws Exception
{
// create project
- ContinuumProject project = addMavenTwoProject( store, "Project Scheduling", "scm:scheduling" );
+ ContinuumProject project = addMavenTwoProject( store, "Project Scheduling" );
String projectId = project.getId();
@@ -764,7 +741,7 @@
schedule = store.addSchedule( schedule );
- ContinuumProject project = addMavenTwoProject( store, "Project", "scm:scheduling" );
+ ContinuumProject project = addMavenTwoProject( store, "Project" );
// add project
schedule.addProject( project );
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ContinuumTypicalUsageTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ContinuumTypicalUsageTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ContinuumTypicalUsageTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ContinuumTypicalUsageTest.java Sun Jul 24 08:01:56 2005
@@ -63,7 +63,7 @@
// At this point we can now accept new projects into the system
// ----------------------------------------------------------------------
- MavenTwoProject project = makeStubMavenTwoProject( "test1", "scm:url" );
+ MavenTwoProject project = makeStubMavenTwoProject( "test1" );
project = addMavenTwoProject( getStore(), project );
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java Sun Jul 24 08:01:56 2005
@@ -36,7 +36,7 @@
public void testAddingBuildGroupToProjectAndUpdatingProject()
throws Exception
{
- ContinuumProject project = addMavenTwoProject( getStore(), "Project Scheduling", "scm:scheduling" );
+ ContinuumProject project = addMavenTwoProject( getStore(), "Project Scheduling" );
ContinuumBuildGroup buildGroup = createStubBuildGroup( "Plexus", "Description" );
@@ -61,7 +61,7 @@
buildGroup = getStore().addBuildGroup( buildGroup );
- ContinuumProject project = addMavenTwoProject( getStore(), "project1", "scm:scheduling" );
+ ContinuumProject project = addMavenTwoProject( getStore(), "project1" );
// add project
buildGroup.addProject( project );
@@ -117,7 +117,7 @@
projectGroup = getStore().addProjectGroup( projectGroup );
- ContinuumProject project = addMavenTwoProject( getStore(), "project2", "scm:scheduling" );
+ ContinuumProject project = addMavenTwoProject( getStore(), "project2" );
// add project
projectGroup.addProject( project );
@@ -306,13 +306,13 @@
// Add projects from URL metadata
// ----------------------------------------------------------------------
- MavenTwoProject componentA = makeStubMavenTwoProject( "component a", "a" );
+ MavenTwoProject componentA = makeStubMavenTwoProject( "component a" );
componentA.setProjectGroup( plexusGroup );
componentA = addMavenTwoProject( getStore(), componentA );
- MavenTwoProject componentB = makeStubMavenTwoProject( "component b", "b" );
+ MavenTwoProject componentB = makeStubMavenTwoProject( "component b" );
componentB.setProjectGroup( plexusGroup );
@@ -351,8 +351,6 @@
//String buildGroupId = getStore().addBuildGroup( buildGroup );
//buildGroup = getStore().getBuildGroup( buildGroupId );
-
- System.err.println( "buildGroup.id: " + buildGroup.getId() );
// ----------------------------------------------------------------------
// Add component A to the build group
Modified: maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo Sun Jul 24 08:01:56 2005
@@ -12,6 +12,9 @@
<field name="scmUrl" persistence-modifier="persistent"/>
<field name="version" persistence-modifier="persistent"/>
<field name="workingDirectory" persistence-modifier="persistent"/>
+<!--
+ <field name="path" persistence-modifier="persistent"/>
+-->
<field name="state" persistence-modifier="none"/>
<field name="executorId" persistence-modifier="persistent"/>
<field name="latestBuildId" persistence-modifier="persistent"/>
@@ -155,6 +158,8 @@
<field name="description" persistence-modifier="persistent"/>
<field name="url" persistence-modifier="persistent"/>
<field name="issueManagementUrl" persistence-modifier="persistent"/>
+ <field name="scmUrl" persistence-modifier="persistent"/>
+ <field name="workingDirectory" persistence-modifier="persistent"/>
<field name="projects" persistence-modifier="persistent" mapped-by="projectGroup">
<collection element-type="ContinuumProject"/>
</field>
Modified: maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Sun Jul 24 08:01:56 2005
@@ -46,6 +46,14 @@
<version>1.0.0</version>
<type>String</type>
</field>
+<!--
+add stash.storable="false" to workingDirectory and scmUrl
+ <field>
+ <name>path</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ </field>
+-->
<field stash.storable="false">
<name>state</name>
<version>1.0.0</version>
@@ -572,9 +580,9 @@
</field>
</fields>
</class>
-
+
<!-- Profiles -->
-
+
<class>
<name>ContinuumProfile</name>
<packageName>org.apache.maven.continuum.profile</packageName>
@@ -604,7 +612,7 @@
<name>home</name>
<version>1.0.0</version>
<type>String</type>
- </field>
+ </field>
</fields>
</class>
@@ -683,6 +691,16 @@
</field>
<field>
<name>issueManagementUrl</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ </field>
+ <field>
+ <name>scmUrl</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ </field>
+ <field>
+ <name>workingDirectory</name>
<version>1.0.0</version>
<type>String</type>
</field>
Modified: maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java (original)
+++ maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java Sun Jul 24 08:01:56 2005
@@ -16,31 +16,30 @@
* limitations under the License.
*/
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-
+import org.apache.maven.continuum.configuration.ConfigurationService;
import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumBuildGroup;
+import org.apache.maven.continuum.project.ContinuumBuildSettings;
import org.apache.maven.continuum.project.ContinuumNotifier;
import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumProjectGroup;
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.project.MavenTwoProject;
import org.apache.maven.continuum.project.ShellProject;
-import org.apache.maven.continuum.project.ContinuumBuildSettings;
-import org.apache.maven.continuum.project.ContinuumBuildGroup;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
import org.apache.maven.continuum.scm.ScmFile;
import org.apache.maven.continuum.scm.ScmResult;
import org.apache.maven.continuum.store.ContinuumStore;
import org.apache.maven.continuum.store.ContinuumStoreException;
import org.apache.maven.continuum.utils.ContinuumUtils;
-import org.apache.maven.continuum.configuration.ConfigurationService;
-
import org.codehaus.plexus.PlexusTestCase;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
@@ -96,31 +95,25 @@
// Maven 2 Project Generators
// ----------------------------------------------------------------------
- public static MavenTwoProject makeStubMavenTwoProject( String name, String scmUrl )
+ public static MavenTwoProject makeStubMavenTwoProject( String name )
{
return makeMavenTwoProject( name,
- scmUrl,
"foo@bar.com",
"1.0",
- "",
- PlexusTestCase.getTestFile( "plexus-temp" ).getAbsolutePath() );
+ "" );
}
public static MavenTwoProject makeMavenTwoProject( String name,
- String scmUrl,
String emailAddress,
String version,
- String commandLineArguments,
- String workingDirectory )
+ String commandLineArguments )
{
MavenTwoProject project = new MavenTwoProject();
makeProject( project,
name,
- scmUrl,
version,
commandLineArguments,
- workingDirectory,
"maven2" );
List notifiers = createMailNotifierList( emailAddress );
@@ -134,16 +127,14 @@
// Shell Project Generators
// ----------------------------------------------------------------------
- public static ShellProject makeStubShellProject( String name, String scmUrl )
+ public static ShellProject makeStubShellProject( String name )
{
ShellProject project = new ShellProject();
makeProject( project,
name,
- scmUrl,
"1.0",
"",
- PlexusTestCase.getTestFile( "plexus-temp" ).getAbsolutePath(),
"shell" );
project.setExecutable( "script.sh" );
@@ -153,19 +144,18 @@
public static ContinuumProject makeProject( ContinuumProject project,
String name,
- String scmUrl,
String version,
String commandLineArguments,
- String workingDirectory,
String executorId )
{
project.setName( name );
- project.setScmUrl( scmUrl );
project.setVersion( version );
project.setCommandLineArguments( commandLineArguments );
- project.setWorkingDirectory( workingDirectory );
project.setExecutorId( executorId );
+ // TODO: Remove
+ project.setWorkingDirectory( "/tmp" );
+
return project;
}
@@ -199,7 +189,7 @@
public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
MavenTwoProject project )
- throws Exception
+ throws Exception
{
ContinuumProject addedProject = store.addProject( project );
@@ -225,29 +215,24 @@
}
public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
- String name,
- String scmUrl )
- throws Exception
+ String name )
+ throws Exception
{
- return addMavenTwoProject( store, makeStubMavenTwoProject( name, scmUrl ) );
+ return addMavenTwoProject( store, makeStubMavenTwoProject( name ) );
}
public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
String name,
- String scmUrl,
String nagEmailAddress,
String version,
- String commandLineArguments,
- String workingDirectory )
- throws Exception
+ String commandLineArguments )
+ throws Exception
{
ContinuumProject project = store.addProject(
makeMavenTwoProject( name,
- scmUrl,
nagEmailAddress,
version,
- commandLineArguments,
- workingDirectory ) );
+ commandLineArguments ) );
ScmResult scmResult = new ScmResult();
@@ -263,7 +248,7 @@
public static ContinuumBuild createBuild( ContinuumStore store,
String projectId,
boolean forced )
- throws ContinuumStoreException
+ throws ContinuumStoreException
{
ContinuumBuild build = new ContinuumBuild();
@@ -281,7 +266,7 @@
ScmResult scmResult,
String errorMessage,
Throwable exception )
- throws ContinuumStoreException
+ throws ContinuumStoreException
{
project.setScmResult( scmResult );
@@ -327,46 +312,38 @@
ContinuumProject actual )
{
assertProjectEquals( expected.getName(),
- expected.getScmUrl(),
expected.getNotifiers(),
expected.getVersion(),
expected.getCommandLineArguments(),
expected.getExecutorId(),
- expected.getWorkingDirectory(),
actual );
}
public void assertProjectEquals( String name,
- String scmUrl,
String emailAddress,
String version,
String commandLineArguments,
String builderId,
- String workingDirectory,
ContinuumProject actual )
{
assertProjectEquals( name,
- scmUrl,
createMailNotifierList( emailAddress ),
version,
commandLineArguments,
builderId,
- workingDirectory,
actual );
}
public void assertProjectEquals( String name,
- String scmUrl,
List notifiers,
String version,
String commandLineArguments,
String builderId,
- String workingDirectory,
ContinuumProject actual )
{
assertEquals( "project.name", name, actual.getName() );
- assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
+// assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
if ( notifiers != null )
{
@@ -394,7 +371,7 @@
assertEquals( "project.executorId", builderId, actual.getExecutorId() );
- assertEquals( "project.workingDirectory", workingDirectory, actual.getWorkingDirectory() );
+// assertEquals( "project.workingDirectory", workingDirectory, actual.getWorkingDirectory() );
}
// ----------------------------------------------------------------------
Modified: maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java Sun Jul 24 08:01:56 2005
@@ -44,7 +44,7 @@
//
// ----------------------------------------------------------------------
- MavenTwoProject project = makeStubMavenTwoProject( "My Project", "scm:foo" );
+ MavenTwoProject project = makeStubMavenTwoProject( "My Project" );
project = (MavenTwoProject) store.addProject( project );