continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r220166 - /maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
Date Thu, 21 Jul 2005 18:55:21 GMT
Author: evenisse
Date: Thu Jul 21 11:55:17 2005
New Revision: 220166

URL: http://svn.apache.org/viewcvs?rev=220166&view=rev
Log:
Windows script doesn't accept '#' character in code. Use REM instead.

Modified:
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java?rev=220166&r1=220165&r2=220166&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
Thu Jul 21 11:55:17 2005
@@ -38,6 +38,7 @@
     public void testBasic()
         throws Exception
     {
+        System.out.println(getScriptContent());
         Continuum continuum = getContinuum();
 
         initializeCvsRoot();
@@ -76,10 +77,7 @@
 
         cvsCheckout( getCvsRoot(), "shell", coDir );
 
-        File s = new File( coDir, getScriptName() );
-        String script = FileUtils.fileRead( s );
-        FileUtils.fileWrite( s.getAbsolutePath(), script + " # Extra part" );
-        system( root, "chmod", "+x " + s.getAbsolutePath() );
+        addExtraPartInScript( root, coDir );
 
         cvsCommit( coDir );
 
@@ -138,6 +136,21 @@
                 "for arg in \"$@\"; do" + EOL +
                 "  echo $arg" + EOL +
                 "done";
+        }
+    }
+    private void addExtraPartInScript( File rootDir, File coDir )
+        throws Exception
+    {
+        File s = new File( coDir, getScriptName() );
+        String script = FileUtils.fileRead( s );
+        if ( System.getProperty( "os.name" ).startsWith( "Windows" ) && !"true".equals(
System.getProperty( "cygwin" ) ) )
+        {
+            FileUtils.fileWrite( s.getAbsolutePath(), script + EOL + " REM Extra part" );
+        }
+        else
+        {
+            FileUtils.fileWrite( s.getAbsolutePath(), script + " # Extra part" );
+            system( rootDir, "chmod", "+x " + s.getAbsolutePath() );
         }
     }
 }



Mime
View raw message