maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r394429 - /maven/components/trunk/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java
Date Sun, 16 Apr 2006 03:43:09 GMT
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



Mime
View raw message