Author: trygvis Date: Sun Jan 15 11:19:17 2006 New Revision: 369252 URL: http://svn.apache.org/viewcvs?rev=369252&view=rev Log: o Adding my OSWorkflow work. THIS IS NOT WORKING CODE just yet. Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java (with props) maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml (with props) Modified: maven/continuum/branches/osworkflow-integration/continuum-core/pom.xml maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml maven/continuum/branches/osworkflow-integration/continuum-core/src/test-projects/project2/pom.xml maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/log4j.properties maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml maven/continuum/branches/osworkflow-integration/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java maven/continuum/branches/osworkflow-integration/continuum-test/src/main/resources/META-INF/plexus/components.xml maven/continuum/branches/osworkflow-integration/pom.xml Modified: maven/continuum/branches/osworkflow-integration/continuum-core/pom.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/pom.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/pom.xml (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/pom.xml Sun Jan 15 11:19:17 2006 @@ -31,6 +31,11 @@ jpox + bsh + bsh + 1.3.0 + + postgresql postgresql 7.4 @@ -44,6 +49,10 @@ org.codehaus.plexus plexus-security-osuser + + + org.codehaus.plexus + plexus-osworkflow org.apache.maven.continuum Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Sun Jan 15 11:19:17 2006 @@ -19,14 +19,15 @@ import org.apache.maven.continuum.build.settings.SchedulesActivationException; import org.apache.maven.continuum.build.settings.SchedulesActivator; import org.apache.maven.continuum.buildqueue.BuildProjectTask; +import org.apache.maven.continuum.configuration.ConfigurationException; import org.apache.maven.continuum.configuration.ConfigurationLoadingException; import org.apache.maven.continuum.configuration.ConfigurationService; -import org.apache.maven.continuum.configuration.ConfigurationException; import org.apache.maven.continuum.configuration.ConfigurationStoringException; import org.apache.maven.continuum.core.action.AbstractContinuumAction; import org.apache.maven.continuum.core.action.AddProjectToCheckOutQueueAction; import org.apache.maven.continuum.core.action.CreateProjectsFromMetadata; import org.apache.maven.continuum.core.action.StoreProjectAction; +import org.apache.maven.continuum.core.workflow.ContinuumWorkflowEngine; import org.apache.maven.continuum.initialization.ContinuumInitializationException; import org.apache.maven.continuum.initialization.ContinuumInitializer; import org.apache.maven.continuum.initialization.DefaultContinuumInitializer; @@ -115,9 +116,10 @@ */ private ContinuumSecurity security; - // ---------------------------------------------------------------------- - // Moved from core - // ---------------------------------------------------------------------- + /** + * @plexus.requirement + */ + private ContinuumWorkflowEngine workflowEngine; /** * @plexus.requirement @@ -579,7 +581,23 @@ public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl ) throws ContinuumException { - return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID ); + // old way +// return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID ); + + // new way - this should replace executeAddProjectsFromMetadataActivity() + // once it's fully working. + + String username = null; + + long workflowId = workflowEngine.addProjectsFromMetadata( username, MavenTwoContinuumProjectBuilder.ID, + metadataUrl, getWorkingDirectory(), false ); + + workflowEngine.waitForWorkflow( workflowId ); + + Map context = workflowEngine.getContext( workflowId ); + + return (ContinuumProjectBuildingResult) + context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT ); } // ---------------------------------------------------------------------- @@ -609,7 +627,7 @@ bd.setSchedule( schedule ); - project.addBuildDefinition( bd ); + project.addBuildDefinition( bd ); } catch ( ContinuumStoreException e ) { @@ -673,17 +691,11 @@ executeAction( "create-projects-from-metadata", context ); - ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context.get( - CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT ); + ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) + context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT ); - if ( result.getProjects() != null ) - { - getLogger().info( "Created " + result.getProjects().size() + " projects." ); - } - if ( result.getProjectGroups() != null ) - { - getLogger().info( "Created " + result.getProjectGroups().size() + " project groups." ); - } + getLogger().info( "Created " + result.getProjects().size() + " projects." ); + getLogger().info( "Created " + result.getProjectGroups().size() + " project groups." ); getLogger().info( result.getWarnings().size() + " warnings." ); // ---------------------------------------------------------------------- @@ -1018,7 +1030,7 @@ if ( buildDefinition.isDefaultForProject() && !bd.isDefaultForProject() ) { bd.setDefaultForProject( true ); - + BuildDefinition defaultBd = getDefaultBuildDefinition( projectId ); if ( defaultBd != null ) @@ -1778,7 +1790,7 @@ throw new InitializationException( "Database is corrupted.", e ); } } - + getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getExecutorId() ); } } @@ -2035,14 +2047,9 @@ private boolean convertBoolean( String value ) { - if ( "true".equalsIgnoreCase( value ) || "on".equalsIgnoreCase( value ) || "yes".equalsIgnoreCase( value ) ) - { - return true; - } - else - { - return false; - } + return "true".equalsIgnoreCase( value ) || + "on".equalsIgnoreCase( value ) || + "yes".equalsIgnoreCase( value ); } private void startMessage() Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java Sun Jan 15 11:19:17 2006 @@ -34,6 +34,8 @@ public void execute( Map context ) throws ContinuumException, ContinuumProjectBuilderManagerException, ContinuumProjectBuilderException { + System.err.println( context.keySet().toString().replace( ',', '\n' ) ); + String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID ); String u = getString( context, KEY_URL ); @@ -76,5 +78,7 @@ } context.put( KEY_PROJECT_BUILDING_RESULT, result ); + + System.err.println( "DONE BUILDING PROJECTS!" ); } } Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java Sun Jan 15 11:19:17 2006 @@ -0,0 +1,50 @@ +package org.apache.maven.continuum.core.workflow; + +/* + * Copyright 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 org.apache.maven.continuum.ContinuumException; + +import java.util.Map; +import java.util.List; + +import com.opensymphony.workflow.WorkflowException; + +/** + * @author Trygve Laugstøl + * @version $Id$ + */ +public interface ContinuumWorkflowEngine +{ + String ROLE = ContinuumWorkflowEngine.class.getName(); + + long addProjectsFromMetadata( String username, String builderId, String metadataUrl, String workingDirectory, + boolean userInteractive ) + throws ContinuumException; + + Map getContext( long workflowId ) + throws ContinuumException; + + void waitForWorkflow( long workflowId ) + throws ContinuumException; + + List getCurrentSteps( long workflowId ) + throws ContinuumException; + + void executeAction( long workflowId, int actionId, Map context ) + throws ContinuumException; +} Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngine.java ------------------------------------------------------------------------------ svn:keywords = Id Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java Sun Jan 15 11:19:17 2006 @@ -0,0 +1,36 @@ +package org.apache.maven.continuum.core.workflow; + +/* + * Copyright 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 Trygve Laugstøl + * @version $Id$ + */ +public class ContinuumWorkflowEngineException + extends Exception +{ + public ContinuumWorkflowEngineException( String message ) + { + super( message ); + } + + public ContinuumWorkflowEngineException( String message, Throwable cause ) + { + super( message, cause ); + } +} Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineException.java ------------------------------------------------------------------------------ svn:keywords = Id Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java Sun Jan 15 11:19:17 2006 @@ -0,0 +1,139 @@ +package org.apache.maven.continuum.core.workflow; + +/* + * Copyright 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 com.opensymphony.workflow.WorkflowException; +import org.apache.maven.continuum.ContinuumException; +import org.apache.maven.continuum.core.action.CreateProjectsFromMetadata; +import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.codehaus.plexus.osworkflow.PlexusOSWorkflow; +import org.codehaus.plexus.osworkflow.PropertySetMap; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; + +import java.util.HashMap; +import java.util.Map; +import java.util.List; + +/** + * @author Trygve Laugstøl + * @version $Id$ + */ +public class DefaultContinuumWorkflowEngine + extends AbstractLogEnabled + implements Initializable, ContinuumWorkflowEngine +{ + /** + * @plexus.requirement + */ + private PlexusOSWorkflow workflow; + + // ---------------------------------------------------------------------- + // Component Lifecycle + // ---------------------------------------------------------------------- + + public void initialize() + throws InitializationException + { + } + + // ---------------------------------------------------------------------- + // ContinuumWorkflowEngine Implementation + // ---------------------------------------------------------------------- + + public long addProjectsFromMetadata( String username, String builderId, String metadataUrl, String workingDirectory, + boolean userInteractive ) + throws ContinuumException + { + try + { + Map context = new HashMap(); + context.put( CreateProjectsFromMetadata.KEY_PROJECT_BUILDER_ID, builderId ); + context.put( CreateProjectsFromMetadata.KEY_URL, metadataUrl ); + context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, workingDirectory ); + + return workflow.startWorkflow( "add-projects-from-metadata", username, context ); + } + catch ( WorkflowException e ) + { + throw new ContinuumException( "Error while starting workflow.", e ); + } + } + + public Map getContext( long workflowId ) + throws ContinuumException + { + try + { + return new PropertySetMap( workflow.getContext( workflowId ) ); + } + catch ( WorkflowException e ) + { + throw new ContinuumException( "Error while getting the workflow context.", e ); + } + } + + public void waitForWorkflow( long workflowId ) + throws ContinuumException + { + try + { + while( !workflow.isWorkflowDone( workflowId ) ) + { + try + { + Thread.sleep( 100 ); + } + catch ( InterruptedException e ) + { + // continue + } + } + } + catch ( WorkflowException e ) + { + throw new ContinuumException( "Error while waiting for workflow to complete", e ); + } + } + + public List getCurrentSteps( long workflowId ) + throws ContinuumException + { + try + { + return workflow.getCurrentSteps( workflowId ); + } + catch ( WorkflowException e ) + { + throw new ContinuumException( "Error while getting the current steps for the workflow.", e ); + } + } + + public void executeAction( long workflowId, int actionId, Map context ) + throws ContinuumException + { + try + { + workflow.doAction( workflowId, actionId, context ); + } + catch ( WorkflowException e ) + { + throw new ContinuumException( "Error while calling action.", e ); + } + } +} Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/java/org/apache/maven/continuum/core/workflow/DefaultContinuumWorkflowEngine.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml Sun Jan 15 11:19:17 2006 @@ -17,6 +17,9 @@ org.apache.maven.continuum.security.ContinuumSecurity + org.apache.maven.continuum.core.workflow.ContinuumWorkflowEngine + + org.apache.maven.continuum.initialization.ContinuumInitializer @@ -61,6 +64,16 @@ org.apache.maven.continuum.store.ContinuumStore + + + + + + org.apache.maven.continuum.core.workflow.ContinuumWorkflowEngine + org.apache.maven.continuum.core.workflow.DefaultContinuumWorkflowEngine + + + org.codehaus.plexus.osworkflow.PlexusOSWorkflow Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml Sun Jan 15 11:19:17 2006 @@ -0,0 +1,22 @@ + + + + + + + Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/osworkflow.xml ------------------------------------------------------------------------------ svn:keywords = Id Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml Sun Jan 15 11:19:17 2006 @@ -0,0 +1,20 @@ + + + + + Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows.xml ------------------------------------------------------------------------------ svn:keywords = Id Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml Sun Jan 15 11:19:17 2006 @@ -0,0 +1,112 @@ + + + + Sun Jan 08 00:39:25 CET 2006 + OSWOrkflow Designer + + + com.opensymphony.workflow.util.LogRegister + true + + + + + + + + + + + + + + + + + + + + + org.codehaus.plexus.osworkflow.PlexusActionFunctionProvider + create-projects-from-metadata + + + + + + + 0; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/main/resources/workflows/add-projects-from-metadata.xml ------------------------------------------------------------------------------ svn:keywords = Id Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/test-projects/project2/pom.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test-projects/project2/pom.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test-projects/project2/pom.xml (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test-projects/project2/pom.xml Sun Jan 15 11:19:17 2006 @@ -9,4 +9,4 @@ scm:cvs:local:ignores:/cvs/root:project2 http://cvs.plexus.codehaus.org/plexus-components/native/continuum/src/test-projects/project2 - \ No newline at end of file + Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java Sun Jan 15 11:19:17 2006 @@ -127,6 +127,6 @@ continuum.updateProject( project ); - project = continuum.getProject( project.getId() ); + continuum.getProject( project.getId() ); } } Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java Sun Jan 15 11:19:17 2006 @@ -0,0 +1,49 @@ +package org.apache.maven.continuum.core.workflow; + +/* + * Copyright 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 org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder; +import org.codehaus.plexus.PlexusTestCase; + +import java.io.File; +import java.util.HashMap; + +/** + * @author Trygve Laugstøl + * @version $Id$ + */ +public class ContinuumWorkflowEngineTest + extends PlexusTestCase +{ + public void testAddMavenTwoProjectWithWarnings() + throws Exception + { + ContinuumWorkflowEngine workflowEngine = (ContinuumWorkflowEngine) lookup( ContinuumWorkflowEngine.ROLE ); + + File pom = getTestFile( "src/test/resources/projects/pom-with-warnings.xml" ); + + long workflowId = workflowEngine.addProjectsFromMetadata( null, MavenTwoContinuumProjectBuilder.ID, + pom.toURL().toExternalForm(), + getTestPath( "target/workingdirectory" ), true ); + + System.out.println( "workflowId = " + workflowId ); + // TODO: Assert projects, projectGroups and warnings lists from the context + + workflowEngine.executeAction( workflowId, 2, new HashMap() ); + } +} Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/java/org/apache/maven/continuum/core/workflow/ContinuumWorkflowEngineTest.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/log4j.properties URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/log4j.properties?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/log4j.properties (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/log4j.properties Sun Jan 15 11:19:17 2006 @@ -4,6 +4,7 @@ log4j.appender.root.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n # JPOX Categories +log4j.category=INFO, root #log4j.category.JPOX=WARN, root log4j.category.JPOX.RDBMS=ERROR, root #log4j.category.JPOX.RDBMS.Schema=WARN, root Modified: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml (original) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml Sun Jan 15 11:19:17 2006 @@ -1,27 +1,4 @@ - - org.codehaus.plexus.notification.RecipientSource - org.apache.maven.continuum.notification.ContinuumRecipientSource - - nobody@localhost - - - - - org.codehaus.plexus.osworkflow.WorkflowEngine - org.codehaus.plexus.osworkflow.DefaultWorkflowEngine - - ${basedir}/../continuum-plexus-application/src/conf/workflows - - - Added: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml?rev=369252&view=auto ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml (added) +++ maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml Sun Jan 15 11:19:17 2006 @@ -0,0 +1,23 @@ + + + + 4.0.0 + + my-artifact + 1.0 + Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/osworkflow-integration/continuum-core/src/test/resources/projects/pom-with-warnings.xml ------------------------------------------------------------------------------ svn:keywords = Id Modified: maven/continuum/branches/osworkflow-integration/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original) +++ maven/continuum/branches/osworkflow-integration/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Sun Jan 15 11:19:17 2006 @@ -171,12 +171,11 @@ if ( result != null && !result.isEmpty() ) { - getLogger().info( "nb result : " + result.size() ); for ( Iterator i = result.iterator(); i.hasNext(); ) { Object[] obj = (Object[]) i.next(); - projects.put( (Integer) obj[0], (Integer) obj[1] ); + projects.put( obj[0], obj[1] ); } return projects; @@ -439,7 +438,7 @@ { Object[] obj = (Object[]) i.next(); - builds.put( (Integer) obj[0], (Integer) obj[1] ); + builds.put( obj[0], obj[1] ); } return builds; @@ -1030,11 +1029,6 @@ private List getAllObjectsDetached( Class clazz ) { return getAllObjectsDetached( clazz, null ); - } - - private List getAllObjectsDetached( Class clazz, String fetchGroup ) - { - return getAllObjectsDetached( clazz, null, fetchGroup ); } private List getAllObjectsDetached( Class clazz, String ordering, String fetchGroup ) Modified: maven/continuum/branches/osworkflow-integration/continuum-test/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/continuum-test/src/main/resources/META-INF/plexus/components.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/continuum-test/src/main/resources/META-INF/plexus/components.xml (original) +++ maven/continuum/branches/osworkflow-integration/continuum-test/src/main/resources/META-INF/plexus/components.xml Sun Jan 15 11:19:17 2006 @@ -1,8 +1,68 @@ + org.codehaus.plexus.notification.RecipientSource + org.apache.maven.continuum.notification.ContinuumRecipientSource + + nobody@localhost + + + org.codehaus.plexus.jdo.JdoFactory - org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + org.codehaus.plexus.jdo.DefaultJdoFactory + + + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + org.jpox.autoCreateSchema + true + + + org.jpox.autoStartMechanism + SchemaTable + + + org.jpox.autoStartMechanismMode + Ignored + + + javax.jdo.option.ConnectionDriverName + org.hsqldb.jdbcDriver + + + javax.jdo.option.ConnectionURL + jdbc:hsqldb:${plexus.home}/database + + + javax.jdo.option.ConnectionUserName + sa + + + javax.jdo.option.ConnectionPassword + + + + org.jpox.transactionIsolation + READ_UNCOMMITTED + + + org.jpox.poid.transactionIsolation + READ_UNCOMMITTED + + + org.jpox.transactionIsolation + READ_UNCOMMITTED + + + org.jpox.poid.transactionIsolation + READ_UNCOMMITTED + + + Modified: maven/continuum/branches/osworkflow-integration/pom.xml URL: http://svn.apache.org/viewcvs/maven/continuum/branches/osworkflow-integration/pom.xml?rev=369252&r1=369251&r2=369252&view=diff ============================================================================== --- maven/continuum/branches/osworkflow-integration/pom.xml (original) +++ maven/continuum/branches/osworkflow-integration/pom.xml Sun Jan 15 11:19:17 2006 @@ -383,6 +383,16 @@ org.codehaus.plexus + plexus-security + 1.0-alpha-2 + + + org.codehaus.plexus + plexus-osworkflow + 1.0-alpha-1-SNAPSHOT + + + org.codehaus.plexus plexus-security-api 1.0-alpha-3-SNAPSHOT @@ -420,4 +430,4 @@ scp://repo1.maven.org/home/projects/maven/repository-staging/snapshots/maven2 - \ No newline at end of file +