File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/test/java/org/codehaus/plexus/util/cli Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,13 @@ public void testOnlyQuotedPath()
461461 throw new IOException ( java .getAbsolutePath () + " doesn't exist" );
462462 }
463463
464- createAndCallScript ( dir , java .getAbsolutePath () + " -version" );
464+ String javaBinStr = java .getAbsolutePath ();
465+ if ( Os .isFamily ( Os .FAMILY_WINDOWS ) && javaBinStr .contains ( " " ) )
466+ {
467+ javaBinStr = "\" " + javaBinStr + "\" " ;
468+ }
469+
470+ createAndCallScript ( dir , javaBinStr + " -version" );
465471 }
466472
467473 public void testDollarSignInArgumentPath ()
@@ -515,7 +521,7 @@ public void testTimeOutException() throws Exception
515521 {
516522 throw new IOException ( java .getAbsolutePath () + " doesn't exist" );
517523 }
518-
524+
519525 Commandline cli = new Commandline ();
520526 cli .setExecutable ( java .getAbsolutePath () );
521527 cli .createArg ().setLine ( "-version" );
@@ -529,9 +535,9 @@ public void testTimeOutException() throws Exception
529535 {
530536 // it works
531537 }
532-
538+
533539 }
534-
540+
535541 /**
536542 * Make the file executable for Unix box.
537543 *
You can’t perform that action at this time.
0 commit comments