I have an application which used Session EJB's to deliver data to Wicket pages.

These are looked up using JNDI in the main application class: for the sake of argument let's call it MainApplication.java.

I then have a BasePage.java from which all other pages that use these EJB's inherit, in which there is a getter that returns the EJB service as follows:

  public EJBLocal getEJBService() {
return ((MainApplication)this.getApplication()). getEJBService();
    }

It all works nicely, but I want to (retrospectively, slap on the wrist) write a test harness to validate the application.

My problem is I get a ClassCastException in BasePage.java because the MockWebApplication that WicketTester creates/uses cannot be cast to MainApplication.

I've seen examples where Spring beans are mocked off, so I'm sure it's possible.

Has anyone got any ideas or suggestions?

Regards,
Andy Barlow




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to