Author: rgodfrey
Date: Mon Oct 1 19:20:39 2012
New Revision: 1392531
URL: http://svn.apache.org/viewvc?rev=1392531&view=rev
Log:
PROTON-42 : Fix spurious reporting of failure of jython tests
Modified:
qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
qpid/proton/trunk/tests/proton-test
Modified:
qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java?rev=1392531&r1=1392530&r2=1392531&view=diff
==============================================================================
---
qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
(original)
+++
qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
Mon Oct 1 19:20:39 2012
@@ -22,6 +22,8 @@ package org.apache.qpid.proton.test;
import org.junit.Test;
import static org.junit.Assert.*;
+
+import org.python.core.PyException;
import org.python.util.PythonInterpreter;
import java.io.File;
@@ -64,8 +66,22 @@ public class JythonTest
"sys.path.insert(0,\""+classesDir.getCanonicalPath()+"\")\n"+
"sys.path.insert(0,\""+testDir.getCanonicalPath()+"\")\n"
);
- interp.execfile(new File(testDir, "proton-test").getCanonicalPath());
+ try
+ {
+ interp.execfile(new File(testDir,
"proton-test").getCanonicalPath());
+ }
+ catch (PyException e)
+ {
+ if( e.type.toString().equals("<type 'exceptions.SystemExit'>") &&
e.value.toString().equals("0") )
+ {
+ // Build succeeded.
+ }
+ else
+ {
+ throw e;
+ }
+ }
}
}
Modified: qpid/proton/trunk/tests/proton-test
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/proton-test?rev=1392531&r1=1392530&r2=1392531&view=diff
==============================================================================
--- qpid/proton/trunk/tests/proton-test (original)
+++ qpid/proton/trunk/tests/proton-test Mon Oct 1 19:20:39 2012
@@ -623,7 +623,7 @@ if not list_only:
if xmlr:
xmlr.end()
-if failed or skipped:
+if failed:
sys.exit(1)
else:
sys.exit(0)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]