gnnn our mail server sucks big times lately. Always rejects my mails the first time :/
----- Forwarded Message ----- > From: Mark Struberg <[email protected]> > To: deltaspike <[email protected]> > Cc: > Sent: Monday, October 1, 2012 9:51 AM > Subject: Mock Contexts > > > > Hi! > > While hacking the @ViewScoped support I ran across our MockViewContext. > In CODI we used a Map based dummy implementation in ProjectStage == UnitTest. > But that might be counter productive if 'real' container unit testing is > done with Arquillian. > > Otoh > such a Mock Context is really useful in some cases. After thinking a > bit about it I came up with providing a MockContext which can be mapped > in for any other Context via ProcessAnnotatedType. > > Not sure how to run this though as currently scopes don't allow for > @Nonbinding payload, do they? > > The idea is to add a Configuration for all Scopes which should get mapped to > a > dummy context. > Then > replace all configured scopes on the beans with 'DealtaSpikeMock' + > original Context name and automatically register a Context for all those > configured dummy scopes. > The lifecycle of the beans can be > controlled by simply injecting the Extension and accessing the > underlying context via the original scope annotation. > > That way we can get rid of all 'manual' Mock Contexts and only use them > when really needed. > > LieGrue, > strub >
