@@ -42,7 +42,7 @@ public void testQuoteWorkingDirectoryAndExecutable()
4242 sh .setWorkingDirectory ( "/usr/local/bin" );
4343 sh .setExecutable ( "chmod" );
4444
45- String executable = StringUtils .join ( sh .getShellCommandLine ( new String []{} ).iterator (), " " );
45+ String executable = StringUtils .join ( sh .getShellCommandLine ().iterator (), " " );
4646
4747 assertEquals ( "/bin/sh -c cd '/usr/local/bin' && 'chmod'" , executable );
4848 }
@@ -54,7 +54,7 @@ public void testQuoteWorkingDirectoryAndExecutable_WDPathWithSingleQuotes()
5454 sh .setWorkingDirectory ( "/usr/local/'something else'" );
5555 sh .setExecutable ( "chmod" );
5656
57- String executable = StringUtils .join ( sh .getShellCommandLine ( new String []{} ).iterator (), " " );
57+ String executable = StringUtils .join ( sh .getShellCommandLine ().iterator (), " " );
5858
5959 assertEquals ( "/bin/sh -c cd '/usr/local/'\" '\" 'something else'\" '\" '' && 'chmod'" , executable );
6060 }
@@ -66,7 +66,7 @@ public void testQuoteWorkingDirectoryAndExecutable_WDPathWithSingleQuotes_Backsl
6666 sh .setWorkingDirectory ( "\\ usr\\ local\\ 'something else'" );
6767 sh .setExecutable ( "chmod" );
6868
69- String executable = StringUtils .join ( sh .getShellCommandLine ( new String []{} ).iterator (), " " );
69+ String executable = StringUtils .join ( sh .getShellCommandLine ().iterator (), " " );
7070
7171 assertEquals ( "/bin/sh -c cd '\\ usr\\ local\\ '\" '\" 'something else'\" '\" '' && 'chmod'" , executable );
7272 }
@@ -78,9 +78,7 @@ public void testPreserveSingleQuotesOnArgument()
7878 sh .setWorkingDirectory ( "/usr/bin" );
7979 sh .setExecutable ( "chmod" );
8080
81- final String [] args = { "\" some arg with spaces\" " };
82-
83- List <String > shellCommandLine = sh .getShellCommandLine ( args );
81+ List <String > shellCommandLine = sh .getShellCommandLine ("\" some arg with spaces\" " );
8482
8583 String cli = StringUtils .join ( shellCommandLine .iterator (), " " );
8684 System .out .println ( cli );
@@ -94,9 +92,7 @@ public void testAddSingleQuotesOnArgumentWithSpaces()
9492 sh .setWorkingDirectory ( "/usr/bin" );
9593 sh .setExecutable ( "chmod" );
9694
97- String [] args = { "some arg with spaces" };
98-
99- List <String > shellCommandLine = sh .getShellCommandLine ( args );
95+ List <String > shellCommandLine = sh .getShellCommandLine ("some arg with spaces" );
10096
10197 String cli = StringUtils .join ( shellCommandLine .iterator (), " " );
10298 System .out .println ( cli );
@@ -110,9 +106,7 @@ public void testAddArgumentWithSingleQuote()
110106 sh .setWorkingDirectory ( "/usr/bin" );
111107 sh .setExecutable ( "chmod" );
112108
113- String [] args = { "arg'withquote" };
114-
115- List <String > shellCommandLine = sh .getShellCommandLine ( args );
109+ List <String > shellCommandLine = sh .getShellCommandLine ("arg'withquote" );
116110
117111 assertEquals ("cd '/usr/bin' && 'chmod' 'arg'\" '\" 'withquote'" , shellCommandLine .get (shellCommandLine .size () - 1 ));
118112 }
@@ -127,9 +121,7 @@ public void testArgumentsWithSemicolon()
127121 sh .setWorkingDirectory ( "/usr/bin" );
128122 sh .setExecutable ( "chmod" );
129123
130- String [] args = { ";some&argwithunix$chars" };
131-
132- List <String > shellCommandLine = sh .getShellCommandLine ( args );
124+ List <String > shellCommandLine = sh .getShellCommandLine (";some&argwithunix$chars" );
133125
134126 String cli = StringUtils .join ( shellCommandLine .iterator (), " " );
135127 System .out .println ( cli );
0 commit comments