struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Higham" <>
Subject RE: Does the StrutsTestCase test filters defined in web.xml?
Date Mon, 14 May 2012 10:09:58 GMT
Hi Miguel,

I haven't used the StrutsSpringTestCase however I have made use of the StrutsTestCase.

This only tests the interceptor stack / Action / Result. There is no web server involved and
no attempt to render the resulting page. Therefore I would be surprised if anything from web.xml
is called.

You could try looking at Apache Cactus or Apache HttpClient to test this behaviour? Alternatively
if you generate the file within Struts then the StrutsTestCase will suffice. I've generated
exports from Struts this way.



-----Original Message-----
From: Miguel Almeida [] 
Sent: 14 May 2012 10:16
Subject: Does the StrutsTestCase test filters defined in web.xml?

Dear all,

I am using StrutsSpringTestCase (which extends StrutsTestCase) to perform some acceptance
tests (under the skin). I am also using Displaytag ( ) to build some
tables in the view.
This tag supports excel/pdf export, which uses a filter you configure in web.xml [1]

The way the filter works is, in short: a (odd looking, numerical) parameter is added to the
request. The filter checks for the existence of that parameter and, if it exists, creates
the pdf/excel. 

I want to test the creation of this file (and its contents). However, when I debug the StrutsSpringTestCase
test with a breakpoint on that filter it does not stop there, so my questions are:

1) Does the StrutsTestCase not pass through other filters in your web.xml, and only goes through
the struts filter?
2) If so, is there anything else in the struts tests that could help me out? How do you suggest
I perform this test?
Thank you,

Miguel Almeida

[1]- see 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message