cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject How to register MockProcessInfoProvider?
Date Tue, 24 Jul 2007 09:51:56 GMT
Hi,

I'll give you some background to my problem. I use ProcessInfoProvider for accessing environmental
data because I've read[1] that it is a 
proffered way to do this in Cocoon 2.2. Now, I would like to write tests for Spring beans
depending on ProcessInfoProvider. I thought that 
it makes sense to provide mock implementation and register it in AbstractTestCase, similarly
to how settings is registered; see my commit 
r558983[2].

I think, that it should work well and I think that it makes sense to register ProcessInfoProvider
implementation in AbstractTestCase because 
this component provides access to environment and should be easily available for every test.
The problem is that ProcessInfoProvider refers 
to javax.servlet.http.HttpServletRequest and in AbstractTestCase request is created with type
org.apache.cocoon.environment.Request.

I'm puzzled what to do in such case, do you have any suggestion?

[1] http://article.gmane.org/gmane.text.xml.cocoon.devel/68706
[2] http://article.gmane.org/gmane.text.xml.cocoon.cvs/24845

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Mime
View raw message