I have a function
In Httpunit Test MyTestClass as follows:
public WebResponse getthing(myfrm){
myfrm.getScriptableObject().doEvent("MyCall()");
myfrm.getScriptableObject().submit();
return myfrm.submit();
}
I create a thread Object like:
class MyThread extends thread{
private MyTestClass mytest1=null;
private myfrm1=null;
MyThread(MyTestClass mytest1,WebForm myfrm1){
this.mytest1=mytest1;
this.myfrm1=myfrm1;
}
public void run(){
while (true) {
try{
mytest1.getthing(myfrm1);
}catch(InterruptedException e){}
}
}
}
public void executethread(){
WebForm myfrm=getForm();//some other method to get
form
MyThread thrd1 = new myThread(new MyTestcase
(),myfrm);
}
}
When executethread() function is executed, It gives
Error at JavaScript.java
at Above line "myfrm.getScriptableObject().doEvent
("MyCall()");"
So How could I implement thread properly to execute
Scripts ???????????????/Help me out Russ.
Logged In: YES
user_id=1113175
The Errors are at JavaScript.java:170
at"context.setOptimizationLevel( -1 );"
and at ScriptableDelegate.java:56 at" return getScriptEngine
().performEvent( eventScript );"
Now Russ may have answer and may not require further
Examples and Codes to run this, Owe thanks to his dedication
and intellect to Serve HttpUnit.
Logged In: YES
user_id=1220573
Originator: NO
Dear lavakafle,
thank you for your bug report. Interesting to note that your code failed at a non-official patch at that time. (The Errors are at JavaScript.java:170
at"context.setOptimizationLevel( -1 );" ...)
Thread safe execution has not been a design goal yet and as it looks we'd be dependend on the thread safety of the underlying packages (in this case rhino)
Nevertheless if you can proove the misbehaviour in JUnit format I'll happily add the result to the subversion repository in the new warnDisabled format (if it does not work).
Yours
Wolfgang
Logged In: YES
user_id=1220573
Originator: NO
Dear httpunit user!
Thank you for your bug report. We appreciate the time and effort you are putting into this.
Please supply a testcase with the expected result for the bug report that you are asking a solution for and we'll look into implementing it. For a start you might want to get the trunk version from the subversion repository (see https://sourceforge.net/svn/?group_id=6550\)
and have a look at the source code of some of the more than 700 JUnit based testcase in there.
If you do not use or have subversion tool you can still directly browse our test cases via:
http://httpunit.svn.sourceforge.net/viewvc/httpunit/trunk/httpunit/test/com/meterware/httpunit/
Looking into one or more of the Junit Java source files
should give you a clue on what a proper testcase for httpunit looks like, often you will probably only have to "clone" an existing testcase and modify it slightly to your needs.
When you are ready you might want to attach the testcase (and if you already have started implementing a solution for it it also the actual code) to the patch section of the sourceforge.net tracker for patches of the httpunit project at
https://sourceforge.net/tracker/?atid=306550&group_id=6550&func=browse.
The main communication about further details of the development is via the httpunit developer mailinglist. You are most welcome to sign up via
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
Yours
The httpunit developer team
(Russell, Wolfgang, Mark, Patrick and Tim as of 2008-04)
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).