Fix one test in Class ProcessExecutorTest
This commit is contained in:
parent
5277cf2b59
commit
805848e627
1 changed files with 6 additions and 2 deletions
|
@ -45,7 +45,11 @@ public class ProcessExecutorTest {
|
||||||
processExecutor.runCommandWithOutputHandling(command);
|
processExecutor.runCommandWithOutputHandling(command);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check the exception message to ensure it is about the nonexistent command
|
// Log the actual error message
|
||||||
assertTrue(thrown.getMessage().contains("CreateProcess error=2, The system cannot find the file specified"));
|
System.out.println("Caught IOException: " + thrown.getMessage());
|
||||||
|
|
||||||
|
// Check the exception message to ensure it indicates the command was not found
|
||||||
|
String errorMessage = thrown.getMessage();
|
||||||
|
assertTrue(errorMessage.contains("error=2") || errorMessage.contains("No such file or directory"), "Unexpected error message: " + errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue