You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jnorris <j....@snet.net> on 2008/03/14 19:27:13 UTC

Quickstart TestHomePage exception with AuthWebSession

Hi everyone,

The TestHomePage test class that is created by the wicket quickstart
archetype is throwing a ClassCastException when AuthenticatedWebSession is
extended:

Caused by: java.lang.ClassCastException:
org.apache.wicket.protocol.http.WebSession
	at
org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
	at com.test.MyWebSession.get(MyWebSession.java:48)
	at com.test.HomePage.<init>(HomePage.java:21)

However running the application does not cause this exception to happen.  Do
I need to change something in that default test case?  I haven't used
WicketTester before so I'm not sure if this is expected behavior since the
page requires a role of "User".  However I still wouldn't expect the class
cast exception on the .get() method.  BTW, this happens with 1.3.1 and
1.3.2.

I've attached a quickstart which illustrates this.

Jim

http://www.nabble.com/file/p16049037/SessionTest.zip SessionTest.zip 


-- 
View this message in context: http://www.nabble.com/Quickstart-TestHomePage-exception-with-AuthWebSession-tp16049037p16049037.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Quickstart TestHomePage exception with AuthWebSession

Posted by jnorris <j....@snet.net>.
Thank you Igor, that resolved the problem with the exception.

Jim

igor.vaynberg wrote:
> 
> public void setUp()
> 	{
> 		tester = new WicketTester(new MyApplication());
> 	}
> 
> -igor
> 
> On Fri, Mar 14, 2008 at 11:27 AM, jnorris <j....@snet.net> wrote:
>>
>>  Hi everyone,
>>
>>  The TestHomePage test class that is created by the wicket quickstart
>>  archetype is throwing a ClassCastException when AuthenticatedWebSession
>> is
>>  extended:
>>
>>  Caused by: java.lang.ClassCastException:
>>  org.apache.wicket.protocol.http.WebSession
>>         at
>> 
>> org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
>>         at com.test.MyWebSession.get(MyWebSession.java:48)
>>         at com.test.HomePage.<init>(HomePage.java:21)
>>
>>  However running the application does not cause this exception to happen. 
>> Do
>>  I need to change something in that default test case?  I haven't used
>>  WicketTester before so I'm not sure if this is expected behavior since
>> the
>>  page requires a role of "User".  However I still wouldn't expect the
>> class
>>  cast exception on the .get() method.  BTW, this happens with 1.3.1 and
>>  1.3.2.
>>
>>  I've attached a quickstart which illustrates this.
>>
>>  Jim
>>
>>  http://www.nabble.com/file/p16049037/SessionTest.zip SessionTest.zip
>>
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/Quickstart-TestHomePage-exception-with-AuthWebSession-tp16049037p16049037.html
>>  Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>  For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Quickstart-TestHomePage-exception-with-AuthWebSession-tp16049037p16092058.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Quickstart TestHomePage exception with AuthWebSession

Posted by Igor Vaynberg <ig...@gmail.com>.
public void setUp()
	{
		tester = new WicketTester(new MyApplication());
	}

-igor

On Fri, Mar 14, 2008 at 11:27 AM, jnorris <j....@snet.net> wrote:
>
>  Hi everyone,
>
>  The TestHomePage test class that is created by the wicket quickstart
>  archetype is throwing a ClassCastException when AuthenticatedWebSession is
>  extended:
>
>  Caused by: java.lang.ClassCastException:
>  org.apache.wicket.protocol.http.WebSession
>         at
>  org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
>         at com.test.MyWebSession.get(MyWebSession.java:48)
>         at com.test.HomePage.<init>(HomePage.java:21)
>
>  However running the application does not cause this exception to happen.  Do
>  I need to change something in that default test case?  I haven't used
>  WicketTester before so I'm not sure if this is expected behavior since the
>  page requires a role of "User".  However I still wouldn't expect the class
>  cast exception on the .get() method.  BTW, this happens with 1.3.1 and
>  1.3.2.
>
>  I've attached a quickstart which illustrates this.
>
>  Jim
>
>  http://www.nabble.com/file/p16049037/SessionTest.zip SessionTest.zip
>
>
>  --
>  View this message in context: http://www.nabble.com/Quickstart-TestHomePage-exception-with-AuthWebSession-tp16049037p16049037.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org