I'm very confused as to what you're doing.  Why were you trying to use 
Jython when you knew it wouldn't work "because of the absence of Ctypes 
modules in it"?  Note that STAX uses Jython 2.1.

In regards to directing you to actual STAX jobs, we provide several STAX 
jobs (.xml files) in the libraries and samples directory when you extract 
the STAXVxxx.zip/tar file.   They are "real" STAX jobs that do real 
things.

Many people don't leverage any of Jython's capabilities.  They simply use 
the <process> element to run their testcases (which may be written in any 
language) on whatever machines in parallel (e.g. via the <paralleliterate> 
element or sequentially).  Jython is merely the scripting language that 
STAX uses for variable and expression evaluation. STAX uses the Python for 
variable and expression evaluation.  You don't have to exploit any of 
Jython's capabilities, though you can if desired.

How each test team writes their STAX jobs is completely up to them.  I 
don't have access to other test team's STAX jobs.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 286-7313 or Tieline 363-7313




[EMAIL PROTECTED] 
12/01/2008 04:58 PM

To
Sharon Lucas/Austin/[EMAIL PROTECTED]
cc
[email protected]
Subject
Re: [staf-users] Unable to execute a process and getting the error: "The 
process failed to start, RC: 10"








On Mon, Dec 1, 2008 at 3:13 PM, Sharon Lucas <[EMAIL PROTECTED]> wrote:

Importing a Jython module and running it via a <script> element runs it 
within the same Jython interpreter as the STAX job.  You can have your 
Jython script return whatever you want (e.g. return 'pass' or return 
'Failed with xxx'.  So that it could return an indication of the test 
status which you can assign to a variable such as "testOutput" and then 
check it to determine if the test passed or failed.  For example: 

<testcase name="'Test1'"> 
  <sequence> 

    <script>
     testOutput = FreqAndLevelTest()
   </script> 

    <if expr="testOutput == 'Success'"> 
      <tcstatus result="'pass'"/> 
      <else> 
        <tcstatus result="'fail'">testOutput</tcstatus> 
      </else> 
    </if> 

  </sequence> 
</testcase> 

If you really neededto use a <process> element instead to run your test, 
perhaps because you need to run the program on a remote machine, you could 
do this instead as I'll talk about next. 

Is there a reason why you're using Jython to call the java programs that 
test your APIs instead of just running a Java program (or programs) 
directly to test your APIs via a <process> element?  For example: 

<process> 
  <location>'local'</process> 
  <command mode="'shell'">'java Test'</command> 
  <stderr mode="'stdout'"/> 
  <returnstdout/> 
</process> 

If there is a good reason why you're using Jython instead of Java 
directly, you could run a Jython script via a <process> element on a 
machine if Jython is installed and accessible in the path, or you can 
fully qualify the path to the jython executable, on the machine where the 
process is run.  Also, your Jython script must provide a main() function 
and check if the __main__ top level module is called and have it call the 
main() function in order to handle being run as a program.   To run a 
particular function in your Jython script, you would need to modify your 
Jython script to accept a argument by having it's main() function check 
the argument(s) passed in.  See Python documentation such as 
http://www.artima.com/weblogs/viewpost.jsp?thread=4829 for more 
information on the main() function and on passing arguments to it.   You 
don't import the Jython module in this case as you are running the Jython 
script in a separate program.  Here's an example of running a Jython 
script via a <process> element: 

<process> 
  <location>'local'</process> 
  <command mode="'shell'">'jython C:/tests/test1.py'</command> 
  <stderr mode="'stdout'"/> 
  <returnstdout/> 
</process> 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 286-7313 or Tieline 363-7313


Sharon,

The whole purpose of using Java is to load the dll and access its exported 
APIs which at the moment Jython is unable to do because of the absence of 
Ctypes modules in it. The ctypes is planned on its roadmap and is expected 
to be out in a period of four to five months.

Had ctypes been available this time then also all the Tests had to be 
written in Jython. With the idea of keeping the tests unchanged, I thought 
of calling the dlls and its associated APIs from Java. This way my Tests 
would need quite a less number of changes (to adapt them to using cytpes 
when it is available) as opposed to writing them now purely in Java ( as 
you pointed out) and then changing them to entirely in Jython (when ctypes 
is available).

I have had a look at STAX User guides and Training manuals, but they all 
do not deal with the real world test cases. Could you please direct me to 
some useful sites where I can actaully see the Stax jobs, how they use 
Jython, and how different people do different test setups. I think this 
would give me more clarity and enable me to use the STAF/STAX to the 
fullest ( as we are naive users and starting to implememt it on our 
organization).


I will work on your above post and will disturb you :o) again if in case I 
have more to ask you on this.


Many thanks,


Cheers,
Rajat 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to