I switched over to using an anonymous overridden WebApplication:
--
WebApplication webApplication = new WebApplication() {
@Override
public Session newSession(Request request, Response response) {
return new CustomSession(request);
}
Neither the constructor of CustomSession nor the constructor of WebSession is
called. The error occurs much earlier, as you can see in the stack trace
posted in my first post.
I think I will drop overriding the default session and work with
setAttribute()/getAttribute() instead. Seems to save me
Yes, with a normal Wicket-Application it works just perfect.
I'm using the SpringWebApplication cause of createSpringBeanProxy() and the
automatic init of the configured ApplicationContext
(http://cwiki.apache.org/WICKET/spring.html).
Manually initializing would be a huge tradeoff for working
I'm referring to both.
The CCE occurs if I construct the WicketTester without my application as an
argument. If I do, I get the illegal state exception.
Problem with this seems to be, that the ServletContext created at
MockWebApplication:130 does not contain the required WebApplicationContext
On Sun, 17 Feb 2008, Sven Schliesing wrote:
I'm using the SpringWebApplication cause of createSpringBeanProxy() and the
automatic init of the configured ApplicationContext
(http://cwiki.apache.org/WICKET/spring.html).
Manually initializing would be a huge tradeoff for working tests. :)
Hmm,
I think I don't get it :(
I narrowed down the problem to this test case. It would be great if you
could take a look:
---
public class WebApplicationTest {
public class CustomSession extends WebSession {
public CustomSession(Request request) {
you need to override newsession on the app and return your subclass
-igor
On Fri, Feb 15, 2008 at 2:00 AM, Sven Schliesing
[EMAIL PROTECTED] wrote:
I think I don't get it :(
I narrowed down the problem to this test case. It would be great if you
could take a look:
On Fri, 15 Feb 2008, Igor Vaynberg wrote:
you need to override newsession on the app and return your subclass
But he did it here, no?
public class MyApplication extends SpringWebApplication {
private SpringComponentInjector springComponentInjector;
right, missed it. i guess the next step would be to set a breakpoint
there and see if its ever called. if not, set a breakpoint in
websession constructor and see why that is invoked instead of the
overridden factory.
-igor
On Fri, Feb 15, 2008 at 10:25 AM, Timo Rantalaiho [EMAIL PROTECTED]
Yeah, put some break points in there, and if you still have trouble
provide a quickstart...
regards Nino
Sven Schliesing wrote:
I think I don't get it :(
I narrowed down the problem to this test case. It would be great if you
could take a look:
---
public class
On Thu, 14 Feb 2008, Sven Schliesing wrote:
java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
Yep, you should provide it an ApplicationContext more
suitable for testing. There is the handy MockContext in
wicket-spring that you can use.
We
You could also take a look at the blog tutorial, has the solution for
this as I remember..
http://cwiki.apache.org/WICKET/blog-tutorial.html
From another example here:
final ApplicationContext context = new
ClassPathXmlApplicationContext(
applicationContext.xml);
12 matches
Mail list logo