i think this was a problem in 1.2
we fixed this in 1.3 so that you can use your own application class,
somebody please correct me if i am mistaken here

So in 1.2 there isn't really a right way to reuse your webapplication object

johan


On 5/30/07, tma tma <[EMAIL PROTECTED]> wrote:

Hi

I am not native English speaker.
sorry for poor English.

I use wicket 1.2.6 .
I have question to use WicketTester.

i want to make Global object ,create instance in WebApplication Class and
create method to access the instance.
In WebPage class ,access the instance like this

SingleClass class = ((FooApplication)getApplication()).getSingleClass();

'FooApplication' extends WebApplication and 'SingleClass' is Global
object's class.

To test the above WebPage class, make the class 'FooApplicationTester'
that extends WicketTester and
Copy & Paste the FooApplication's method .

when run the test code, ClassCastException happens.
I declared interface IFooApplication and implement at FooApplication and
FooApplicationTester.
I changed the WebPage class like this

SingleClass class = ((IFooApplication)getApplication()).getSingleClass();

This way, I can run without exception.
But I don't want to create interface.
Is there other way to solve ?

best regards


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to