0 Replies Latest reply on Jan 15, 2007 10:29 PM by dsvmacdonald

    Testing FacesMessages with wmbedded container and injection

    dsvmacdonald

      When I try to test my login module using a TestNG integration test, it throws the following error:

      [testng] javax.ejb.EJBException: javax.el.PropertyNotFoundException: Property 'jboss' is not found on type: org.jboss.seam.Namespace

      After some debugging, I have tracked down the error message to the fact that I am injecting the FacesNessages in my LoginAction class using

      @In(create=true)
      private FacesMessages facesMessages;

      and

      facesMessages.addFromResourceBundle("some message");

      in the login method.

      If I rewrite the LogicAction class to use FacesMessages w/o injection, such as

      FacesMessages.instance().addFromResourceBundle("some message");

      it compiles fine and runs to completion. However, the assertion fails when I check the FacesMessages b/c it is null.

      Any ideas on how to fix this?

      Thanks,

      Dan