i think the test environment should be improved. wickettester is great, but it is also very limited - because it itself is a subclass of app it is difficult to test apps that rely on their own application objects.

a better way i think would be to have a more complete mock environment that would host the actual servlet and create actualy mock httpservletrequest and responses to interact with the application

something like MockContainer container=new Container(IWebApplicationFactory factory);
Page page=container.requestUrl("/");
container.click(page, "path to link");

i think infrastructure like this would be more flexible and a better test environment. i realize this is much more work then wickettester, but maybe something we can work on for 2.0

it will also make it possible to test spring based wicket apps which a few users requested now.

-Igor


On 5/22/06, Ingram Chen < [EMAIL PROTECTED]> wrote:
All,

    I have implemented testing file upload in WicketTester/FormTester.
for example:

byte[] bytesOfGif = new byte[]{1,2,3,4,5} ;
formTester.upload("myUploadField", bytesOfGif ,  "myImage.gif " );
formTester.submit() ;

the implementation is simple and limited (not support event such as "onUploadStarted"... etc)
If anyone interests this, I could supply a patch for 1.2 branch or truck.

--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen

Reply via email to