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()
461
461
throw new IOException ( java .getAbsolutePath () + " doesn't exist" );
462
462
}
463
463
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" );
465
471
}
466
472
467
473
public void testDollarSignInArgumentPath ()
@@ -515,7 +521,7 @@ public void testTimeOutException() throws Exception
515
521
{
516
522
throw new IOException ( java .getAbsolutePath () + " doesn't exist" );
517
523
}
518
-
524
+
519
525
Commandline cli = new Commandline ();
520
526
cli .setExecutable ( java .getAbsolutePath () );
521
527
cli .createArg ().setLine ( "-version" );
@@ -529,9 +535,9 @@ public void testTimeOutException() throws Exception
529
535
{
530
536
// it works
531
537
}
532
-
538
+
533
539
}
534
-
540
+
535
541
/**
536
542
* Make the file executable for Unix box.
537
543
*
You can’t perform that action at this time.
0 commit comments