Re: [Wicket-user] How To Test with getApplication method

2007-05-31 Thread Johan Compagner

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


Re: [Wicket-user] How To Test with getApplication method

2007-05-31 Thread Jean-Baptiste Quenot
* Johan Compagner:

 we fixed  this in 1.3 so  that you can use  your own application
 class, So  in 1.2 there isn't  really a right way  to reuse your
 webapplication object

Indeed,  users  that  need  this feature  will  have  to  backport
MockWebApplication and WicketTester on their 1.2.x version.
-- 
 Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

-
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


[Wicket-user] How To Test with getApplication method

2007-05-30 Thread tma tma

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