From a5a6226e537e0356dce4fa60714fec32d7b2c171 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 16 Apr 2006 03:43:08 +0000 Subject: [PATCH] [MNG-2229] adding patch which adds svn checkout capabilities Submitted by: Jesse McConnell git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@394429 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/it/Verifier.java | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java b/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java index 992147476f..2d7bff056a 100644 --- a/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java +++ b/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java @@ -370,7 +370,7 @@ public class Verifier } } - private static void executeCommand( String line ) + private void executeCommand( String line ) throws VerificationException { int index = line.indexOf( " " ); @@ -416,6 +416,43 @@ public class Verifier 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 { throw new VerificationException( "unknown command: " + cmd );