Author: britter
Date: Fri Jan 10 15:55:04 2014
New Revision: 1557165
URL: http://svn.apache.org/r1557165
Log:
Found some other issue rleated tests hiding in CommandLineTest
Modified:
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/CommandLineTest.java
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
Modified:
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/CommandLineTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/CommandLineTest.java?rev=1557165&r1=1557164&r2=1557165&view=diff
==============================================================================
---
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/CommandLineTest.java
(original)
+++
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/CommandLineTest.java
Fri Jan 10 15:55:04 2014
@@ -179,7 +179,7 @@ public class CommandLineTest {
assertArrayEquals(new String[]{"test", "foo", "bar"},
cmdl.toStrings());
}
- @Test
+ @TestO
public void testAddArgumentsArrayNull() {
final CommandLine cmdl = new CommandLine("test");
cmdl.addArguments((String[]) null);
@@ -502,72 +502,6 @@ public class CommandLineTest {
!cmd1.toString().equals(cmd2.toString()));
}
- /**
- * Some complex real-life command line from
- * http://blogs.msdn.com/b/astebner/archive/2005/12/13/503471.aspx
- */
- @Test
- @Ignore
- public void _testExec36_1() throws Exception {
-
- CommandLine cmdl;
-
- final String line = "./script/jrake "
- + "cruise:publish_installers "
- + "INSTALLER_VERSION=unstable_2_1 "
- + "INSTALLER_PATH=\"/var/lib/cruise-agent/installers\" "
- + "INSTALLER_DOWNLOAD_SERVER='something'"
- + "WITHOUT_HELP_DOC=true";
-
- cmdl = CommandLine.parse(line);
- final String[] args = cmdl.toStrings();
- assertEquals("./script/jrake", args[0]);
- assertEquals("cruise:publish_installers", args[1]);
- assertEquals("INSTALLER_VERSION=unstable_2_1", args[2]);
- assertEquals("INSTALLER_PATH=\"/var/lib/cruise-agent/installers\"",
args[3]);
- assertEquals("INSTALLER_DOWNLOAD_SERVER='something'", args[4]);
- assertEquals("WITHOUT_HELP_DOC=true", args[5]);
- }
-
- /**
- * Some complex real-life command line from
- * http://blogs.msdn.com/b/astebner/archive/2005/12/13/503471.aspx
- */
- @Test
- @Ignore
- public void _testExec36_2() {
-
- CommandLine cmdl;
-
- final String line = "dotnetfx.exe"
- + " /q:a "
- + "/c:\"install.exe /l \"\"c:\\Documents and
Settings\\myusername\\Local Settings\\Temp\\netfx.log\"\" /q\"";
-
- cmdl = CommandLine.parse(line);
- final String[] args = cmdl.toStrings();
- assertEquals("dotnetfx.exe", args[0]);
- assertEquals("/q:a", args[1]);
- assertEquals("/c:\"install.exe /l \"\"c:\\Documents and
Settings\\myusername\\Local Settings\\Temp\\netfx.log\"\" /q\"", args[2] );
- }
-
- /**
- * Test the following command line
- *
- * C:\CVS_DB\WeightsEngine /f WeightsEngine.mak CFG="WeightsEngine -
Win32Release"
- */
- @Test
- @Ignore
- public void _testExec36_3() {
-
- final String commandline = "C:\\CVS_DB\\WeightsEngine /f
WeightsEngine.mak CFG=\"WeightsEngine - Win32Release\"";
-
- final CommandLine cmdl = CommandLine.parse(commandline);
- final String[] args = cmdl.getArguments();
- assertEquals("/f", args[0]);
- assertEquals("WeightsEngine.mak", args[1]);
- assertEquals("CFG=\"WeightsEngine - Win32Release\"", args[2]);
- }
-
@Test
public void testCopyConstructor()
{
Modified:
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
URL:
http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/issues/Exec36Test.java?rev=1557165&r1=1557164&r2=1557165&view=diff
==============================================================================
---
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
(original)
+++
commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
Fri Jan 10 15:55:04 2014
@@ -33,6 +33,7 @@ import org.apache.commons.exec.PumpStrea
import org.apache.commons.exec.TestUtil;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -157,4 +158,69 @@ public class Exec36Test {
}
}
+ /**
+ * Some complex real-life command line from
+ * http://blogs.msdn.com/b/astebner/archive/2005/12/13/503471.aspx
+ */
+ @Test
+ @Ignore
+ public void _testExec36_4() throws Exception {
+
+ CommandLine cmdl;
+
+ final String line = "./script/jrake "
+ + "cruise:publish_installers "
+ + "INSTALLER_VERSION=unstable_2_1 "
+ + "INSTALLER_PATH=\"/var/lib/cruise-agent/installers\" "
+ + "INSTALLER_DOWNLOAD_SERVER='something'"
+ + "WITHOUT_HELP_DOC=true";
+
+ cmdl = CommandLine.parse(line);
+ final String[] args = cmdl.toStrings();
+ assertEquals("./script/jrake", args[0]);
+ assertEquals("cruise:publish_installers", args[1]);
+ assertEquals("INSTALLER_VERSION=unstable_2_1", args[2]);
+ assertEquals("INSTALLER_PATH=\"/var/lib/cruise-agent/installers\"",
args[3]);
+ assertEquals("INSTALLER_DOWNLOAD_SERVER='something'", args[4]);
+ assertEquals("WITHOUT_HELP_DOC=true", args[5]);
+ }
+
+ /**
+ * Some complex real-life command line from
+ * http://blogs.msdn.com/b/astebner/archive/2005/12/13/503471.aspx
+ */
+ @Test
+ @Ignore
+ public void _testExec36_5() {
+
+ CommandLine cmdl;
+
+ final String line = "dotnetfx.exe"
+ + " /q:a "
+ + "/c:\"install.exe /l \"\"c:\\Documents and
Settings\\myusername\\Local Settings\\Temp\\netfx.log\"\" /q\"";
+
+ cmdl = CommandLine.parse(line);
+ final String[] args = cmdl.toStrings();
+ assertEquals("dotnetfx.exe", args[0]);
+ assertEquals("/q:a", args[1]);
+ assertEquals("/c:\"install.exe /l \"\"c:\\Documents and
Settings\\myusername\\Local Settings\\Temp\\netfx.log\"\" /q\"", args[2] );
+ }
+
+ /**
+ * Test the following command line
+ *
+ * C:\CVS_DB\WeightsEngine /f WeightsEngine.mak CFG="WeightsEngine -
Win32Release"
+ */
+ @Test
+ @Ignore
+ public void _testExec36_6() {
+
+ final String commandline = "C:\\CVS_DB\\WeightsEngine /f
WeightsEngine.mak CFG=\"WeightsEngine - Win32Release\"";
+
+ final CommandLine cmdl = CommandLine.parse(commandline);
+ final String[] args = cmdl.getArguments();
+ assertEquals("/f", args[0]);
+ assertEquals("WeightsEngine.mak", args[1]);
+ assertEquals("CFG=\"WeightsEngine - Win32Release\"", args[2]);
+ }
}