[Dev] Jython and <resources>

William Martínez Pomares wmartinez at AVANTICATEC.NET
Fri Jul 13 10:57:39 PDT 2007


Frank.
1. The correct way to reference an script module is using the module attribute, in the resources section and in the run statement to indicate where to look up the class.

2. JSR 223 is not able to instantiate a class. It may call a method or invoque a method in a class already instantiated. To do that, it needs a method that returns the object. That is why the standard should be adding an "entry point" method that will return the object instance of the class we want to test. That method should be of the form get<classname>()

3. For some reason, the Jython example you sent that uses the tool library is returning a symbol not found. That is, the jython when running is not able to find the tool.jar in the classpath, which is weird since the tool.jar is in the lib directory of the application.

Luis Carlos is checking to see what is wrong.

William

-----Original Message-----
From: dev-bounces at lists.pushtotest.com
[mailto:dev-bounces at lists.pushtotest.com]On Behalf Of Luis Carlos Lara
López
Sent: Friday, July 13, 2007 11:46 AM
To: PushToTest TestMaker Developers List
Subject: RE: [Dev] Jython and <resources>
Importance: High


Hi Frank

With the Jython test we have 3 problems, in the TestScenario, in the Jython and in Tomcat.
 2 of them are solved now

TestScenario a missing tag to inform the tomcat about the module

<run name="test1" testclass="DPLExample" method="runTest" langtype="jython"/>
<run module="JythonClass" name="test1" testclass="DPLExample" method="runTest" langtype="jython"/>


In the Jtyhon file, the standard method class class constructor get+Name of the class
def getDPLExample():
    return DPLExample()


In Tomcat, it seems there is a problem with the imports

javax.script.ScriptException: Traceback (innermost last):
  File "<unknown>", line 10, in ?
ImportError: No module named pushtotest
        at com.sun.script.jython.JythonScriptEngine.evalCode(JythonScriptEngine.java:292)
        at com.sun.script.jython.JythonScriptEngine.eval(JythonScriptEngine.java:170)
        at com.sun.script.jython.JythonScriptEngine.eval(JythonScriptEngine.java:175)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:232)
        at com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsFormCall
Script(ScriptRunner.java:450)
        at com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsFromCall

Without the imports, the test works fine, but with the imports, it seems to be a problem with the jython engine. I am working to find out what is the problem

Hope this was useful
LC


-----Original Message-----
From: dev-bounces at lists.pushtotest.com
[mailto:dev-bounces at lists.pushtotest.com]On Behalf Of Frank Cohen
Sent: Friday, July 13, 2007 10:57 AM
To: PushToTest TestMaker Developers List
Subject: Re: [Dev] Jython and <resources>
Importance: High


See attached files. Thanks. -Frank


_______________________________________________
Dev mailing list
Dev at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3509 bytes
Desc: not available
Url : http://cake.pushtotest.com/pipermail/dev/attachments/20070713/d2b8e8e1/attachment.bin


More information about the Dev mailing list