Author: sebb
Date: Wed Apr 23 08:02:56 2008
New Revision: 650899
URL: http://svn.apache.org/viewvc?rev=650899&view=rev
Log:
Add method to get success/fail statuses for the test scripts
Modified:
commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/TestUtil.java
Modified:
commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/TestUtil.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/TestUtil.java?rev=650899&r1=650898&r2=650899&view=diff
==============================================================================
---
commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/TestUtil.java
(original)
+++
commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/TestUtil.java
Wed Apr 23 08:02:56 2008
@@ -41,6 +41,22 @@
}
}
+ /**
+ * Get success and fail return codes used by the test scripts
+ * @return int array[2] = {ok, success}
+ */
+ public static int[] getTestScriptCodesForOS() {
+ if (OS.isFamilyWindows()) {
+ return new int[]{0,1};
+ } else if (OS.isFamilyUnix()) {
+ return new int[]{0,1};
+ } else if (OS.isFamilyOpenVms()) {
+ return new int[]{1,2};
+ } else {
+ throw new AssertionFailedError("Test not supported for this OS");
+ }
+ }
+
public static void assertEquals(Object[] expected, Object[] actual,
boolean orderSignificant) {