[Dev] Jython and <resources>

Frank Cohen fcohen at pushtotest.com
Fri Jul 13 09:29:54 PDT 2007


Thanks. This is kind of a remedial course on TestMaker 5. :-)

Please help me with another problem. I now use:

<resources>
    <module name="JythonClass" path="./example_agents/dplExample/ 
DPLExample2.py"/>
</resources>

and

I am running TestMaker on JDK 1.6 and the TestNode on 1.5

and

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

and I see in TestMaker_home/TestNetwork/TestNode/logs/catalina.out

jython
java.lang.NullPointerException
         at java.io.FileInputStream.<init>(FileInputStream.java:103)
         at java.io.FileInputStream.<init>(FileInputStream.java:66)
         at java.io.FileReader.<init>(FileReader.java:41)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsF 
ormCallScript(ScriptRunner.java:447)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsF 
romCall(ScriptRunner.java:419)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.setupMetho 
dForTest(ScriptRunner.java:225)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.setMethods 
(ScriptRunner.java:213)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.<init> 
(ScriptRunner.java:192)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestusecaseRunner.runOn 
eTime(TestusecaseRunner.java:346)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner.runF 
unctionaltest(TestscenarioRunner.java:288)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner.acce 
ss$000(TestscenarioRunner.java:91)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner 
$FunctionalTest.run(TestscenarioRunner.java:272)
Exception in thread "Thread-59" java.lang.NoSuchMethodError:  
javax.script.Invocable.invokeFunction(Ljava/lang/String;[Ljava/lang/ 
Object;)Ljava/lang/Object;
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsF 
ormCallScript(ScriptRunner.java:458)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.argumentsF 
romCall(ScriptRunner.java:419)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.setupMetho 
dForTest(ScriptRunner.java:225)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.setMethods 
(ScriptRunner.java:213)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner.<init> 
(ScriptRunner.java:192)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestusecaseRunner.runOn 
eTime(TestusecaseRunner.java:346)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner.runF 
unctionaltest(TestscenarioRunner.java:288)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner.acce 
ss$000(TestscenarioRunner.java:91)
         at  
com.pushtotest.testmaker.XSTest.xml.TestScenario.TestscenarioRunner 
$FunctionalTest.run(TestscenarioRunner.java:272)

What am I doing wrong?

-Frank


On Jul 13, 2007, at 8:41 AM, Luis Carlos Lara López wrote:

> HI Frank, the Jython system works exactly as any other script  
> system (JSR 223)
>
> To add a resource file, in the resource stage you don't use jar but  
> module, like in the ruby example
>
> 	<resources>
> 		<module name="rubyModule" path="./example_agents/rubyExample/ 
> calc.rb"/>
> 	</resources>
>
> The whole example is in tm5/TestMaker/example_agents/rubyExample/
>
> Hope this was helpfull,
>
> Greetings
> 	Luis Carlos Lara
>
>
>
> -----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 9:32 AM
> To: PushToTest TestMaker Developers List
> Subject: [Dev] Jython and <resources>
>
>
> Hi William and Luis Carlos: I'm confused about how I am supposed to
> identify a Jython script from within a TestScenario as a resource. Is
> the correct way:
>
> 	<resources>
>             <jar path="./example_agents/dplExample/DPLExample2.py"/>
>          </resources>
>
> if so, it would seem to me a more natural way would be
>
> 	<resources>
>             <script path="./example_agents/dplExample/ 
> DPLExample2.py"/>
>          </resources>
>
> What do you think?
>
> -Frank
>
>
>
> --
> Frank Cohen, PushToTest, http://www.PushToTest.com, phone 408 374 7426
> TestMaker: The open-source SOA test automation tool
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/dev
> _______________________________________________
> Dev mailing list
> Dev at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/dev
>



--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone 408 374 7426
TestMaker: The open-source SOA test automation tool





More information about the Dev mailing list