Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#22 Document how to test the presentation layer - date formattin

open
nobody
None
5
2005-03-13
2005-03-13
Ralf Hauser
No

My struts application should print dates according to
the user session's locale. Unfortunately, it always
chooses English.

Can StrutsTestCase for JUnit be used to find out why,
i.e. test this?

I'd prefer to test this with the "Mock Testing"
approach since I am having trouble to get cactus
running for similar tests
(http://issues.apache.org/jira/browse/CACTUS-200).

So basically, what I need is the leanest way to test
how a Date gets printed from the server to my browser.
I should take into consideration:
- my struts-config.xml
- the locale I define
- my applications property file where I define for
example the
org.apache.struts.taglib.bean.format.date=yyyy-MM-dd
HH:mm:ss
for the German locale.

Unfortunately, the default struts test junit test cases
do not cover date formatting yet (see also
http://issues.apache.org/bugzilla/show_bug.cgi?id=33991\)

If this is already possible, please add the answer to
the FAQ!

Discussion