Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 89005 invoked from network); 30 Sep 2003 17:34:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 30 Sep 2003 17:34:19 -0000 Received: (qmail 56685 invoked by uid 500); 30 Sep 2003 17:33:43 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 56614 invoked by uid 500); 30 Sep 2003 17:33:43 -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 Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 56561 invoked from network); 30 Sep 2003 17:33:42 -0000 Received: from unknown (HELO mail.messagingengine.com) (66.111.4.25) by daedalus.apache.org with SMTP; 30 Sep 2003 17:33:42 -0000 Received: from mail.messagingengine.com (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 12209246BD7 for ; Tue, 30 Sep 2003 13:33:45 -0400 (EDT) Received: from 10.202.2.150 ([10.202.2.150] helo=mail.messagingengine.com) by messagingengine.com with SMTP; Tue, 30 Sep 2003 13:33:45 -0400 X-Epoch: 1064943225 X-Sasl-enc: YxMmqq6dk2EYAsXmI312TQ Received: from mm.st (unknown [64.119.213.179]) by mail.messagingengine.com (Postfix) with ESMTP id B4186245B5C for ; Tue, 30 Sep 2003 13:33:44 -0400 (EDT) Message-ID: <3F79BD27.3020308@mm.st> Date: Tue, 30 Sep 2003 10:28:07 -0700 From: Steve K User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Unit testing pipelines? References: <2A3CDA39-EF43-11D7-AD24-000393D2CB02@apache.org> <3F773DA9.7000503@virbus.de> <3F7758E3.8080109@virbus.de> <3F777DEC.3020701@mm.st> <3F77C91E.4020309@upaya.co.uk> <3F787128.4050804@mm.st> <3F787BA3.9040001@upaya.co.uk> <3F788268.7070200@mm.st> <3F789F07.4080005@upaya.co.uk> In-Reply-To: <3F789F07.4080005@upaya.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Upayavira wrote: > "Putting test stuff in cocoon itself"? What do you mean? In my experience writing tests, generally you regard the thing you are testing as a "black box" -- the thing being tested should have no knowledge that it is being tested rather than running in a production environment. For example, the ExaclburTestCase is used to set up an Avlon environment for you to test Avalon components without changing them. I feel that adding "unittest" transformers to the sitemap or using a custom pipeline processor violates this principle. However, I am not overly religious about this -- if there already was a UnitTestPipeline and the appropriate hooks into the CocoonBean I would probably use it. It seems to me that the closest thing to what I really want would be the processURI() method in CocoonWrapper. Assuming this could be instantiated and called from a JUnit test, it would give me the black box effect I'm looking for. Ideally I'd like to be able to call any pipeline (including internal-only ones) and get back the result XML rather than the serialized form. I am not very familiar with the internals of Cocoon, but I suspect this would not be an easy thing to do. So we're probably back to a custom pipeline processor that can gather the XML from each step of the pipeline and return it in the environment somewhere (where would that be?). It also might be possible to host the Cocoon component in the EcaliburTestCase environment -- but I'm not sure if this gets me any closer to the internal-only pipelines and XML as I'm still at the mercy of the process() method. cheers, -steve