geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1165498 - /geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java
Date Tue, 06 Sep 2011 05:14:09 GMT
Author: xiaming
Date: Tue Sep  6 05:14:09 2011
New Revision: 1165498

URL: http://svn.apache.org/viewvc?rev=1165498&view=rev
Log:
Consider linux commands with .sh suffix

Modified:
    geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java

Modified: geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java?rev=1165498&r1=1165497&r2=1165498&view=diff
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java
(original)
+++ geronimo/server/trunk/testsupport/testsupport-commands/src/main/java/org/apache/geronimo/testsupport/commands/CommandTestSupport.java
Tue Sep  6 05:14:09 2011
@@ -20,6 +20,7 @@ package org.apache.geronimo.testsupport.
 
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -113,12 +114,24 @@ public class CommandTestSupport {
         }
     }
 
-    protected String resolveCommandForOS(String command) {      
+    protected String resolveCommandForOS(String command) {
+    	String filename = "";
         if (isWindows()) {
-            return geronimoHome + "/bin/" + command + ".bat";            
+            filename = geronimoHome + "/bin/" + command + ".bat";            
         } else {
-            return geronimoHome + "/bin/" + command;
-        }     
+        	try {
+        		File cmdfile1 = new File(geronimoHome + "/bin/" + command);
+        		File cmdfile2 = new File(geronimoHome + "/bin/" + command + ".sh");
+        		if(cmdfile1.exists()) { 
+        			filename = geronimoHome + "/bin/" + command;
+        		} else if (cmdfile2.exists()) {
+        			filename = geronimoHome + "/bin/" + command + ".sh";
+        		}
+        	} catch(Exception e) { 
+        		
+        	}            
+        }    
+        return filename;
     }
         
     public boolean isWindows() {



Mime
View raw message