0 Replies Latest reply on Oct 24, 2008 2:56 PM by Tobias Hill

    Seam 2.1 issue: StatusMessages abstraction is weak for testing

    Tobias Hill Newbie

      The FacesMessages was in 2.1.0.GA release abstracted (thanks for that!) into StatusMessages. I've found a problem about that though: It is write only.

      In several of my SeamTests I verify that relevant messages are shown to the user. If I like to stay with the abstraction which StatusMessages provides (likely if testing non-client-oriented components) I have no means (as far as I can see) to extract the messages and inspect them.

      For instance FacesMessages.instance().getCurrentMessages() have no counterpart in StatusMessages.

      I can workaround this problem by doing something like                

      List<FacesMessage> messages = (List<FacesMessage>) invokeMethod("#{statusMessages.getCurrentMessages}");

      ... but the only reason why that works is the fact that the StatusMessages is implemented as a FacesMessages. I.e. I get hold of the messages via reflection. Fragile if you ask me.

      Am I missing something fundamental here? Or is it a flaw in the new design?