jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Tambascio" <ltambas...@charter.net>
Subject Re: problem using include
Date Tue, 27 Aug 2002 21:44:11 GMT
Vincent,

Thanks for your response.  First of all, perhaps I over 
stated the Struts-like nature of our framework.  It has 
similar concepts (Operations instead of Actions, InputBean 
instead of FormBeans), but isn't actually based in Struts 
by Jakarta.  :-(  I have been trying to create a 
BaseTestCase, loosely based on StrutsTestCase (servlet 
genre) that extends ServletTestCase.  At this point, it's 
still pretty thin, as I'm just trying to get a simple test 
case working against an operation.

I remember seeing that e-mail you attached, but hadn't 
made the connection.  I think that will help.

More below...

On Tue, 27 Aug 2002 21:54:40 +0100
  "Vincent Massol" <vmassol@octo.com> wrote:
>Hi Larry,
>
>> -----Original Message-----
>> From: Larry Tambascio [mailto:ltambascio@charter.net]
>> Sent: 27 August 2002 15:46
>> To: cactus-user@jakarta.apache.org
>> Subject: problem using include
>> 
>> Greetings fellow Cacti (sounds better than cactus'ers),
>> 
<snip>
>> 
>
>Ok. setURL() is simply a way to simulate a URL you would 
>normally get
>when calling your application in production. All the http 
>servlet
>request calls are wrapped by cactus to use the values 
>defined in
>setURL(). However, when you call include() or forward(), 
>Cactus needs to
>pass the original request object (not the wrapped one) as 
>this is a
>requirements of all Servlet 2.2 engines. It is true that 
>Servlet 2.3+
>engines should allow any wrapped request (as is mandated 
>by the filter
>spec). This is currently not implemented in Cactus.

Ah, I think this is tripping me up.  I was hoping the 
wrapped request object would be passed along.  The 
controller servlet would do it's thing, and the endXxx 
method would use the HttpUnit methods to assert the 
returned values.

Since Cactus comes in 2.2 and 2.3 flavors, how difficult 
would it be to pass on that wrapped request for flavor 
2.3??  Is it a small tweak, a big deal, or something in 
between?  Any guidance would be greatly appreciated!!

Thanks!!

-Larry
>
>That said, I'm not sure what you're trying to do. If you 
>want to call
>the struts controller, you simply need to write:
>
>public void testXXX()
>{
>    ActionServlet servlet = new ActionServlet();
>    Servlet.init(config);
>
>    servlet.process(request, response);
>}
>
>or do a forward() to the struts redirector (whatever 
>you've mapped it
>to).
>
>My question now is : with the above code, what are you 
>testing ? You
>need to put something in testXXX() or you are simply 
>performing a
>functional test as you could do with HttpUnit. But as you 
>said, that was
>certainly only a starting point ...
>
>Cheers,
>-Vincent
>  
>> Cactus v13-1.4  Tomcat v4.0.1 jdk 1.3.1_04.
>> 
>> Thanks,
>> -Larry
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:cactus-user-
>> unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: <mailto:cactus-user-
>> help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message