Hi
There seems to be a problem with wicket tester and the session created
(I use my own custom session). I create the wicket tester like this:
final ApplicationContext context = new
ClassPathXmlApplicationContext(
"applicationContext.xml");
IDBDao base = (IDBDao) context.getBean("dBDao");
dbProvider = base;
base.generateDummyData();
// 2. setup mock injection environment
AnnotApplicationContextMock appctx = new
AnnotApplicationContextMock();
appctx.putBean("dBDao", dbProvider);
wicketTester = new WicketTester(ZeuzGroupApplication.class);
WebApplication app = wicketTester.getApplication();
app.addComponentInstantiationListener(new
SpringComponentInjector(app,
appctx));
The application works fine without testing. But I get a class cast
exception when testing, since the session arent my custom one, heres how
I instantiate new sessions in my webapplication:
@Override
public Session newSession(Request request, Response response) {
ZeuzSession zeuzSession = new ZeuzSession(this, request);
return zeuzSession;
}
-regards Nino
--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]