Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 73426 invoked from network); 24 Jul 2007 09:52:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2007 09:52:37 -0000 Received: (qmail 8223 invoked by uid 500); 24 Jul 2007 09:52:35 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 8144 invoked by uid 500); 24 Jul 2007 09:52:35 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 8133 invoked by uid 99); 24 Jul 2007 09:52:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 02:52:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of grek@tuffmail.com designates 216.86.168.179 as permitted sender) Received: from [216.86.168.179] (HELO mxout-04.mxes.net) (216.86.168.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 02:52:31 -0700 Received: from [192.168.0.129] (unknown [80.240.191.89]) by smtp.mxes.net (Postfix) with ESMTP id C0252A3238 for ; Tue, 24 Jul 2007 05:52:10 -0400 (EDT) Message-ID: <46A5CBBC.8040604@tuffmail.com> Date: Tue, 24 Jul 2007 11:51:56 +0200 From: Grzegorz Kossakowski User-Agent: Thunderbird 2.0.0.5 (X11/20070716) MIME-Version: 1.0 To: Cocoon's dev mailing list Subject: How to register MockProcessInfoProvider? Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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/