Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Tue May 10 05:17:06 2005
@@ -86,8 +86,13 @@
// ContinuumProject
// ----------------------------------------------------------------------
- public String addProject( String name, String scmUrl, String nagEmailAddress, String
version, String builderId,
- String workingDirectory, Properties configuration )
+ public String addProject( String name,
+ String scmUrl,
+ String nagEmailAddress,
+ String version,
+ String executorId,
+ String workingDirectory,
+ Properties configuration )
throws ContinuumStoreException
{
ContinuumProject project = new ContinuumProject();
@@ -96,7 +101,7 @@
project.setScmUrl( scmUrl );
project.setNagEmailAddress( nagEmailAddress );
project.setVersion( version );
- project.setBuilderId( builderId );
+ project.setExecutorId( executorId );
project.setWorkingDirectory( workingDirectory );
project.setState( ContinuumProjectState.CHECKING_OUT );
project.setConfiguration( configuration );
@@ -122,6 +127,8 @@
{
store.begin();
+ getLogger().info( "Removing project with id '" + projectId + "'." );
+
// System.err.println( "**********************************" );
// System.err.println( "**********************************" );
// System.err.println( "**********************************" );
@@ -185,6 +192,8 @@
store.deleteContinuumProject( projectId );
store.commit();
+
+ getLogger().info( "Removed project with id '" + projectId + "'." );
}
catch ( Exception e )
{
@@ -441,16 +450,16 @@
build.setUpdateScmResult( scmResult );
- store.commit();
-
- // ----------------------------------------------------------------------
- // This double commit seems to be needed for some reason. Not having it
- // seems to result in some foreign key constraint violation.
- // ----------------------------------------------------------------------
-
- store.begin();
-
- build = store.getContinuumBuild( buildId, false );
+// store.commit();
+//
+// // ----------------------------------------------------------------------
+// // This double commit seems to be needed for some reason. Not having it
+// // seems to result in some foreign key constraint violation.
+// // ----------------------------------------------------------------------
+//
+// store.begin();
+//
+// build = store.getContinuumBuild( buildId, false );
build.setBuildResult( result );
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=169455&r1=169454&r2=169455&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
Tue May 10 05:17:06 2005
@@ -8,6 +8,9 @@
<role>org.apache.maven.continuum.builder.manager.BuilderManager</role>
</requirement>
<requirement>
+ <role>org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager</role>
+ </requirement>
+ <requirement>
<role>org.codehaus.plexus.taskqueue.TaskQueue</role>
<role-hint>build-project</role-hint>
<field-name>buildQueue</field-name>
@@ -42,6 +45,17 @@
</component>
<component>
+ <role>org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager</role>
+ <implementation>org.apache.maven.continuum.project.builder.manager.DefaultContinuumProjectBuilderManager</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.project.builder.ContinuumProjectBuilder</role>
+ <field-name>projectBuilders</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
<role>org.apache.maven.continuum.buildcontroller.BuildController</role>
<implementation>org.apache.maven.continuum.buildcontroller.DefaultBuildController</implementation>
<requirements>
@@ -57,6 +71,9 @@
<requirement>
<role>org.apache.maven.continuum.scm.ContinuumScm</role>
</requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.Continuum</role>
+ </requirement>
</requirements>
</component>
@@ -217,10 +234,18 @@
<requirement>
<role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
</requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.maven.m1.MavenOneMetadataHelper</role>
+ </requirement>
</requirements>
</component>
<component>
+ <role>org.apache.maven.continuum.builder.maven.m1.MavenOneMetadataHelper</role>
+ <implementation>org.apache.maven.continuum.builder.maven.m1.DefaultMavenOneMetadataHelper</implementation>
+ </component>
+
+ <component>
<role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
<implementation>org.apache.maven.continuum.builder.shell.DefaultShellCommandHelper</implementation>
</component>
@@ -243,6 +268,34 @@
<requirements>
<requirement>
<role>org.apache.maven.continuum.builder.shell.ShellCommandHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!--
+ |
+ | Project Builders
+ |
+ |-->
+
+ <component>
+ <role>org.apache.maven.continuum.project.builder.ContinuumProjectBuilder</role>
+ <role-hint>maven-one-builder</role-hint>
+ <implementation>org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.maven.m1.MavenOneMetadataHelper</role>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.project.builder.ContinuumProjectBuilder</role>
+ <role-hint>maven-two-builder</role-hint>
+ <implementation>org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.builder.maven.m2.MavenBuilderHelper</role>
</requirement>
</requirements>
</component>
Added: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/DefaultBuilderManagerTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/DefaultBuilderManagerTest.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/DefaultBuilderManagerTest.java
(added)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/DefaultBuilderManagerTest.java
Tue May 10 05:17:06 2005
@@ -0,0 +1,33 @@
+package org.apache.maven.continuum.builder.manager;
+
+/*
+ * 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.codehaus.plexus.PlexusTestCase;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id:$
+ */
+public class DefaultBuilderManagerTest
+ extends PlexusTestCase
+{
+ public void testBasic()
+ throws Exception
+ {
+ lookup( BuilderManager.ROLE );
+ }
+}
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/Maven1BuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/Maven1BuilderTest.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/Maven1BuilderTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/Maven1BuilderTest.java
Tue May 10 05:17:06 2005
@@ -32,40 +32,12 @@
public class Maven1BuilderTest
extends PlexusTestCase
{
- public void testBuildingAProjectFromMetadataWithACompleteMaven1Pom()
- throws Exception
- {
- BuilderManager builderManager = (BuilderManager) lookup( BuilderManager.ROLE );
-
- Maven1Builder builder = (Maven1Builder) builderManager.getBuilder( "maven-1" );
-
- ContinuumProject project = builder.createProjectFromMetadata( getTestFile( "src/test/resources/projects/maven-1.pom.xml"
).toURL() );
-
- assertNotNull( project );
-
- assertEquals( "Maven", project.getName() );
-
- assertEquals( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/",
project.getScmUrl() );
-
- assertEquals( "dev@maven.apache.org", project.getNagEmailAddress() );
-
- assertEquals( "1.1-SNAPSHOT", project.getVersion() );
-
- Properties configuration = project.getConfiguration();
-
- assertNotNull( configuration );
-
- assertEquals( 1, configuration.size() );
-
- assertEquals( "clean:clean, jar:install", configuration.getProperty( Maven1Builder.CONFIGURATION_GOALS
) );
- }
-
public void testUpdatingAProjectFromScmWithAExistingProjectAndAEmptyMaven1Pom()
throws Exception
{
BuilderManager builderManager = (BuilderManager) lookup( BuilderManager.ROLE );
- Maven1Builder builder = (Maven1Builder) builderManager.getBuilder( "maven-1" );
+ Maven1Builder builder = (Maven1Builder) builderManager.getBuilder( Maven1Builder.ID
);
// ----------------------------------------------------------------------
// Make a checkout
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=169455&r1=169454&r2=169455&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
Tue May 10 05:17:06 2005
@@ -23,10 +23,12 @@
import java.util.Set;
import org.apache.maven.continuum.builder.shell.ShellBuildResult;
+import org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder;
import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
import org.apache.maven.continuum.project.ContinuumBuild;
import org.apache.maven.continuum.project.ContinuumProjectState;
import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.mailsender.MailMessage;
@@ -68,7 +70,7 @@
project.setName( "Test Project" );
- project.setBuilderId( "maven2" );
+ project.setExecutorId( MavenShellBuilder.ID );
context.put( ContinuumNotificationDispatcher.CONTEXT_PROJECT, project );
Added: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
(added)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
Tue May 10 05:17:06 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.continuum.project.builder.maven;
+
+/*
+ * 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 java.util.Properties;
+
+import org.apache.maven.continuum.builder.maven.m1.Maven1Builder;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+
+import org.codehaus.plexus.PlexusTestCase;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: Maven1BuilderTest.java,v 1.3 2005/04/06 13:57:20 trygvis Exp $
+ */
+public class MavenOneContinuumProjectBuilderTest
+ extends PlexusTestCase
+{
+ public void testBuildingAProjectFromMetadataWithACompleteMaven1Pom()
+ throws Exception
+ {
+ ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
MavenOneContinuumProjectBuilder.ID );
+
+ ContinuumProjectBuildingResult result = projectBuilder.createProjectsFromMetadata(
getTestFile( "src/test/resources/projects/maven-1.pom.xml" ).toURL() );
+
+ assertNotNull( result.getProjects() );
+
+ assertEquals( 1, result.getProjects().size() );
+
+ ContinuumProject project = ( ContinuumProject ) result.getProjects().get( 0 );
+
+ assertNotNull( project );
+
+ assertEquals( "Maven", project.getName() );
+
+ assertEquals( "scm:svn:http://svn.apache.org/repos/asf:maven/maven-1/core/trunk/",
project.getScmUrl() );
+
+ assertEquals( "dev@maven.apache.org", project.getNagEmailAddress() );
+
+ assertEquals( "1.1-SNAPSHOT", project.getVersion() );
+
+ Properties configuration = project.getConfiguration();
+
+ assertNotNull( configuration );
+
+ assertEquals( 1, configuration.size() );
+
+ assertEquals( "clean:clean, jar:install", configuration.getProperty( Maven1Builder.CONFIGURATION_GOALS
) );
+ }
+}
Added: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(added)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Tue May 10 05:17:06 2005
@@ -0,0 +1,69 @@
+package org.apache.maven.continuum.project.builder.maven;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.maven.continuum.project.MavenTwoProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+
+import org.codehaus.plexus.PlexusTestCase;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id: MavenBuilderHelperTest.java,v 1.1.1.1 2005/03/29 20:42:04 trygvis Exp $
+ */
+public class MavenTwoContinuumProjectBuilderTest
+ extends PlexusTestCase
+{
+ public void testGetNagEmailAddressWhenTypeIsSetToEmail()
+ throws Exception
+ {
+ ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
MavenTwoContinuumProjectBuilder.ID );
+
+ File pom = getTestFile( "src/test/repository/maven-builder-helper-1.xml" );
+
+ ContinuumProjectBuildingResult result = projectBuilder.createProjectsFromMetadata(
pom.toURL() );
+
+ assertNotNull( result.getProjects() );
+
+ assertEquals( 1, result.getProjects().size() );
+
+ MavenTwoProject project = ( MavenTwoProject ) result.getProjects().get( 0 );
+
+ assertEquals( "foo@bar", project.getNagEmailAddress() );
+ }
+
+ public void testGetNagEmailAddressWhenTypeIsntSet()
+ throws Exception
+ {
+ ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
MavenTwoContinuumProjectBuilder.ID );
+
+ File pom = getTestFile( "src/test/repository/maven-builder-helper-2.xml" );
+
+ ContinuumProjectBuildingResult result = projectBuilder.createProjectsFromMetadata(
pom.toURL() );
+
+ assertNotNull( result.getProjects() );
+
+ assertEquals( 1, result.getProjects().size() );
+
+ MavenTwoProject project = (MavenTwoProject) result.getProjects().get( 0 );
+
+ assertEquals( "foo@bar", project.getNagEmailAddress() );
+ }
+}
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Tue May 10 05:17:06 2005
@@ -672,7 +672,7 @@
assertEquals( "project.version", version, project.getVersion() );
- assertEquals( "project.builderId", builderId, project.getBuilderId() );
+ assertEquals( "project.executorId", builderId, project.getExecutorId() );
assertEquals( "project.workingDirectory", workingDirectory, project.getWorkingDirectory()
);
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=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Tue May 10 05:17:06
2005
@@ -61,7 +61,7 @@
-->
</field>
<field>
- <name>builderId</name>
+ <name>executorId</name>
<version>1.0.0</version>
<type>String</type>
</field>
Modified: maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml Tue May 10
05:17:06 2005
@@ -168,19 +168,6 @@
</component>
<component>
- <role>org.apache.maven.continuum.store.ContinuumStore</role>
- <implementation>org.apache.maven.continuum.store.ModelloJPoxContinuumStore</implementation>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.jdo.JdoFactory</role>
- </requirement>
- <requirement>
- <role>org.apache.maven.continuum.project.state.ContinuumProjectStateGuard</role>
- </requirement>
- </requirements>
- </component>
-
- <component>
<role>org.codehaus.plexus.jdo.JdoFactory</role>
<implementation>org.codehaus.plexus.jdo.DefaultJdoFactory</implementation>
<configuration>
Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
Tue May 10 05:17:06 2005
@@ -16,10 +16,10 @@
* limitations under the License.
*/
-import java.net.URL;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -27,12 +27,12 @@
import org.apache.maven.continuum.Continuum;
import org.apache.maven.continuum.builder.ant.AntBuilder;
-import org.apache.maven.continuum.builder.maven.m1.Maven1Builder;
-import org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder;
import org.apache.maven.continuum.builder.shell.ShellBuilder;
import org.apache.maven.continuum.project.ContinuumBuild;
import org.apache.maven.continuum.project.ContinuumBuildResult;
import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
import org.apache.maven.continuum.scm.CheckOutScmResult;
import org.apache.maven.continuum.scm.UpdateScmResult;
import org.apache.maven.continuum.utils.ContinuumUtils;
@@ -54,20 +54,20 @@
private XmlRpcHelper xmlRpcHelper;
// ----------------------------------------------------------------------
- // Maven 2.x projects
+ // Maven 1.x projects
// ----------------------------------------------------------------------
- public Hashtable addMavenTwoProject( String url )
+ public Hashtable addMavenOneProject( String url )
{
try
{
- String projectId = continuum.addProjectFromUrl( url, MavenShellBuilder.ID );
+ List projectIds = continuum.addProjectsFromUrl( url, MavenOneContinuumProjectBuilder.ID
);
- return makeHashtable( "projectId", projectId );
+ return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds,
false ) );
}
catch ( Throwable e )
{
- return handleException( "ContinuumXmlRpc.addProjectFromScm(): url: '" + url +
"'.", e );
+ return handleException( "ContinuumXmlRpc.addMavenOneProject(): url: '" + url
+ "'.", e );
}
}
@@ -75,17 +75,17 @@
// Maven 2.x projects
// ----------------------------------------------------------------------
- public Hashtable addMavenOneProject( String url )
+ public Hashtable addMavenTwoProject( String url )
{
try
{
- String projectId = continuum.addProjectFromUrl( url, Maven1Builder.ID );
+ List projectIds = continuum.addProjectsFromUrl( url, MavenTwoContinuumProjectBuilder.ID
);
- return makeHashtable( "projectId", projectId );
+ return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds,
false ) );
}
catch ( Throwable e )
{
- return handleException( "ContinuumXmlRpc.addProjectFromScm(): url: '" + url +
"'.", e );
+ return handleException( "ContinuumXmlRpc.addMavenTwoProject(): url: '" + url
+ "'.", e );
}
}
@@ -119,26 +119,12 @@
// Projects
// ----------------------------------------------------------------------
- protected Hashtable addProjectFromUrl( String url, String builderType )
- {
- try
- {
- String projectId = continuum.addProjectFromUrl( new URL( url ), builderType );
-
- return makeHashtable( "projectId", projectId );
- }
- catch ( Throwable e )
- {
- return handleException( "ContinuumXmlRpc.addProjectFromScm(): url: '" + url +
"'.", e );
- }
- }
-
- protected Hashtable addProjectFromScm( String scmUrl,
- String builderType,
- String projectName,
- String nagEmailAddress,
- String version,
- Hashtable configuration )
+ private Hashtable addProjectFromScm( String scmUrl,
+ String executorId,
+ String projectName,
+ String nagEmailAddress,
+ String version,
+ Hashtable configuration )
{
try
{
@@ -152,7 +138,7 @@
}
String projectId = continuum.addProjectFromScm( scmUrl,
- builderType,
+ executorId,
projectName,
nagEmailAddress,
version,
Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java
Tue May 10 05:17:06 2005
@@ -140,7 +140,7 @@
}
else if ( value instanceof Collection )
{
- value = collectionToVector( (Collection) value );
+ value = collectionToVector( (Collection) value, true );
}
else
{
@@ -157,7 +157,7 @@
return hashtable;
}
- private Vector collectionToVector( Collection value )
+ public Vector collectionToVector( Collection value, boolean convertElements )
throws IllegalAccessException, InvocationTargetException
{
if ( value instanceof Vector )
@@ -171,7 +171,14 @@
{
Object object = it.next();
- vector.add( objectToHashtable( object ) );
+ if ( convertElements )
+ {
+ vector.add( objectToHashtable( object ) );
+ }
+ else
+ {
+ vector.add( object );
+ }
}
return vector;
Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/XmlRpcHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/XmlRpcHelper.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/XmlRpcHelper.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/XmlRpcHelper.java
Tue May 10 05:17:06 2005
@@ -19,6 +19,8 @@
import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
import java.util.Set;
+import java.util.Vector;
+import java.util.Collection;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -32,5 +34,8 @@
throws IllegalAccessException, InvocationTargetException;
Hashtable objectToHashtable( Object object, Set excludedProperties )
+ throws IllegalAccessException, InvocationTargetException;
+
+ Vector collectionToVector( Collection value, boolean convertElements )
throws IllegalAccessException, InvocationTargetException;
}
|