It's probably not appropriate to add messages to the FacesContext at that point. Inside the test, you are looking at the FacesContext as it exists at the end of the request. Since the request is over, and the JSF lifecycle is over, a new FacesMessage added to the FacesContext is in an undefined state.
You could install a PhaseListener for test purposes that adds a FacesMessage at the desired time during the JSF lifecycle. Then do assertions against the message in your test.
I've considered adding a feature that actually gives your test a callback during the lifecycle for just this kind of thing. But until your post, I haven't seen any demand for such a feature.
The usual way people test FacesMessages today is to just let the test go through the user interface and let the FacesMessage get created naturally. Then you do assertions to make sure that the FacesMessage was added as expected.
Thank you for your response. You told me exactly what was happening and explained some alternatives. It made me see the importance of a good understanding of JSF lifecycle.
I wrote tests just letting FacesMessages get created naturally. It was very easy and quick to create tests getting FacesMessages and doing the assertions. JSFUnit is excellent.