You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2015/07/06 14:47:47 UTC

qpid-proton git commit: add the jython shim to the class path in the JythonTest launcher

Repository: qpid-proton
Updated Branches:
  refs/heads/master 23a4e3bbb -> 1d8a0a41b


add the jython shim to the class path in the JythonTest launcher


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1d8a0a41
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1d8a0a41
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1d8a0a41

Branch: refs/heads/master
Commit: 1d8a0a41ba0f0812808fcb3780a3aa59db4120ad
Parents: 23a4e3b
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Mon Jul 6 08:47:06 2015 -0400
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Mon Jul 6 08:47:32 2015 -0400

----------------------------------------------------------------------
 tests/java/org/apache/qpid/proton/JythonTest.java | 14 ++++++++++++++
 tests/pom.xml                                     |  1 +
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d8a0a41/tests/java/org/apache/qpid/proton/JythonTest.java
----------------------------------------------------------------------
diff --git a/tests/java/org/apache/qpid/proton/JythonTest.java b/tests/java/org/apache/qpid/proton/JythonTest.java
index 9b979eb..ee9157e 100644
--- a/tests/java/org/apache/qpid/proton/JythonTest.java
+++ b/tests/java/org/apache/qpid/proton/JythonTest.java
@@ -46,6 +46,7 @@ public class JythonTest
 
     /* System properties expected to be defined in test/pom.xml */
     private static final String PROTON_JYTHON_BINDING = "protonJythonBinding";
+    private static final String PROTON_JYTHON_SHIM = "protonJythonShim";
     private static final String PROTON_JYTHON_TEST_ROOT = "protonJythonTestRoot";
     private static final String PROTON_JYTHON_TEST_SCRIPT = "protonJythonTestScript";
     private static final String PROTON_JYTHON_TESTS_XML_OUTPUT_DIRECTORY = "protonJythonTestXmlOutputDirectory";
@@ -67,12 +68,14 @@ public class JythonTest
     {
         String testScript = getJythonTestScript();
         String binding = getJythonBinding();
+        String shim = getJythonShim();
         String testRoot = getJythonTestRoot();
         String xmlReportFile = getOptionalXmlReportFilename();
         String ignoreFile = getOptionalIgnoreFile();
 
         PythonInterpreter interp = createInterpreterWithArgs(xmlReportFile, ignoreFile);
         interp.getSystemState().path.insert(0, new PyString(binding));
+        interp.getSystemState().path.insert(0, new PyString(shim));
         interp.getSystemState().path.insert(0, new PyString(testRoot));
 
         LOGGER.info("About to call Jython test script: '" + testScript
@@ -180,6 +183,17 @@ public class JythonTest
         return file.getAbsolutePath();
     }
 
+    private String getJythonShim() throws FileNotFoundException
+    {
+        String str = getNonNullSystemProperty(PROTON_JYTHON_SHIM, "System property '%s' must provide the location of the jythin shim");
+        File file = new File(str);
+        if (!file.isDirectory())
+        {
+            throw new FileNotFoundException("Shim location '" + file + "' should be a directory.");
+        }
+        return file.getAbsolutePath();
+    }
+
 
     private String getJythonTestRoot() throws FileNotFoundException
     {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d8a0a41/tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/pom.xml b/tests/pom.xml
index 395f18c..11eba60 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -69,6 +69,7 @@ directory &lt;basedir&gt;/build/proton-c.</description>
             <protonJythonIgnoreFile>${basedir}/java/pythonTests.ignore</protonJythonIgnoreFile>
             <protonJythonTestRoot>${basedir}/python</protonJythonTestRoot>
             <protonJythonBinding>${basedir}/../proton-c/bindings/python</protonJythonBinding>
+            <protonJythonShim>${basedir}/../proton-j/src/main/resources</protonJythonShim>
             <protonJythonTestScript>${basedir}/python/proton-test</protonJythonTestScript>
             <protonJythonTestXmlOutputDirectory>${testReportOutputDirectory}</protonJythonTestXmlOutputDirectory>
             <java.util.logging.config.file>${project.build.outputDirectory}/logging.properties</java.util.logging.config.file>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org