2 Replies Latest reply on Mar 15, 2007 4:25 AM by Chris Lowe

    Testing an @Asynchronous action

    Chris Lowe Apprentice


      I have added a call to an asynchronous call to one of my actions. When running from testng I get an NPE from the seam.core.Dispatcher where the offending code is trying to dereference a null object. The object in question is:

      @Resource TimerService timerService;

      After some digging I find that embeddable EJB does not support a timer service. Fine. But I *really* need to be able to test my functionality here, even if it runs synchronously. That brings me to my request - is it possible for any of the following to happen in this scenario (in order of preference):

      1. Get my hands on the JBoss 5 Embedded which promises a microcontainer that "can run everything JBoss AS can"?
      2. Be able to create a mock TimerService as part of Seam test?
      3. Seam to recognise that there is no timerService, issue a big fat warning and ignore @Asynchronous altogether?

      Are there any other options I've missed? #1 would be preferable assuming the container is stable enough - anyone know when it is going to be released?. I don't mind having a go at #2, but I could use some direction (like creating and installing an instance of @Resource TimerService for instance);

      Best Regards,