Author: sebb
Date: Tue Oct  5 22:54:13 2010
New Revision: 1004848

URL: http://svn.apache.org/viewvc?rev=1004848&view=rev
Log:
Add new test for variable with embedded quotes

Modified:
    
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java

Modified: 
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java?rev=1004848&r1=1004847&r2=1004848&view=diff
==============================================================================
--- 
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
 (original)
+++ 
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
 Tue Oct  5 22:54:13 2010
@@ -615,6 +615,19 @@ public class DefaultExecutorTest extends
         exec.execute(new CommandLine(environmentSript), myEnvVars);
         String environment = baos.toString().trim();
         assertTrue("Expecting NEW_VAR in 
"+environment,environment.indexOf("NEW_VAR") >= 0);
+        assertTrue("Expecting NEW_VAL in 
"+environment,environment.indexOf("NEW_VAL") >= 0);
+    }
+
+    public void testAddEnvironmentVariableEmbeddedQuote() throws Exception {
+        Map myEnvVars = new HashMap();
+        myEnvVars.putAll(EnvironmentUtils.getProcEnvironment());
+        String name = "NEW_VAR";
+        String value = "NEW_\"_VAL";
+        myEnvVars.put(name,value);
+        exec.execute(new CommandLine(environmentSript), myEnvVars);
+        String environment = baos.toString().trim();
+        assertTrue("Expecting "+name+" in 
"+environment,environment.indexOf(name) >= 0);
+        assertTrue("Expecting "+value+" in 
"+environment,environment.indexOf(value) >= 0);
     }
 
     // ======================================================================


Reply via email to