maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r890499 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src: main/java/org/apache/maven/scm/provider/synergy/util/ test/java/org/apache/maven/scm/provider/synergy/util/
Date Mon, 14 Dec 2009 22:10:49 GMT
Author: olamy
Date: Mon Dec 14 22:10:49 2009
New Revision: 890499

URL: http://svn.apache.org/viewvc?rev=890499&view=rev
Log:
[SCM-505] Linux Synergy client fails to execute scm:update command.
Submitted by Subir Sasikumar.

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyCCM.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyCCM.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/SynergyCCM.java?rev=890499&r1=890498&r2=890499&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyCCM.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyCCM.java
Mon Dec 14 22:10:49 2009
@@ -801,6 +801,39 @@
     }
 
     /**
+     * Create commandline to start a  remote Synergy session
+     *
+     * @param username
+     * @param password
+     * @param role
+     * @return
+     * @throws ScmException
+     */
+    public static Commandline startRemote( String username, String password, SynergyRole
role )
+        throws ScmException
+    {
+        Commandline cl = new Commandline();
+
+        cl.setExecutable( CCM );
+        cl.createArg().setValue( START );
+        cl.createArg().setValue( "-nogui" );
+        cl.createArg().setValue( "-m" ); // Multissesion
+        cl.createArg().setValue( "-q" ); // Quiet (return only CCM_ADDR)
+		cl.createArg().setValue( "-rc" );//Remote client
+        cl.createArg().setValue( "-n" );
+        cl.createArg().setValue( username );
+        cl.createArg().setValue( "-pw" );
+        cl.createArg().setValue( password );
+        if ( role != null )
+        {
+            cl.createArg().setValue( "-r" );
+            cl.createArg().setValue( role.toString() );
+        }
+
+        return cl;
+    }
+	
+    /**
      * Create commandline to get Synergy database delimiter
      *
      * @return

Modified: 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?rev=890499&r1=890498&r2=890499&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
Mon Dec 14 22:10:49 2009
@@ -717,7 +717,24 @@
         CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
         CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
 
-        executeSynergyCommand( logger, cl, stderr, stdout, true );
+        //executeSynergyCommand( logger, cl, stderr, stdout, true );
+		
+		int exitCode = executeSynergyCommand( logger, cl, stderr, stdout, false );
+		
+		if ( logger.isDebugEnabled() )
+        {
+            logger.debug( "Synergy : start returns with error code " + exitCode );
+        }		
+		
+		if ( exitCode != 0 ) 
+		{
+			cl = SynergyCCM.startRemote( username, password, role );
+            
+			stderr = new CommandLineUtils.StringStreamConsumer();
+            stdout = new CommandLineUtils.StringStreamConsumer();			
+			
+			executeSynergyCommand( logger, cl, stderr, stdout, true );			
+		}
 
         return stdout.getOutput();
     }

Modified: 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?rev=890499&r1=890498&r2=890499&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
Mon Dec 14 22:10:49 2009
@@ -393,6 +393,13 @@
         Commandline cl = SynergyCCM.start( "user", "pass", SynergyRole.BUILD_MGR );
         assertCommandLine( "ccm start -nogui -m -q -n user -pw pass -r build_mgr", null,
cl );
     }
+	
+	public void testStartRemote()
+        throws ScmException
+    {
+        Commandline cl = SynergyCCM.startRemote( "user", "pass", SynergyRole.BUILD_MGR );
+        assertCommandLine( "ccm start -nogui -m -q -rc -n user -pw pass -r build_mgr", null,
cl );
+    }
 
     public void testStop()
         throws Exception



Mime
View raw message