--- old/test/jdk/java/lang/ProcessBuilder/Basic.java 2020-02-18 16:54:43.296349632 +0000 +++ new/test/jdk/java/lang/ProcessBuilder/Basic.java 2020-02-18 16:54:42.980344091 +0000 @@ -74,6 +74,11 @@ /* used for AIX only */ static final String libpath = System.getenv("LIBPATH"); + /* Used for regex String matching for long error messages */ + static final String PERMISSION_DENIED_ERROR_MSG = "(Permission denied|error=13, The file access permissions do not allow the specified action)"; + static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2, A file or directory in the path name does not exist.)"; + static final String NO_SUCH_FILE_OR_DIR_ERROR_MSG = "(No such file or directory|error=2, A file or directory in the path name does not exist)"; + /** * Returns the number of milliseconds since time given by * startNanoTime, which must have been previously returned from a @@ -305,7 +310,7 @@ } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } } @@ -415,7 +420,7 @@ } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -428,7 +433,7 @@ } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1982,7 +1987,7 @@ } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file or directory")) + ! matches(m, NO_SUCH_FILE_OR_DIR_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1998,8 +2003,8 @@ String m = e.getMessage(); Pattern p = Pattern.compile(programName); if (! matches(m, programName) - || (EnglishUnix.is() - && ! matches(m, "No such file or directory"))) + || (EnglishUnix.is() && + ! matches(m, NO_SUCH_FILE_OR_DIR_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -2015,7 +2020,7 @@ String m = e.getMessage(); if (! matches(m, "in directory") || (EnglishUnix.is() && - ! matches(m, "No such file or directory"))) + ! matches(m, NO_SUCH_FILE_OR_DIR_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -2295,7 +2300,7 @@ new File("./emptyCommand").delete(); String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); }