提交 87ba029f 编写于 作者: A afarley

8239365: ProcessBuilder test modifications for AIX execution

Reviewed-by: rriggs, stuefe
上级 0174e3fd
......@@ -74,6 +74,10 @@ public class Basic {
/* 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)";
static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2)";
/**
* Returns the number of milliseconds since time given by
* startNanoTime, which must have been previously returned from a
......@@ -305,7 +309,7 @@ public class Basic {
} 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 +419,7 @@ public class Basic {
} 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 +432,7 @@ public class Basic {
} 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 +1986,7 @@ public class Basic {
} catch (IOException e) {
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "No such file or directory"))
! matches(m, NO_SUCH_FILE_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
......@@ -1998,8 +2002,8 @@ public class Basic {
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_ERROR_MSG)))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
......@@ -2015,7 +2019,7 @@ public class Basic {
String m = e.getMessage();
if (! matches(m, "in directory")
|| (EnglishUnix.is() &&
! matches(m, "No such file or directory")))
! matches(m, NO_SUCH_FILE_ERROR_MSG)))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
......@@ -2277,7 +2281,7 @@ public class Basic {
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); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册