All,

I've hit a painful problem as I try to migrate to 2.1.6 (from 2.0.14).

I have a class that extends ActionSupport and which calls getText() from
within a routine. I want to test the routine to ensure that it is working
properly. My test runs fine when I compile with 2.0.14 but disappears into a
morass of mock object hell under 2.1.6.

The routine to be tested is simple enough. and is reproduced below...

<code>
    public String getTitle() {
        String retVal = "";
        String key = this.getTitlePropertyKey();
        if ( key != null) {
            retVal = getText(key + ".title");
        }
        return retVal;
    }
</code>


The test compares a value in a test resource file with the value being
returned.

If I try to run this under 2.1.6, I discover that in order to call getText
in an ActionSupport object, I have to provide a Context object and a Locale
and ValueStack and a Container and an XWorkConverter (that I can't mock
because it isn't an interface and can't create because it has a protected
constructor)...

This is really making me cross. Can anyone provide some clues as to how to
get this test to work or a suggestion as to how to better refactor the whole
thing to fit 'The Struts Way'?


Later,

Andy
-- 
View this message in context: 
http://www.nabble.com/My-tests-fail-in-2.1.6---can-someone-help--tp21787233p21787233.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to