You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2006/04/16 05:43:09 UTC

svn commit: r394429 - /maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java

Author: jvanzyl
Date: Sat Apr 15 20:43:08 2006
New Revision: 394429

URL: http://svn.apache.org/viewcvs?rev=394429&view=rev
Log:
[MNG-2229] adding patch which adds svn checkout capabilities

Modified:
    maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java

Modified: maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java?rev=394429&r1=394428&r2=394429&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java (original)
+++ maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java Sat Apr 15 20:43:08 2006
@@ -370,7 +370,7 @@
         }
     }
 
-    private static void executeCommand( String line )
+    private void executeCommand( String line )
         throws VerificationException
     {
         int index = line.indexOf( " " );
@@ -414,6 +414,43 @@
             catch ( IOException e )
             {
                 throw new VerificationException( "Error removing directory - delete failed" );
+            }
+        }
+        else if ( "svn".equals( cmd ) )
+        {
+            try
+            {
+
+                Commandline cli = new Commandline( line );
+
+                cli.setWorkingDirectory( basedir );
+
+                Writer logWriter = new FileWriter( new File( basedir, LOG_FILENAME ) );
+
+                StreamConsumer out = new WriterStreamConsumer( logWriter );
+
+                StreamConsumer err = new WriterStreamConsumer( logWriter );
+
+                System.out.println( "Command: " + Commandline.toString( cli.getCommandline() ) );
+
+                int ret = CommandLineUtils.executeCommandLine( cli, out, err );
+
+                logWriter.close();
+
+                if ( ret > 0 )
+                {
+                    System.err.println( "Exit code: " + ret );
+
+                    throw new VerificationException();
+                }
+            }
+            catch ( CommandLineException e )
+            {
+                throw new VerificationException( e );
+            }
+            catch ( IOException e )
+            {
+                throw new VerificationException( e );
             }
         }
         else