You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2012/09/27 14:45:10 UTC
svn commit: r1390969 -
/qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
Author: rgodfrey
Date: Thu Sep 27 12:45:09 2012
New Revision: 1390969
URL: http://svn.apache.org/viewvc?rev=1390969&view=rev
Log:
PROTON-34 : Applied patch from Hiram Chirino to restore the Jython tests from maven
Modified:
qpid/proton/trunk/proton-j/src/test/java/org/apache/qpid/proton/test/JythonTest.java
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=1390969&r1=1390968&r2=1390969&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 Thu Sep 27 12:45:09 2012
@@ -32,6 +32,7 @@ public class JythonTest
{
static final private String PROTON_TESTS = "PROTON_TESTS";
+ static final private String PROTON_COMMON = "PROTON_COMMON";
@Test
public void test() throws Exception
@@ -56,12 +57,30 @@ public class JythonTest
}
}
+ File commonDir;
+ String protonCommonVar = System.getenv(PROTON_COMMON);
+ if( protonCommonVar != null && protonCommonVar.trim().length()>0 )
+ {
+ commonDir = new File(protonCommonVar).getCanonicalFile();
+ assertTrue(PROTON_COMMON + " env variable set incorrectly: " + protonCommonVar, commonDir.isDirectory());
+ }
+ else
+ {
+ commonDir = new File(basedir, "../proton-c/bindings/python");
+ if( !commonDir.isDirectory() )
+ {
+ return;
+ }
+ }
+ // /proton-c/bindings/python
+
File classesDir = new File(basedir, "target/classes");
PythonInterpreter interp = new PythonInterpreter();
interp.exec(
"import sys\n"+
"sys.path.insert(0,\""+classesDir.getCanonicalPath()+"\")\n"+
+ "sys.path.insert(0,\""+commonDir.getCanonicalPath()+"\")\n"+
"sys.path.insert(0,\""+testDir.getCanonicalPath()+"\")\n"
);
interp.execfile(new File(testDir, "proton-test").getCanonicalPath());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org