maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r482671 [3/4] - in /maven/scm/trunk: maven-scm-client/ maven-scm-plugin/ maven-scm-providers/ maven-scm-providers/maven-scm-provider-synergy/ maven-scm-providers/maven-scm-provider-synergy/src/ maven-scm-providers/maven-scm-provider-synergy...
Date Tue, 05 Dec 2006 14:24:51 GMT
Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,787 @@
+package org.apache.maven.scm.provider.synergy.util;
+
+/*
+ * Copyright 2001-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.scm.ScmException;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyCreateTaskConsumer;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyGetCompletedTasksConsumer;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyGetTaskObjectsConsumer;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyGetWorkingFilesConsumer;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyGetWorkingProjectConsumer;
+import org.apache.maven.scm.provider.synergy.consumer.SynergyWorkareaConsumer;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * This class contains functional methodsfor Synergy.
+ * 
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyUtil
+{
+
+    /**
+     * Separator used with formatted result
+     */
+    public static final String SEPARATOR = "#####";
+
+    /**
+     * Remove prefix path from a path. Example: removeParent("c:\tmp",
+     * "c:\tmp\foo.bar") returns "foo.bar"
+     * 
+     * @param parent
+     *            parent path (prefix).
+     * @param file
+     *            file path.
+     * @return suffix
+     * @throws ScmException
+     *             if parent is not a prefix of file
+     */
+    public static String removePrefix( File prefix, File file ) throws ScmException
+    {
+        try
+        {
+            String prefixStr = prefix.getCanonicalPath();
+            String fileStr = file.getCanonicalPath();
+            if ( !fileStr.startsWith( prefixStr ) )
+            {
+                throw new ScmException( prefixStr + " is not a prefix of " + fileStr );
+            }
+            return fileStr.substring( prefixStr.length() );
+        }
+        catch ( IOException e )
+        {
+            throw new ScmException( "IOException", e );
+        }
+
+    }
+
+    /**
+     * Get a working project whose predecessor is given.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            predecessor (prep project)
+     * @param username
+     *            owner of working project
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @return project_spec of the working checkout, or null if none
+     */
+    public static String getWorkingProject( ScmLogger logger, String project_spec, String username, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering getWorkingProject method" );
+
+        String query = "owner='" + username + "' and status='working' and type='project' and has_predecessor('"
+                + project_spec + ":project:1')";
+
+        Commandline cl = SynergyCCM.query( query, "%displayname", ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyGetWorkingProjectConsumer stdout = new SynergyGetWorkingProjectConsumer( logger );
+
+        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );
+
+        logger.debug( "Synergy : getWorkingProject returns " + stdout.getProjectSpec() + " with code " + errorCode );
+
+        return stdout.getProjectSpec();
+    }
+
+    /**
+     * Get working file(s) in a given project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            (project)
+     * @param release
+     *            release
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @return list of working files.
+     */
+    public static List getWorkingFiles( ScmLogger logger, String project_spec, String release, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering getWorkingFiles method" );
+
+        String query = "status='working' and release='" + release + "' and is_member_of('" + project_spec + "')";
+
+        Commandline cl = SynergyCCM.query( query, SynergyGetWorkingFilesConsumer.OUTPUT_FORMAT, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyGetWorkingFilesConsumer stdout = new SynergyGetWorkingFilesConsumer( logger );
+
+        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );
+
+        logger
+                .debug( "Synergy : getWorkingFiles returns " + stdout.getFiles().size() + " files with code "
+                        + errorCode );
+
+        return stdout.getFiles();
+    }
+
+    /**
+     * Populate the object list of a Modification by querying for objects
+     * associated with the task.
+     * 
+     * @param logger
+     *            a logger.
+     * @param numTask
+     *            task number.
+     * @param ccmAddr
+     *            Synergy session ID.
+     */
+    public static List getModifiedObjects( ScmLogger logger, int numTask, String ccmAddr ) throws ScmException
+    {
+
+        logger.debug( "Synergy : Entering getModifiedObjects method" );
+
+        Commandline cl = SynergyCCM.showTaskObjects( numTask, SynergyGetTaskObjectsConsumer.OUTPUT_FORMAT, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyGetTaskObjectsConsumer stdout = new SynergyGetTaskObjectsConsumer( logger );
+        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );
+
+        logger.debug( "Synergy : getModifiedObjects returns " + stdout.getFiles().size() + " files with code "
+                + errorCode );
+
+        return stdout.getFiles();
+
+    }
+
+    /**
+     * Get a list of all tasks which are contained in all folders in the
+     * reconfigure properties of the specified project and were completed after
+     * startDate and before endDate.
+     * 
+     * @param logger
+     *            a logger.
+     * @param projectSpec
+     *            project_spec.
+     * @param startDate
+     *            start date.
+     * @param endDate
+     *            end date.
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @return A list of <code>Task</code>
+     */
+    public static List getCompletedTasks( ScmLogger logger, String projectSpec, Date startDate, Date endDate,
+            String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering getCompletedTasks method" );
+
+        // The format used for converting Java dates into CM Synergy dates
+        // Note that the format used to submit commands differs from the
+        // format used in the results of that command!?!
+        SimpleDateFormat toCcmDate = new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss", new Locale( "en", "US" ) );
+
+        // Construct the query string
+        String query = "is_task_in_folder_of(is_folder_in_rp_of('" + projectSpec + ":project:1" + "'))";
+        if ( startDate != null )
+        {
+            query = query + "and completion_date>time('" + toCcmDate.format( startDate ) + "')";
+        }
+        if ( endDate != null )
+        {
+            query = query + "and completion_date<time('" + toCcmDate.format( endDate ) + "')";
+        }
+
+        Commandline cl = SynergyCCM.query( query, SynergyGetCompletedTasksConsumer.OUTPUT_FORMAT, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyGetCompletedTasksConsumer stdout = new SynergyGetCompletedTasksConsumer( logger );
+
+        executeSynergyCommand( logger, cl, stderr, stdout, false );
+
+        logger.debug( "Synergy : getCompletedTasks method returns " + stdout.getTasks().size() + " tasks" );
+
+        return stdout.getTasks();
+    }
+
+    /**
+     * Create a baseline.
+     * 
+     * @param logger
+     *            a logger.
+     * @param projectSpec
+     *            the project_spec.
+     * @param name
+     *            name of the baseline.
+     * @param release
+     *            the release.
+     * @param purpose
+     *            the purpose.
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void createBaseline( ScmLogger logger, String projectSpec, String name, String release,
+            String purpose, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering createBaseline method" );
+
+        Commandline cl = SynergyCCM.createBaseline( projectSpec, name, release, purpose, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Add new file to Synergy database.
+     * 
+     * @param logger
+     *            a logger.
+     * @param file
+     *            file to be added.
+     * @param message
+     *            log message for Synergy.
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void create( ScmLogger logger, File file, String message, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering create method" );
+
+        List files = new ArrayList();
+        files.add( file );
+        Commandline cl = SynergyCCM.create( files, message, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Create new task.
+     * 
+     * @param logger
+     *            a logger.
+     * @param synopsis
+     *            short description of task.
+     * @param release
+     *            release.
+     * @param defaultTask
+     *            should this task become the default task?
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @return Task number
+     * @throws ScmException
+     */
+    public static int createTask( ScmLogger logger, String synopsis, String release, boolean defaultTask, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering createTask method" );
+
+        if ( synopsis == null || synopsis.equals( "" ) )
+        {
+            throw new ScmException( "A synopsis must be specified to create a task." );
+        }
+
+        Commandline cl = SynergyCCM.createTask( synopsis, release, defaultTask, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyCreateTaskConsumer stdout = new SynergyCreateTaskConsumer( logger );
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+        logger.debug( "createTask returns " + stdout.getTask() );
+
+        return stdout.getTask();
+    }
+
+    /**
+     * Checkin the default task.
+     * 
+     * @param logger
+     *            a logger.
+     * @param comment
+     *            a comment.
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @throws ScmException
+     */
+    public static void checkinDefaultTask( ScmLogger logger, String comment, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkinDefaultTask method" );
+
+        Commandline cl = SynergyCCM.checkinTask( "default", comment, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Checkin a task.
+     * 
+     * @param logger
+     *            a logger.
+     * @param taskNumber
+     *            task number.
+     * @param comment
+     *            a comment.
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @throws ScmException
+     */
+    public static void checkinTask( ScmLogger logger, int taskNumber, String comment, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkinTask method" );
+
+        Commandline cl = SynergyCCM.checkinTask( "" + taskNumber, comment, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Delete file from Synergy database.
+     * 
+     * @param logger
+     *            a logger.
+     * @param file
+     *            file to be deleted.
+     * @param message
+     *            log message for Synergy.
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void delete( ScmLogger logger, File file, String ccmAddr, boolean replace ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering delete method" );
+
+        List list = new ArrayList();
+        list.add( file );
+
+        Commandline cl = SynergyCCM.delete( list, ccmAddr, replace );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Reconfigure a project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void reconfigure( ScmLogger logger, String project_spec, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering reconfigure method" );
+        Commandline cl = SynergyCCM.reconfigure( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Reconfigure properties of a project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void reconfigureProperties( ScmLogger logger, String project_spec, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering reconfigureProperties method" );
+        Commandline cl = SynergyCCM.reconfigureProperties( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Reconcile a project with -uwa option.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void reconcileUwa( ScmLogger logger, String project_spec, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering reconcileUwa method" );
+        Commandline cl = SynergyCCM.reconcileUwa( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Reconcile a project with -udb option.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void reconcileUdb( ScmLogger logger, String project_spec, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering reconcileUdb method" );
+        Commandline cl = SynergyCCM.reconcileUdb( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Checkout given files or directory.
+     * 
+     * @param logger
+     *            a logger.
+     * @param files
+     *            files to add.
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @throws ScmException
+     */
+    public static void checkoutFiles( ScmLogger logger, List files, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkoutFiles files method" );
+
+        Commandline cl = SynergyCCM.checkoutFiles( files, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Checkout a given project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param directory
+     *            new project work area, or null if you want to use default wa.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @return checkout directory (directory + new project spec)
+     * @throws ScmException
+     */
+    public static void checkoutProject( ScmLogger logger, File directory, String project_spec, String version,
+            String purpose, String release, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkoutProject project method" );
+
+        Commandline cl = SynergyCCM.checkoutProject( directory, project_spec, version, purpose, release, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+    }
+
+    /**
+     * Checkin a given project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param comment
+     *            message.
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @return checkout directory (directory + new project spec)
+     * @throws ScmException
+     */
+    public static void checkinProject( ScmLogger logger, String project_spec, String comment, String ccmAddr )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkinProject project method" );
+
+        Commandline cl = SynergyCCM.checkinProject( project_spec, comment, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+    }
+
+    /**
+     * Checkin a file set.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @return checkout directory (directory + new project spec)
+     * @throws ScmException
+     */
+    public static void checkinFiles( ScmLogger logger, List files, String comment, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering checkinFiles project method" );
+
+        Commandline cl = SynergyCCM.checkinFiles( files, comment, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+    }
+
+    /**
+     * Synchronize a given project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void synchronize( ScmLogger logger, String project_spec, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering synchronize method" );
+
+        Commandline cl = SynergyCCM.synchronize( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Get the work area of a given project.
+     * 
+     * @param logger
+     *            a logger.
+     * @param project_spec
+     *            project_spec (i.e. myProject~1).
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static File getWorkArea( ScmLogger logger, String project_spec, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering getWorkArea method" );
+
+        Commandline cl = SynergyCCM.showWorkArea( project_spec, ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        SynergyWorkareaConsumer stdout = new SynergyWorkareaConsumer( logger );
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+        logger.debug( "Synergy : getWorkArea returns " + stdout.getWorkAreaPath() );
+
+        return stdout.getWorkAreaPath();
+    }
+
+    /**
+     * Stop a ccm session.
+     * 
+     * @param logger
+     *            a logger.
+     * @param ccmAddr
+     *            used to run in multi-session.
+     * @throws ScmException
+     */
+    public static void stop( ScmLogger logger, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering stop method" );
+        Commandline cl = SynergyCCM.stop( ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+    }
+
+    /**
+     * Start a session Synergy
+     * 
+     * @param logger
+     *            a logger.
+     * @param username
+     *            username.
+     * @param password
+     *            password.
+     * @param role
+     *            role or null if none.
+     * @return ccmAddr value to use with this session.
+     */
+    public static String start( ScmLogger logger, String username, String password, SynergyRole role )
+            throws ScmException
+    {
+        logger.debug( "Synergy : Entering start method" );
+
+        if ( username == null )
+        {
+            throw new ScmException( "username can't be null" );
+        }
+
+        if ( password == null )
+        {
+            throw new ScmException( "password can't be null" );
+        }
+
+        Commandline cl = SynergyCCM.start( username, password, role );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+        return stdout.getOutput();
+    }
+
+    /**
+     * Get Database delimiter
+     * 
+     * @param logger
+     *            a logger.
+     * @param ccmAddr
+     *            Synergy session ID.
+     * @return delimiter of the database (i.e. ~).
+     */
+    public static String delimiter( ScmLogger logger, String ccmAddr ) throws ScmException
+    {
+        logger.debug( "Synergy : Entering delimiter method" );
+
+        Commandline cl = SynergyCCM.delimiter( ccmAddr );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
+
+        executeSynergyCommand( logger, cl, stderr, stdout, true );
+
+        return stdout.getOutput();
+    }
+
+    /**
+     * Execute a command line for Synergy.
+     * 
+     * @param logger
+     *            a logger.
+     * @param cl
+     *            command line.
+     * @param stderr
+     *            stderr.
+     * @param stdout
+     *            stdout.
+     * @param failOnError
+     *            should we raise an exception when exit code != 0
+     * @return exit code.
+     * @throws ScmException
+     *             on error or if exit code != 0 and failOnError = true
+     */
+    protected static int executeSynergyCommand( ScmLogger logger, Commandline cl, StringStreamConsumer stderr,
+            StreamConsumer stdout, boolean failOnError ) throws ScmException
+    {
+        int exitCode;
+
+        try
+        {
+            logger.debug( "Executing: " + cl.toString() );
+            exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr );
+        }
+        catch ( CommandLineException ex )
+        {
+            throw new ScmException( "Error while executing synergy command [" + cl.toString() + "].", ex );
+        }
+
+        logger.debug( "Exit code :" + exitCode );
+        if ( stdout instanceof StringStreamConsumer )
+        {
+            logger.debug( "STDOUT :" + ( ( StringStreamConsumer ) stdout ).getOutput() );
+        }
+        else
+        {
+            logger.debug( "STDOUT : unavailable" );
+        }
+        logger.debug( "STDERR :" + stderr.getOutput() );
+
+        if ( exitCode != 0 && failOnError )
+        {
+            if ( stdout instanceof StringStreamConsumer )
+            {
+                throw new ScmException( "Commandeline = " + cl.toString() + "\nSTDOUT = "
+                        + ( ( StringStreamConsumer ) stdout ).getOutput() + "\nSTDERR = " + stderr.getOutput() + "\n" );
+            }
+            else
+            {
+                throw new ScmException( "Commandeline = " + cl.toString() + "\nSTDOUT = unavailable" + "\nSTDERR = "
+                        + stderr.getOutput() + "\n" );
+            }
+        }
+
+        return exitCode;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml Tue Dec  5 06:24:45 2006
@@ -0,0 +1,9 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.scm.provider.ScmProvider</role>
+      <role-hint>synergy</role-hint>
+      <implementation>org.apache.maven.scm.provider.synergy.SynergyScmProvider</implementation>
+    </component>
+  </components>
+</component-set>

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,52 @@
+package org.apache.maven.scm.provider.synergy.consumer;
+
+/*
+ * Copyright 2001-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.scm.ScmTestCase;
+import org.apache.maven.scm.log.DefaultLog;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyCreateTaskConsumerTest extends ScmTestCase
+{
+    public void testSynergyGetTaskObjectsConsumer() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/createTask.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        SynergyCreateTaskConsumer consumer = new SynergyCreateTaskConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        assertEquals( 70, consumer.getTask() );
+
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,111 @@
+package org.apache.maven.scm.provider.synergy.consumer;
+
+/*
+ * Copyright 2001-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.scm.ScmTestCase;
+import org.apache.maven.scm.log.DefaultLog;
+import org.apache.maven.scm.provider.synergy.util.SynergyTask;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyGetCompletedTasksConsumerTest extends ScmTestCase
+{
+    public void testSynergyGetCompletedTasksConsumer() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/getCompletedTasks.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        SynergyGetCompletedTasksConsumer consumer = new SynergyGetCompletedTasksConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        Collection entries = consumer.getTasks();
+
+        assertEquals( "Wrong number of tasks returned", 1, entries.size() );
+
+        SynergyTask task = ( SynergyTask ) entries.iterator().next();
+        assertEquals( 35, task.getNumber() );
+        assertEquals( "AHD456", task.getUsername() );
+        assertEquals( "gefdeag", task.getComment() );
+        Calendar cal = Calendar.getInstance();
+        cal.clear();
+        cal.set( 2006, Calendar.OCTOBER, 4, 15, 42, 47 );
+
+        assertEquals( cal.getTime(), task.getModifiedTime() );
+
+    }
+
+    public void testSynergyGetCompletedTasksConsumerWithFrenchDate() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/getCompletedTasksFrenchDate.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        System.setProperty( "maven.scm.synergy.ccmDateFormat", "EEEE dd MMMM yyyy HH:mm:ss" );
+        System.setProperty( "maven.scm.synergy.language", "fr" );
+        System.setProperty( "maven.scm.synergy.country", "FR" );
+        SynergyGetCompletedTasksConsumer consumer = new SynergyGetCompletedTasksConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        Collection entries = consumer.getTasks();
+
+        assertEquals( "Wrong number of tasks returned", 2, entries.size() );
+
+        Iterator i = entries.iterator();
+        SynergyTask task = ( SynergyTask ) i.next();
+        assertEquals( 52, task.getNumber() );
+        assertEquals( "ccm_root", task.getUsername() );
+        assertEquals( "Modification du pom (url scm)", task.getComment() );
+        Calendar cal = Calendar.getInstance();
+        cal.clear();
+        cal.set( 2006, Calendar.OCTOBER, 6, 10, 3, 59 );
+        assertEquals( cal.getTime(), task.getModifiedTime() );
+
+        task = ( SynergyTask ) i.next();
+        assertEquals( 53, task.getNumber() );
+        assertEquals( "ccm_root", task.getUsername() );
+        assertEquals( "Inverser l'odre purpose/release", task.getComment() );
+        cal.clear();
+        cal.set( 2006, Calendar.OCTOBER, 6, 10, 47, 13 );
+        assertEquals( cal.getTime(), task.getModifiedTime() );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,59 @@
+package org.apache.maven.scm.provider.synergy.consumer;
+
+/*
+ * Copyright 2001-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.scm.ChangeFile;
+import org.apache.maven.scm.ScmTestCase;
+import org.apache.maven.scm.log.DefaultLog;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyGetTaskObjectsConsumerTest extends ScmTestCase
+{
+    public void testSynergyGetTaskObjectsConsumer() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/getTaskObjects.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        SynergyGetTaskObjectsConsumer consumer = new SynergyGetTaskObjectsConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        Collection entries = consumer.getFiles();
+
+        assertEquals( "Wrong number of entries returned", 1, entries.size() );
+
+        ChangeFile file = ( ChangeFile ) entries.iterator().next();
+        assertEquals( "MessageResources.properties", file.getName() );
+        assertEquals( "3", file.getRevision() );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,71 @@
+package org.apache.maven.scm.provider.synergy.consumer;
+
+/*
+ * Copyright 2001-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.scm.ScmTestCase;
+import org.apache.maven.scm.log.DefaultLog;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyGetWorkingProjectConsumerTest extends ScmTestCase
+{
+    public void testSynergyGetTaskObjectsConsumer() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/getWorkingProject.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        SynergyGetWorkingProjectConsumer consumer = new SynergyGetWorkingProjectConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        assertEquals( "GesdemDT~ccm_root", consumer.getProjectSpec() );
+    }
+
+    public void testSynergyGetTaskObjectsConsumerEmpty() throws IOException
+    {
+        InputStream inputStream = getResourceAsStream( "/synergy/consumer/getWorkingProjectEmpty.txt" );
+
+        BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) );
+
+        String s = in.readLine();
+
+        SynergyGetWorkingProjectConsumer consumer = new SynergyGetWorkingProjectConsumer( new DefaultLog() );
+
+        while ( s != null )
+        {
+            consumer.consumeLine( s );
+
+            s = in.readLine();
+        }
+
+        assertNull( consumer.getProjectSpec() );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java Tue Dec  5 06:24:45 2006
@@ -0,0 +1,372 @@
+package org.apache.maven.scm.provider.synergy.util;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.maven.scm.ScmException;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:julien.henry@capgemini.com">Julien Henry</a>
+ */
+public class SynergyCCMTest extends TestCase
+{
+
+    public void testShowTaskObjects() throws ScmException
+    {
+        Commandline cl = SynergyCCM.showTaskObjects( 45, "my format", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm task -show objects -f \"my format\" 45", cl.toString() );
+        cl = SynergyCCM.showTaskObjects( 45, null, "CCM_ADDR" );
+        assertEquals( "ccm task -show objects 45", cl.toString() );
+    }
+
+    public void testQuery() throws ScmException
+    {
+        Commandline cl = SynergyCCM.query( "my query", "my format", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm query -u -f \"my format\" \"my query\"", cl.toString() );
+        cl = SynergyCCM.query( "my query", null, "CCM_ADDR" );
+        assertEquals( "ccm query -u \"my query\"", cl.toString() );
+    }
+
+    public void testCreateBaseline() throws ScmException
+    {
+        Commandline cl = SynergyCCM.createBaseline( "myProject~1", "theBaseline", "my_release", "my_purpose", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm baseline -create theBaseline -p myProject~1 -release my_release -purpose my_purpose", cl.toString() );
+    }
+
+    public void testCreate() throws Exception
+    {
+        File f = File.createTempFile( "test", null );
+        List list = new LinkedList();
+        list.add( f );
+        Commandline cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            assertEquals( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\"", cl.toString() );
+        }
+        else
+        {
+            assertEquals( "ccm create -c \"test creation\" " + f.getCanonicalPath(), cl.toString() );
+        }
+        File f2 = File.createTempFile( "test", null );
+        list.add( f2 );
+        cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\" \""
+                        + f2.getCanonicalPath() + "\"", cl.toString() );
+            }
+            else
+            {
+                assertEquals( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\" "
+                        + f2.getCanonicalPath() + "", cl.toString() );
+            }
+        }
+        else
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm create -c \"test creation\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath()
+                        + "\"", cl.toString() );
+            }
+            else
+            {
+                assertEquals( "ccm create -c \"test creation\" " + f.getCanonicalPath() + " " + f2.getCanonicalPath(),
+                        cl.toString() );
+            }
+        }
+    }
+
+    public void testCreateTask() throws ScmException
+    {
+        Commandline cl = SynergyCCM.createTask( "the synopsis", "release", true, "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        String expected = "ccm task -create -synopsis \"the synopsis\" -release release";
+        assertTrue( "[" + cl.toString() + "] do not contain [" + expected + "]", cl.toString().indexOf( expected ) > -1 );
+        cl = SynergyCCM.createTask( "the synopsis", null, true, "CCM_ADDR" );
+        expected = "ccm task -create -synopsis \"the synopsis\"";
+        assertTrue( "[" + cl.toString() + "] do not contain [" + expected + "]", cl.toString().indexOf( expected ) > -1 );
+    }
+
+    public void testCheckinTask() throws ScmException
+    {
+        Commandline cl = SynergyCCM.checkinTask( "truc", "a comment", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm task -checkin truc -comment \"a comment\"", cl.toString() );
+    }
+
+    public void testDelete() throws Exception
+    {
+        File f = File.createTempFile( "test", null );
+        List list = new LinkedList();
+        list.add( f );
+        Commandline cl = SynergyCCM.delete( list, "CCM_ADDR", true );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            assertEquals( "ccm delete -replace \"" + f.getCanonicalPath() + "\"", cl.toString() );
+        }
+        else
+        {
+            assertEquals( "ccm delete -replace " + f.getCanonicalPath(), cl.toString() );
+        }
+        File f2 = File.createTempFile( "test", null );
+        list.add( f2 );
+        cl = SynergyCCM.delete( list, "CCM_ADDR", false );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm delete \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", cl
+                        .toString() );
+            }
+            else
+            {
+                assertEquals( "ccm delete \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", cl
+                        .toString() );
+            }
+        }
+        else
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm delete " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", cl
+                        .toString() );
+            }
+            else
+            {
+                assertEquals( "ccm delete " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), cl.toString() );
+            }
+        }
+    }
+
+    public void testReconfigure() throws ScmException
+    {
+        Commandline cl = SynergyCCM.reconfigure( "project~1", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm reconfigure -recurse -p project~1", cl.toString() );
+    }
+
+    public void testReconfigureProperties() throws ScmException
+    {
+        Commandline cl = SynergyCCM.reconfigureProperties( "project~1", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm reconfigure_properties -refresh project~1", cl.toString() );
+    }
+
+    public void testReconcileUwa() throws ScmException
+    {
+        Commandline cl = SynergyCCM.reconcileUwa( "project~1", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm rwa -r -uwa -p project~1", cl.toString() );
+        cl = SynergyCCM.reconcileUwa( null, "CCM_ADDR" );
+        assertEquals( "ccm rwa -r -uwa", cl.toString() );
+    }
+
+    public void testReconcileUdb() throws ScmException
+    {
+        Commandline cl = SynergyCCM.reconcileUdb( "project~1", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm rwa -r -udb -p project~1", cl.toString() );
+        cl = SynergyCCM.reconcileUdb( null, "CCM_ADDR" );
+        assertEquals( "ccm rwa -r -udb", cl.toString() );
+    }
+
+    public void testDir() throws Exception
+    {
+        File f = File.createTempFile( "foo", null );
+        Commandline cl = SynergyCCM.dir( f.getParentFile(), "format", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( f.getParentFile().getCanonicalFile(), cl.getWorkingDirectory().getCanonicalFile() );
+        assertEquals( "ccm dir -m -f format", cl.toString() );
+    }
+
+    public void testCheckoutFiles() throws Exception
+    {
+        File f = File.createTempFile( "test", null );
+        List list = new LinkedList();
+        list.add( f );
+        Commandline cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            assertEquals( "ccm co \"" + f.getCanonicalPath() + "\"", cl.toString() );
+        }
+        else
+        {
+            assertEquals( "ccm co " + f.getCanonicalPath(), cl.toString() );
+        }
+        File f2 = File.createTempFile( "test", null );
+        list.add( f2 );
+        cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm co \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", cl
+                        .toString() );
+            }
+            else
+            {
+                assertEquals( "ccm co \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", cl.toString() );
+            }
+        }
+        else
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm co " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", cl.toString() );
+            }
+            else
+            {
+                assertEquals( "ccm co " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), cl.toString() );
+            }
+        }
+    }
+
+    public void testCheckoutProject() throws Exception
+    {
+        Commandline cl = SynergyCCM.checkoutProject( null, "MyProject", "MyVersion", "MyPurpose", "MyRelease",
+                "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -p MyProject", cl
+                .toString() );
+        File f = File.createTempFile( "test", null );
+        cl = SynergyCCM.checkoutProject( f.getParentFile(), "MyProject", "MyVersion", "MyPurpose", "MyRelease",
+                "CCM_ADDR" );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            assertEquals( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -path \""
+                    + f.getParentFile().getCanonicalPath() + "\" -p MyProject", cl.toString() );
+        }
+        else
+        {
+            assertEquals( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -path "
+                    + f.getParentFile().getCanonicalPath() + " -p MyProject", cl.toString() );
+        }
+    }
+
+    public void testCheckinProject() throws ScmException
+    {
+        Commandline cl = SynergyCCM.checkinProject( "MyProject", "a comment", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm ci -c \"a comment\" -p MyProject", cl.toString() );
+    }
+
+    public void testCheckinFiles() throws Exception
+    {
+        File f = File.createTempFile( "test", null );
+        List list = new LinkedList();
+        list.add( f );
+        Commandline cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            assertEquals( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\"", cl.toString() );
+        }
+        else
+        {
+            assertEquals( "ccm ci -c \"a comment\" " + f.getCanonicalPath(), cl.toString() );
+        }
+        File f2 = File.createTempFile( "test", null );
+        list.add( f2 );
+        cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" );
+        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath()
+                        + "\"", cl.toString() );
+            }
+            else
+            {
+                assertEquals( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "",
+                        cl.toString() );
+            }
+        }
+        else
+        {
+            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            {
+                assertEquals( "ccm ci -c \"a comment\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"",
+                        cl.toString() );
+            }
+            else
+            {
+                assertEquals( "ccm ci -c \"a comment\" " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), cl
+                        .toString() );
+            }
+        }
+    }
+
+    public void testSync() throws ScmException
+    {
+        Commandline cl = SynergyCCM.synchronize( "myProject", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm sync -r -p myProject", cl.toString() );
+    }
+
+    public void testShowWorkArea() throws ScmException
+    {
+        Commandline cl = SynergyCCM.showWorkArea( "MyProject~1", "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm wa -show MyProject~1", cl.toString() );
+    }
+
+    public void testStart() throws ScmException
+    {
+        Commandline cl = SynergyCCM.start( "user", "pass", SynergyRole.BUILD_MGR );
+        assertEquals( "ccm start -nogui -m -q -n user -pw pass -r build_mgr", cl.toString() );
+    }
+
+    public void testStop() throws ScmException
+    {
+        Commandline cl = SynergyCCM.stop( "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm stop", cl.toString() );
+    }
+
+    public void testDelimiter() throws ScmException
+    {
+        Commandline cl = SynergyCCM.delimiter( "CCM_ADDR" );
+        assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironments(), "CCM_ADDR=CCM_ADDR" ) );
+        assertEquals( "ccm delimiter", cl.toString() );
+    }
+
+    public boolean assertContains( String[] array, String value )
+    {
+        for ( int i = 0; i < array.length; i++ )
+        {
+            if ( array[i].equals( value ) )
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/add.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/add.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/add.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/add.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/changelog.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/changelog.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/changelog.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/changelog.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1,19 @@
+Defaulting to project in the current working directory: D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT
+
+
+Reconciling selected items:
+        GesdemDT~int_01.00.2.3.1.7.1
+Examining Work Area for conflicts...
+1 Project(s) will be reconciled
+43 Directories will be reconciled
+        Reconcile work area: 24% complete...
+        Reconcile work area: 48% complete...
+        Reconcile work area: 71% complete...
+        Reconcile work area: 95% complete...
+        Reconcile work area: 100% complete...
+1 Work Area conflict(s) found
+        Creating version 2 of pom.xml~1:xml:2 ...
+Added 'release' attribute with value 'GesdemDT_J2EE/01.00.1' to object pom.xml~2:xml:2
+        Updating database with file 'D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT\pom.xml'...
+        1 new versions successfully created.
+Reconcile completed

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1,3 @@
+Task 70 created.
+The default task is set to:
+70: Maven SCM Synergy provider: adding file(s) to project TestMaven~1
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1 @@
+35#####AHD456#####Wed Oct  4 15:42:47 2006#####gefdeag#####
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1,2 @@
+52#####ccm_root#####vendredi 6 octobre 2006 10:03:59#####Modification du pom (url scm)##### 
+ 53#####ccm_root#####vendredi 6 octobre 2006 10:47:13#####Inverser l'odre purpose/release#####
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1 @@
+MessageResources.properties#####3#####
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1 @@
+GesdemDT~ccm_root
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProjectEmpty.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProjectEmpty.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProjectEmpty.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProjectEmpty.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remove.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remove.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remove.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remove.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/status.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/status.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/status.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/status.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/tag.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/tag.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/tag.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/tag.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedit.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedit.txt?view=auto&rev=482671
==============================================================================
    (empty)

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedit.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedit.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt Tue Dec  5 06:24:45 2006
@@ -0,0 +1,16 @@
+Defaulting to project in the current working directory: D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT
+
+
+Reconciling selected items:
+        GesdemDT~int_01.00.2.3.1.7.1
+Examining Work Area for conflicts...
+1 Project(s) will be reconciled
+43 Directories will be reconciled
+        Reconcile work area: 24% complete...
+        Reconcile work area: 48% complete...
+        Reconcile work area: 71% complete...
+        Reconcile work area: 95% complete...
+        Reconcile work area: 100% complete...
+1 Work Area conflict(s) found
+        Discarding changes to 'D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT\pom.xml'...
+Reconcile completed

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/scm/trunk/maven-scm-providers/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/pom.xml?view=diff&rev=482671&r1=482670&r2=482671
==============================================================================
--- maven/scm/trunk/maven-scm-providers/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/pom.xml Tue Dec  5 06:24:45 2006
@@ -17,6 +17,7 @@
     <module>maven-scm-provider-starteam</module>
     <module>maven-scm-providers-cvs</module>
     <module>maven-scm-providers-svn</module>
+    <module>maven-scm-provider-synergy</module>
     <module>maven-scm-provider-vss</module>
   </modules>
   <dependencies>

Modified: maven/scm/trunk/maven-scm-site/src/site/apt/scms-overview.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-site/src/site/apt/scms-overview.apt?view=diff&rev=482671&r1=482670&r2=482671
==============================================================================
--- maven/scm/trunk/maven-scm-site/src/site/apt/scms-overview.apt (original)
+++ maven/scm/trunk/maven-scm-site/src/site/apt/scms-overview.apt Tue Dec  5 06:24:45 2006
@@ -22,6 +22,8 @@
 
   * {{{subversion.html}Subversion}}
 
+  * {{{synergy.html}CM Synergy}}
+
 * Partially implemented SCM's
 
   * {{{clearcase.html}ClearCase}}
@@ -43,8 +45,6 @@
   * BitKeeper
 
   * ClearCase Multisite
-
-  * CM Synergy
 
   * Code Co-op
 

Modified: maven/scm/trunk/maven-scm-site/src/site/apt/scmtools.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-site/src/site/apt/scmtools.apt?view=diff&rev=482671&r1=482670&r2=482671
==============================================================================
--- maven/scm/trunk/maven-scm-site/src/site/apt/scmtools.apt (original)
+++ maven/scm/trunk/maven-scm-site/src/site/apt/scmtools.apt Tue Dec  5 06:24:45 2006
@@ -56,6 +56,8 @@
 
     License : Commercial
 
+    Status : <<Started>>
+
 Code Co-op
 
     Link : {{http://www.relisoft.com/co_op/}}

Added: maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt?view=auto&rev=482671
==============================================================================
--- maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt (added)
+++ maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt Tue Dec  5 06:24:45 2006
@@ -0,0 +1,164 @@
+ ------
+ SCM Implementation: CM/Synergy
+ ------
+ Julien Henry (Capgemini) & La Poste
+ ------
+ October, 23 2006
+ ------
+
+SCM Implementation: CM/Synergy
+
+* General Info
+
+   Link : {{http://www.telelogic.com/Products/synergy/synergycm/index.cfm}}
+
+   License : Commercial
+
+* SCM Url
+
+    For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator.
+
+-------
+scm:synergy<delimiter>project_name<delimiter>database_delimiter<delimiter>project_version<delimiter>release<delimiter>purpose
+-------
+    
+    <project_name>: This is the name of the project from which the checkout is done.
+
+    <project_version>: This is the version of the project from which the checkout is done (usually a prep project).
+
+    <release>: This is the release.
+
+    <purpose>: This is the purpose.
+
+* Examples
+
+-------
+scm:synergy:MyProject:~:int_1.0:MyProject/2.0:Devel
+scm|synergy|MyProject|-|int_1.0|MyProject/2.0|Devel
+-------
+
+* Extra Information
+
+** Checkout
+
+    Checkout purpose is to get sources from a working Work Area to a given folder. First,
+    it checks if a work area already exists with the given version. If yes, it only synchronizes and reconfigures
+    the existing one, and then copies file to the expecting folder. If no Work Area exists, then a checkout is done.
+    
+    To specify the version of the checkout working project, use <tag> parameter.
+    
+    When a 'checkout' happens, the following scm commands are generated
+    
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm query -u -f %displayname "owner='<username>' and status='working' and type='project' and has_predecessor('<project_spec>:project:1')" //Check for existing checkout
+ccm synchronize -p <working_project_spec>
+ccm reconfigure -p <working_project_spec>
+ccm checkout -subprojects -rel [-t <tag>] -purpose <purpose> -release <release> -p <project_spec> // If no existing working project exists
+ccm stop
+-------
+
+** Update
+
+    Reconfigure project with default reconfigure template, and copy file from work area to expected folder.
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm query -u -f %displayname "owner='<username>' and status='working' and type='project' and has_predecessor('<project_spec>:project:1')" //Check for existing checkout
+ccm reconfigure -r -p <working_project_spec>
+ccm stop
+-------
+
+** Add
+
+    Create a default task, add new file(s) to the repository and checkin the task.
+    <message> You can change the synopsis of the task by setting this parameter
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm task -create -def -release <release> -synopsis <message>
+ccm create -c <message> <filename>
+ccm task -checkin <task_spec> -comment <message>
+ccm stop
+-------
+
+** Remove
+
+    Remove a file from repository.
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm delete <filename>
+ccm stop
+-------
+
+** Changelog
+
+ Get modified files history. In order to parse output of Synergy command, we need to know different parameters:
+
+ * maven.scm.synergy.ccmDateFormat (default value is EEE MMM dd HH:mm:ss yyyy)
+
+ * maven.scm.synergy.language (default value is en)
+
+ * maven.scm.synergy.country (default value is US)
+
+ []
+ 
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm query -u is_task_in_folder_of(is_folder_in_rp_of('<project_spec>:project:1')) and completion_date>time(<startDate>) and completion_date<time(<endDate>)
+ccm task -show objects <task>
+ccm stop
+-------
+
+** Checkin
+
+    Checkin the default task.
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm task -checkin default -c <message>
+ccm stop
+-------
+
+** Edit
+
+    Create a default task and checkout file(s).
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm task -create -def -release <release> -synopsis <message>
+ccm co <filename>
+ccm stop
+-------
+
+** Unedit
+
+    Cancel edition. Replace file with previous version.
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm delete -replace <filename>
+ccm stop
+-------
+
+** Status
+
+    Get state of files.
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm dir -m
+ccm stop
+-------
+
+** Tag
+
+    Create a baseline on the prep project.
+    You may need to change the purpose in the pom to create the baseline (only prep purpose are allowed).
+
+-------
+ccm start -m -q -nogui -n <username> -pw <password>
+ccm baseline -create <tag> -p <project_spec> -r <release> -purpose <purpose>
+ccm stop
+-------

Propchange: maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-site/src/site/apt/synergy.apt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message