From 8456ef6a9793dee92e36a7ca7a8aa5866d798f5b Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Mon, 27 Aug 2007 15:51:10 +0000
Subject: [PATCH] Issue 1222 path and name of to config.py should be parameterized

---
 opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml b/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
index e38d674..2cc9f23 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
@@ -29,14 +29,29 @@
 <stax>
   <defaultcall function="start_job"/>
   <function name="start_job">
+    <function-single-arg>
+      <function-optional-arg name="config" default="''"/>
+    </function-single-arg>
+
     <sequence>
       <script>
         STAXLogMessage = 1
       </script>
-      
+
+      <script>
+        if config:
+          import os, sys
+          myconfigpath,myconfigfile=os.path.split(config)
+          sys.path.append("%s" % myconfigpath )
+          from config import *
+        else:
+          myconfigpath='%s/config' % TESTS_DIR
+          myconfigfile='config.py'        
+      </script>
+
       <job name="'Job: %s %s' % (STAF_REMOTE_HOSTNAME,TEST_OS_STRING) " monitor="1" clearlogs="'Enabled'" logtcstartstop="'Enabled'">
         <job-file>'%s/testcases/runFuncTests.xml' % TESTS_DIR</job-file>
-        <job-scriptfiles machine="STAF_LOCAL_HOSTNAME">['%s/config/config.py' % TESTS_DIR ]</job-scriptfiles>
+        <job-scriptfiles machine="STAF_LOCAL_HOSTNAME">['%s/%s' % (myconfigpath,myconfigfile) ]</job-scriptfiles>
         <job-action>
           <log>'Started sub-job %s on %s' % (STAXSubJobID,STAF_REMOTE_HOSTNAME)</log>
         </job-action>
@@ -457,7 +472,7 @@
         transformer.transform(source, result)
         
         #the new report transformation
-        TransformerFactory.newInstance().newTemplates(StreamSource(FileInputStream("%s/xsl/my-report.xsl" % TESTS_SHARED_DIR))).newTransformer().transform(StreamSource(FileInputStream("%s/tests-log.xml" % TMPDIR)), StreamResult(FileOutputStream("%s/my-report.html" % TMPDIR)))
+        TransformerFactory.newInstance().newTemplates(StreamSource(FileInputStream("%s/xsl/my-report.xsl" % TESTS_SHARED_DIR))).newTransformer().transform(StreamSource(FileInputStream("%s/tests-log.xml" % TMPDIR)), StreamResult(FileOutputStream("%s/my-report.html" % TMPDIR)))      
       </script>
       
       <if expr="SEND_MAIL_AFTER_TEST_RUN == 'TRUE'">
@@ -506,5 +521,6 @@
         }
       </call>
     </sequence>
+  
   </function>
 </stax>

--
Gitblit v1.10.0